Bug 2158424
| Summary: | Cannot select Network Attachment Definitions from the global namespaces | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Container Native Virtualization (CNV) | Reporter: | Miguel Duarte Barroso <mduarted> | ||||
| Component: | User Experience | Assignee: | Matan Schatzman <mschatzm> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Guohua Ouyang <gouyang> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 4.12.0 | CC: | acardace, gouyang, ipilcher, mschatzm | ||||
| Target Milestone: | --- | ||||||
| Target Release: | 4.13.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 2175601 (view as bug list) | Environment: | |||||
| Last Closed: | 2023-05-18 02:56:40 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Miguel Duarte Barroso
2023-01-05 11:48:27 UTC
I am seeing this on OpenShift 4.11.20 with OpenShift Virtualization 4.11.1. Hi, I'm trying to understand the bug, but I cannot get much information about global namespace by searching it in internet. How can I create a global namespace in openshift or how to verify a namespace is the global namespace? Do you think 'default' is the global namespace? Thanks, (In reply to Guohua Ouyang from comment #2) > Hi, > I'm trying to understand the bug, but I cannot get much information about > global namespace by searching it in internet. How can I create a global > namespace in openshift or how to verify a namespace is the global namespace? AFAIU, you cannot created global namespaces. You can use the ones that are shipped in openshift - those are listed in [0]; this list is hard-coded in the network operator. I would create a net-attach-def in the `default` namespace, create a pod in a separate namespace, and ensure the NADs in the drop down list also show the one you've created on the default NS. > Do you think 'default' is the global namespace? Yes, that namespace is global - i.e. it is defined in the list shown in [0]. > > Thanks, [0] - https://github.com/openshift/cluster-network-operator/blob/6abbcaf40079f0ac39182d6fbc960403a2698475/bindata/network/multus/multus.yaml#L163 Created attachment 1948243 [details]
vm yaml
```
message: >-
failed to render launch manifest: Failed to locate network attachment
definition br1/default
```
It looks the backend does not support this scenario.
Reproduces steps:
1. add a nad to namespace "default"
2. create vm in another namespace "test" and select the network from ns "default".
3. the VM is not schedulable
Move the bug to virt for a look. Set it to high as it blocks the VM to start. Moving this to the networking component as it appears to be a better fit. Please feel free to change this back if it turns out I'm wrong. The name should be in format "<namespace>/<name>". The VM that failed has it the other way around. Guohua, could you try again, but this time, set `networkName: default/br1` (In reply to Petr Horáček from comment #8) > The name should be in format "<namespace>/<name>". The VM that failed has it > the other way around. Guohua, could you try again, but this time, set > `networkName: default/br1` yes, it works. Move the bug to UX for further fix. Should the non-priv user able to use the global network attachment definition as well? The current fix only apply to admin user. (In reply to Guohua Ouyang from comment #10) > Should the non-priv user able to use the global network attachment > definition as well? > The current fix only apply to admin user. Its working the same for admin and regular user, it will try to fetch all global ns , if user has privileges it will present if not it wont. @gouyang (In reply to Matan Schatzman from comment #11) > (In reply to Guohua Ouyang from comment #10) > > Should the non-priv user able to use the global network attachment > > definition as well? > > The current fix only apply to admin user. > > Its working the same for admin and regular user, it will try to fetch all > global ns , if user has privileges it will present if not it wont. > @gouyang The regular user cannot list the nad resource in default ns even with view permission: $ oc adm policy add-role-to-user view -n default test clusterrole.rbac.authorization.k8s.io/view added: "test" $ oc login -u test -p test $ oc get net-attach-def -n default Error from server (Forbidden): network-attachment-definitions.k8s.cni.cncf.io is forbidden: User "test" cannot list resource "network-attachment-definitions" in API group "k8s.cni.cncf.io" in the namespace "default" Move the bug to verified as the UI display the network correctly and the VM can be scheduled. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Virtualization 4.13.0 Images security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:3205 |