Skip to content

METAL-1404: WIP: Allow enabling capabilities and make baremetal capability opt-in by default on hosted clusters #6158

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MahnoorAsghar
Copy link
Contributor

@MahnoorAsghar MahnoorAsghar commented May 15, 2025

Allow enabling capabilities and make baremetal capability opt-in by default on hosted clusters

Fixes #METAL-1404

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 15, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 15, 2025

@MahnoorAsghar: This pull request references METAL-1404 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.20.0" version, but no target version was set.

In response to this:

Make baremetal capability disabled by default on hosted clusters

Fixes #METAL-1404: https://issues.redhat.com/browse/METAL-1404

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-robot
Copy link

openshift-ci-robot commented May 15, 2025

@MahnoorAsghar: This pull request references METAL-1404 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.20.0" version, but no target version was set.

In response to this:

Make baremetal capability disabled by default on hosted clusters

Fixes #METAL-1404

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 requested review from csrwng and hasueki May 15, 2025 10:46
@openshift-ci openshift-ci bot added area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI labels May 15, 2025
Copy link
Contributor

openshift-ci bot commented May 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MahnoorAsghar
Once this PR has been reviewed and has the lgtm label, please assign sjenning for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels May 15, 2025
@MahnoorAsghar
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link

openshift-ci-robot commented May 15, 2025

@MahnoorAsghar: This pull request references METAL-1404 which is a valid jira issue.

In response to this:

/jira 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 openshift-eng/jira-lifecycle-plugin repository.

@cwbotbot
Copy link

cwbotbot commented May 15, 2025

Test Results

e2e-aws

e2e-aks

@MahnoorAsghar MahnoorAsghar force-pushed the disable-baremetal-cap-default branch 3 times, most recently from aa5aa1b to 644cc98 Compare May 16, 2025 14:03
@enxebre
Copy link
Member

enxebre commented May 19, 2025

Thanks @MahnoorAsghar! To reduce impact over already persisted resources and preserve control over defaults, baremetal will be disabled by default unless explicitly included in "enabled", but it doesn't need to be explicitly included in the "disabled". Let's close this PR and put a new one for the explicit opt-in implementation

@MahnoorAsghar MahnoorAsghar force-pushed the disable-baremetal-cap-default branch 3 times, most recently from 5740e5e to 68ec986 Compare May 27, 2025 12:38
@openshift-ci openshift-ci bot added the area/testing Indicates the PR includes changes for e2e testing label May 27, 2025
@MahnoorAsghar
Copy link
Contributor Author

MahnoorAsghar commented May 27, 2025

@enxebre Thank you for your guidance!

@MahnoorAsghar MahnoorAsghar changed the title METAL-1404: Make baremetal capability disabled by default on hosted clusters METAL-1404: WIP: Make baremetal capability disabled by default on hosted clusters May 27, 2025
@MahnoorAsghar MahnoorAsghar marked this pull request as draft May 27, 2025 12:50
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 27, 2025
@MahnoorAsghar MahnoorAsghar changed the title METAL-1404: WIP: Make baremetal capability disabled by default on hosted clusters METAL-1404: WIP: Allow enabling capabilities and make baremetal capability opt-in by default on hosted clusters May 27, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 27, 2025

@MahnoorAsghar: This pull request references METAL-1404 which is a valid jira issue.

In response to this:

Allow enabling capabilities and make baremetal capability opt-in by default on hosted clusters

Fixes #METAL-1404

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.

@MahnoorAsghar MahnoorAsghar force-pushed the disable-baremetal-cap-default branch 2 times, most recently from 3185737 to 949bc17 Compare May 27, 2025 13:18
// Once set, it cannot be changed.
// self.set1.all(e, !(e in self.set2)),
//
// +kubebuilder:validation:XValidation:rule="self.enabled.all(e, !(e in self.disabled))", message="Capabilities can not be both enabled and disabled at once."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CRD is invalid...error

Copy link
Member

Choose a reason for hiding this comment

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

I'm not overly experienced in advanced rules. In fact, for a rule so complex, I would go for the validation webhook (if the Hypershift API has any). I see that they do use quite complex rules here: https://github.com/openshift/hypershift/blob/main/api/hypershift/v1beta1/nodepool_types.go#L86-L89

The enabled and disabled fields are optional, I wonder if you need to use has to check for their presence. Your failure happens at the path spec.validation.openAPIV3Schema.properties[spec].properties[capabilities].default, and the default bit makes me suspect that an empty object no longer passes your validation. So what about

has(self.enabled) && has(self.disabled) && self.enabled.all(e, !(e in self.disabled))

?

@MahnoorAsghar MahnoorAsghar force-pushed the disable-baremetal-cap-default branch from 949bc17 to cee3cbc Compare May 27, 2025 14:30
@MahnoorAsghar MahnoorAsghar force-pushed the disable-baremetal-cap-default branch from cee3cbc to 1b183e4 Compare May 28, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/testing Indicates the PR includes changes for e2e testing do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants