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 2141089: Ensure vm template object has namespace #972

Merged

Conversation

upalatucci
Copy link
Member

📝 Description

Cause
In CDI upload, dataVolume has no namespace as the template VM object has no namespace.

Solution
when VM object in template YAML has no namespace, the template namespace is implied

NOTE: change the dvName default name as VM.metadata.name in case of a template VM can be a parameter

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 17, 2022

@upalatucci: This pull request references Bugzilla bug 2141089, which is invalid:

  • expected the bug to target the "4.13.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 2141089: Ensure vm template object has namespace

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.

@upalatucci
Copy link
Member Author

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 17, 2022

@upalatucci: This pull request references Bugzilla bug 2141089, 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.13.0) matches configured target release for branch (4.13.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @gouyang

In response to this:

/bugzilla refresh

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 openshift-ci bot requested a review from gouyang November 17, 2022 13:47
Copy link
Member

@avivtur avivtur left a comment

Choose a reason for hiding this comment

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

please add screenshots to PR's description
why implying the template's namespace if VM has no namespace?
using the active namespace might be a better approach, wdyt?

@upalatucci
Copy link
Member Author

upalatucci commented Nov 17, 2022

What's the benefit of using the active namespace instead of the template namespace? Are there conditions where the template has no namespace?
Don't know what screenshots make... i didn't change anything graphically

@upalatucci
Copy link
Member Author

upalatucci commented Nov 18, 2022

I've just tested this out. If VM has no namespace specified, using the cli default is implied no matter the template namespace.
This means there is a little discrepancy with the UI. Now when the user wants to create a VM from the template in the UI using catalog, no matter what namespace the VM has, we update it with the current namespace. Maybe because in the ui we are interpreting the general concept of templates with a more specific concept (VM templates)

Anyway, in the template details page, the activeNamespace is the template namespace so I don't know the difference here. We have just less code using template namespace

@@ -131,7 +131,7 @@ export const getDataVolumeFromState = ({
createOwnerReference?: boolean;
}): V1beta1DataVolume => {
const dataVolume = getEmptyVMDataVolumeResource(vm, createOwnerReference);
const dvName = resultVolume?.dataVolume?.name || `${vm?.metadata?.name}-${diskState.diskName}`;
Copy link
Member Author

Choose a reason for hiding this comment

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

vm name can be a template parameter so just use another thing

@avivtur
Copy link
Member

avivtur commented Nov 20, 2022

@upalatucci that's great that you tested what is happening on cli, may I assume you were logged as admin user?
if so I wonder what happens for non-admin users if the VM's namespace is not specified as usually default is not elavated with any permissions to a non-admin user

Anyway, in the template details page, the activeNamespace is the template namespace so I don't know the difference here. We have just less code using template namespace

than I guess using the template's namespace is really the same as using activeNamespace

@avivtur
Copy link
Member

avivtur commented Nov 21, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Nov 21, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avivtur, upalatucci

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-ci openshift-ci bot added the approved This issue is something we want to fix label Nov 21, 2022
@openshift-merge-robot openshift-merge-robot merged commit 7086b2d into kubevirt-ui:main Nov 21, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2022

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

Bugzilla bug 2141089 has been moved to the MODIFIED state.

In response to this:

Bug 2141089: Ensure vm template object has namespace

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue is something we want to fix bugzilla/severity-high bugzilla/valid-bug lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants