-
Notifications
You must be signed in to change notification settings - Fork 374
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
base: main
Are you sure you want to change the base?
Conversation
@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:
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: 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:
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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MahnoorAsghar 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 |
/jira refresh |
@MahnoorAsghar: This pull request references METAL-1404 which is a valid jira issue. 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. |
Test Resultse2e-aws
e2e-aks
|
aa5aa1b
to
644cc98
Compare
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 |
5740e5e
to
68ec986
Compare
@enxebre Thank you for your guidance! |
@MahnoorAsghar: This pull request references METAL-1404 which is a valid jira issue. 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. |
3185737
to
949bc17
Compare
// 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." |
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.
CRD is invalid...error
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.
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))
?
949bc17
to
cee3cbc
Compare
…pt-in by default on hosted clusters
cee3cbc
to
1b183e4
Compare
Allow enabling capabilities and make baremetal capability opt-in by default on hosted clusters
Fixes #METAL-1404