Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

v2v: move v2v-vmware ConfigMap to kubevirt-hyperconverged namespace #532

Merged
merged 1 commit into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/k8s/requests/v2v/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const CONVERSION_PROGRESS_ANNOTATION = 'v2vConversionProgress';

export const V2VVMWARE_DEPLOYMENT_NAME = 'v2v-vmware';

export const VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAMESPACE = 'openshift'; // along the common-templates ...
export const VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAMESPACE = 'kubevirt-hyperconverged';
export const VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAME = 'v2v-vmware';

export const VMWARE_TO_KUBEVIRT_OS_CONFIG_MAP_NAMESPACE = 'kube-public'; // note: common-templates are in the "openshift" namespace
Expand Down
22 changes: 18 additions & 4 deletions src/k8s/requests/v2v/startV2VvmwareController.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,36 @@ export const startV2VVMWareController = async ({ namespace }, { k8sGet, k8sCreat
throw new Error('V2V VMWare: namespace must be selected');
}

const name = V2VVMWARE_DEPLOYMENT_NAME;
mareklibra marked this conversation as resolved.
Show resolved Hide resolved
let activeDeployment;
let kubevirtVmwareConfigMap;

if (semaphors[namespace]) {
info(`startV2VVMWareController for "${namespace}" namespace already in progress. Skipping...`);
return;
}
semaphors[namespace] = true;

const name = V2VVMWARE_DEPLOYMENT_NAME;
let activeDeployment;
let kubevirtVmwareConfigMap;

try {
kubevirtVmwareConfigMap = await k8sGet(
ConfigMapModel,
VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAME,
VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAMESPACE
);
} catch (e) {
// This ConfigMap is expected to be created by a v2v operator which is currecntly under development, otherwise
// See https://github.com/kubevirt/web-ui-components/pull/507 for example
info(
`The ${VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAME} can not be found in the ${VMWARE_KUBEVIRT_VMWARE_CONFIG_MAP_NAMESPACE} namespace. `,
'The v2v pods can not be created. Error: ',
e
);
}

try {
if (!kubevirtVmwareConfigMap) {
return; // pass through finally()
}

activeDeployment = await k8sGet(DeploymentModel, name, namespace);

Expand Down