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

CNV-51530: hide virtctl on managed udn namespaces #2307

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

upalatucci
Copy link
Member

@upalatucci upalatucci commented Dec 10, 2024

📝 Description

Hide the virtctl command for VMs on udn managed namespaces
Hide the Internal FQDN interfaces

🎥 Demo

Before
Screenshot 2024-12-10 at 12 22 11

After
Screenshot 2024-12-10 at 14 47 24

Screenshot 2024-12-10 at 12 21 41

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Dec 10, 2024

@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:

📝 Description

Hide the virtctl command for VMs on udn managed namespaces
Hide the Internal FQDN interfaces

🎥 Demo

Before
Screenshot 2024-12-10 at 12 22 11

After

Screenshot 2024-12-10 at 12 21 34 Screenshot 2024-12-10 at 12 21 41

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.

@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Dec 10, 2024
@upalatucci upalatucci changed the title CNV-51530: hide virtctl on managed udn namespaces [WIP] CNV-51530: hide virtctl on managed udn namespaces Dec 10, 2024
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Dec 10, 2024

@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:

📝 Description

Hide the virtctl command for VMs on udn managed namespaces
Hide the Internal FQDN interfaces

🎥 Demo

Before
Screenshot 2024-12-10 at 12 22 11

After
Screenshot 2024-12-10 at 14 47 24

Screenshot 2024-12-10 at 12 21 41

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.

@upalatucci upalatucci changed the title [WIP] CNV-51530: hide virtctl on managed udn namespaces CNV-51530: hide virtctl on managed udn namespaces Dec 10, 2024
@@ -0,0 +1,54 @@
import {
Copy link
Member

Choose a reason for hiding this comment

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

please explain this file

Copy link
Member Author

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.

Copy link
Member Author

@upalatucci upalatucci Dec 11, 2024

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

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Dec 19, 2024
Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

[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:
  • OWNERS [metalice,upalatucci]

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

@openshift-merge-bot openshift-merge-bot bot merged commit 8e17468 into kubevirt-ui:main Dec 19, 2024
10 checks passed
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 jira/valid-reference lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants