-
Notifications
You must be signed in to change notification settings - Fork 33
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
CNV-51530: hide virtctl on managed udn namespaces #2307
CNV-51530: hide virtctl on managed udn namespaces #2307
Conversation
@upalatucci: This pull request references CNV-51530 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
74d5544
to
49ad98b
Compare
@upalatucci: This pull request references CNV-51530 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
49ad98b
to
d084bde
Compare
src/utils/components/SSHAccess/components/ConsoleOverVirtctl.tsx
Outdated
Show resolved
Hide resolved
src/utils/components/SSHAccess/components/ConsoleOverVirtctl.tsx
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,54 @@ | |||
import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please explain this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To understand if ClusterUDN is managing a namespace, I have to go through its matchLabels
and matchExpressions
and verify that the project labels verify both.
The matchExpression that I use with ClusterUDN in the networking plugin is
{key: 'kubernetes.io/metadata.name', operator: 'In', values: [projectA, projectB]}
But in general ClusterUDN can also have matchLabels
and different kind of matchExpressions
so to support ClusterUDN created through command line or yaml I wrote this function
I created this file in the utils as this kind of validation is common in k8s for other things so I think it can be helpful in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The k8s field that has matchLabels
and matchExpressions
is called commonly Selector
so this is why I named the file matchSelector
.
The flow is:
matchLabels
requirements can be transformed to expressions by using the Equal
operator. So I did that to simplify the function.
After that I just had to transform operators to functions like includes
and ! includes
d084bde
to
11adc33
Compare
11adc33
to
a844612
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: metalice, 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 |
📝 Description
Hide the virtctl command for VMs on udn managed namespaces
Hide the
Internal FQDN
interfaces🎥 Demo
Before
After