Skip to content

Commit

Permalink
Add immediate request annotaion to auploaded dvs
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Jan 13, 2021
1 parent 124dc5b commit 6c24401
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const CDI_UPLOAD_POD_ANNOTATION = 'cdi.kubevirt.io/storage.pod.phase';
export const CDI_UPLOAD_POD_NAME_ANNOTATION = 'cdi.kubevirt.io/storage.uploadPodName';
export const CDI_PHASE_PVC_ANNOTATION = 'cdi.kubevirt.io/storage.pod.phase';
export const CDI_BOUND_PVC_ANNOTATION = 'cdi.kubevirt.io/storage.condition.bound';
export const CDI_BIND_REQUESTED_ANNOTATION = 'cdi.kubevirt.io/storage.bind.immediate.requested';
export const CDI_UPLOAD_RUNNING = 'Running';
export const CDI_UPLOAD_OS_URL_PARAM = 'os';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
k8sKill,
k8sGet,
} from '@console/internal/module/k8s';
import { CDI_BIND_REQUESTED_ANNOTATION } from '../../../components/cdi-upload-provider/consts';
import { delay } from '../../../utils/utils';

const PVC_STATUS_DELAY = 2 * 1000;
Expand Down Expand Up @@ -68,6 +69,12 @@ export const createUploadPVC = async (dataVolume: V1alpha1DataVolume) => {
const dataVolumeName = getName(dataVolume);
const namespace = getNamespace(dataVolume);

dataVolume.metadata = dataVolume?.metadata || {};
dataVolume.metadata.annotations = {
...dataVolume?.metadata?.annotations,
[CDI_BIND_REQUESTED_ANNOTATION]: 'true',
};

try {
const dv = await k8sCreate(DataVolumeModel, dataVolume);
await waitForUploadReady(dv);
Expand Down

0 comments on commit 6c24401

Please sign in to comment.