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

kubevirt: don't set template namespace #4701

Conversation

yaacov
Copy link
Member

@yaacov yaacov commented Mar 10, 2020

When creating a VM using base template we change the template namespace.

If template namespace is not the current namespace ( e.g. when using base templtates ) we will get an error, and the VM will fail to create.

Screenshots:
After:
OKD(2)

Before:
OKD(3)

Settings:
OKD(1)

@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/kubevirt Related to kubevirt-plugin labels Mar 10, 2020
@yaacov
Copy link
Member Author

yaacov commented Mar 10, 2020

@suomiy @rhrazdil @pcbailey @glekner please review.

@@ -126,7 +126,6 @@ export const createVM = async (params: CreateVMParams) => {
// ProcessedTemplates endpoint will reject the request if user cannot post to the namespace
// common-templates are stored in openshift namespace, default user can read but cannot post
template
.setNamespace(namespace)
Copy link
Member

Choose a reason for hiding this comment

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

are you sure the user has the right to create the template in the openshift namespace? Hence the comment above.

Copy link
Member

@atiratree atiratree Mar 10, 2020

Choose a reason for hiding this comment

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

We are only concerned about the vm pointer to the parent template right? It should probably be enough to restore the old namespace just before the line 148 https://github.com/openshift/console/pull/4701/files#diff-e76664ae71de5c525cc5ed6e2f799809R148

Copy link
Member Author

Choose a reason for hiding this comment

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

are you sure the user has the right to create the template in the openshift namespace? Hence the comment above.

I'm the admin on my cluster so I don't know ... ( I can, but i'm the admin ... )

@rhrazdil @suomiy do you know how to create a user with less previliges ?

Copy link
Member Author

Choose a reason for hiding this comment

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

are you sure the user has the right to create the template in the openshift namespace?

@suomiy Correct !!
tested with unprivileged user, can't process a template in "openshift" namespace.

It should probably be enough to restore the old namespace

Will try this, thanks 👍

Signed-off-by: yaacov <kobi.zamir@gmail.com>
@yaacov yaacov force-pushed the kubvirt-vm-wizard-template-namespace branch from e8d9a55 to 9439d63 Compare March 10, 2020 12:38
@atiratree
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: suomiy, 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

@yaacov
Copy link
Member Author

yaacov commented Mar 10, 2020

/test e2e-gcp-console

@yaacov yaacov closed this Mar 10, 2020
@yaacov yaacov reopened this Mar 10, 2020
@yaacov
Copy link
Member Author

yaacov commented Mar 10, 2020

/test e2e-gcp-console

2 similar comments
@yaacov
Copy link
Member Author

yaacov commented Mar 10, 2020

/test e2e-gcp-console

@yaacov
Copy link
Member Author

yaacov commented Mar 10, 2020

/test e2e-gcp-console

@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 Mar 10, 2020

/test analyze

@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 Mar 11, 2020

/test e2e-gcp-console

@yaacov
Copy link
Member Author

yaacov commented Mar 11, 2020

/test analyze

@yaacov
Copy link
Member Author

yaacov commented Mar 11, 2020

/test e2e-gcp-console

1 similar comment
@yaacov
Copy link
Member Author

yaacov commented Mar 11, 2020

/test e2e-gcp-console

@yaacov
Copy link
Member Author

yaacov commented Mar 11, 2020

/test e2e-gcp-console

1 similar comment
@yaacov
Copy link
Member Author

yaacov commented Mar 11, 2020

/test e2e-gcp-console

@openshift-merge-robot openshift-merge-robot merged commit cd30804 into openshift:master Mar 11, 2020
@spadgett spadgett added this to the v4.5 milestone Mar 18, 2020
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. component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants