Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1885319: Revise DataVolumeTemplate API field #6846

Conversation

yaacov
Copy link
Member

@yaacov yaacov commented Oct 6, 2020

The vm.Spec.DataVolumeTemplate api list actually contains DataVolumes rather than a struct that restricts the fields to only the metadata and spec. This gives the user the impression they can set things like the DataVolume group/kind and status when they in fact cannot.

Refs:
kubevirt/kubevirt#4261
kubevirt/kubevirt#4319

Screeshots:
The Bug (using patch 4216):
screenshot-localhost_9000-2020 10 06-09_34_54

Signed-off-by: yaacov kobi.zamir@gmail.com

@openshift-ci-robot
Copy link
Contributor

@yaacov: This pull request references Bugzilla bug 1885319, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1885319: Revise DataVolumeTemplate API field

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Oct 6, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2020
@yaacov
Copy link
Member Author

yaacov commented Oct 6, 2020

/hold freeze 🏂

cc:// @davidvossel

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 2020
@jelkosz
Copy link

jelkosz commented Oct 6, 2020

/hold cancel
the master is now opened for 4.7

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 2020
let dataVolume = dataVolumeTemplates.find((dv) => getName(dv) === volume.dataVolume.name);
let dataVolume = dataVolumeTemplates.find(
(dv) => getName(dv) === volume.dataVolume.name,
) as V1alpha1DataVolume;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont have to typecast here and anywhere else. Just specify the correct types from the beginning

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 👍

@yaacov yaacov force-pushed the make-datavolumetemplates-an-array-of-datavolumetemplatespcec branch from 0e34f1c to c98be22 Compare October 6, 2020 10:45
@rawagner
Copy link
Contributor

rawagner commented Oct 6, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2020
Copy link
Member

@atiratree atiratree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also what about

  • tests ?
  • clone-vm ?

@@ -221,7 +230,9 @@ export class VMWrapper extends K8sResourceWrapper<VMKind, VMWrapper> implements
storages.map((storage) => storage.disk),
);
this.data.spec.template.spec.volumes = _.compact(storages.map((storage) => storage.volume));
this.data.spec.dataVolumeTemplates = _.compact(storages.map((storage) => storage.dataVolume));
this.data.spec.dataVolumeTemplates = _.compact(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be consistent with this approach here - pleas update prependStorage as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -33,6 +34,14 @@ import { VirtualMachineImportModel, VirtualMachineModel } from '../../../models'
import { buildOwnerReferenceForModel } from '../../../utils';
import { transformDevices } from '../../../selectors/vm/devices';

export const getDataVolumeTemplateSpec = (dv: V1alpha1DataVolume): V1DataVolumeTemplateSpec =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about

Suggested change
export const getDataVolumeTemplateSpec = (dv: V1alpha1DataVolume): V1DataVolumeTemplateSpec =>
export const convertToDataVolumeTemplateSpec = (dv: V1alpha1DataVolume): V1DataVolumeTemplateSpec =>

or something similar to this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it probably shouldn't reside in vm-wrapper

@atiratree
Copy link
Member

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 2020
@yaacov
Copy link
Member Author

yaacov commented Oct 6, 2020

/retest

@yaacov yaacov force-pushed the make-datavolumetemplates-an-array-of-datavolumetemplatespcec branch from c98be22 to 3e9d834 Compare October 7, 2020 12:03
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2020
@yaacov yaacov force-pushed the make-datavolumetemplates-an-array-of-datavolumetemplatespcec branch 4 times, most recently from 8178aa3 to 672fc44 Compare October 7, 2020 13:47
size: getPvcStorageSize(pvc),
storageClassName: getPvcStorageClassName(pvc),
}).build();
const clonedDVTemplate: V1DataVolumeTemplateSpec = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rather use a DataVolumeWrapper here for easier use?

We could add a special method there similar to asResource for compatibility with V1DataVolumeTemplateSpec

size: getDataVolumeStorageSize(dataVolume),
storageClassName: getDataVolumeStorageClassName(dataVolume),
}).build();
const clonedDVTemplate: V1DataVolumeTemplateSpec = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar here

@yaacov
Copy link
Member Author

yaacov commented Oct 8, 2020

/retest

2 similar comments
@yaacov
Copy link
Member Author

yaacov commented Oct 8, 2020

/retest

@yaacov
Copy link
Member Author

yaacov commented Oct 8, 2020

/retest

@openshift-ci-robot
Copy link
Contributor

@yaacov: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/kubevirt-plugin 672fc44 link /test kubevirt-plugin

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 21, 2020
@yaacov
Copy link
Member Author

yaacov commented Dec 21, 2020

/retest

1 similar comment
@yaacov
Copy link
Member Author

yaacov commented Dec 21, 2020

/retest

@yaacov
Copy link
Member Author

yaacov commented Dec 22, 2020

/hold cancel
/retest

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 22, 2020
@yaacov yaacov force-pushed the make-datavolumetemplates-an-array-of-datavolumetemplatespcec branch from dd4f0be to 7b00143 Compare December 22, 2020 17:26
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 22, 2020
@yaacov
Copy link
Member Author

yaacov commented Dec 22, 2020

force push to skip buggy CI,

@metalice please re-review

@yaacov
Copy link
Member Author

yaacov commented Dec 22, 2020

/retest

3 similar comments
@yaacov
Copy link
Member Author

yaacov commented Dec 22, 2020

/retest

@yaacov
Copy link
Member Author

yaacov commented Dec 22, 2020

/retest

@yaacov
Copy link
Member Author

yaacov commented Dec 22, 2020

/retest

@metalice
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: metalice, rawagner, yaacov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@yaacov
Copy link
Member Author

yaacov commented Dec 23, 2020

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@yaacov
Copy link
Member Author

yaacov commented Dec 23, 2020

/retest

1 similar comment
@yaacov
Copy link
Member Author

yaacov commented Dec 23, 2020

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 23, 2020

@yaacov: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/kubevirt-plugin dd4f0be link /test kubevirt-plugin
ci/prow/analyze 7b00143 link /test analyze

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@yaacov
Copy link
Member Author

yaacov commented Dec 23, 2020

/retest

@openshift-merge-robot openshift-merge-robot merged commit 33e0fff into openshift:master Dec 23, 2020
@openshift-ci-robot
Copy link
Contributor

@yaacov: All pull requests linked via external trackers have merged:

Bugzilla bug 1885319 has been moved to the MODIFIED state.

In response to this:

Bug 1885319: Revise DataVolumeTemplate API field

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.7 milestone Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants