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

CFE-1167: Feature-gated MachineNamePrefix field for CMPS #2086

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chiragkyal
Copy link
Member

@chiragkyal chiragkyal commented Nov 6, 2024

This PR

@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 Nov 6, 2024
Copy link
Contributor

openshift-ci bot commented Nov 6, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Nov 6, 2024

Hello @chiragkyal! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 6, 2024
@chiragkyal chiragkyal force-pushed the cmps-machinePrefix branch 2 times, most recently from 2c36507 to 0e34d83 Compare November 11, 2024 08:10
@chiragkyal chiragkyal changed the title [WIP] CMPS machineName prefix CFE-1167: Add MachineNamePrefix field for CMPS Nov 11, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 11, 2024

@chiragkyal: This pull request references CFE-1167 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.18.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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 11, 2024
@chiragkyal chiragkyal changed the title CFE-1167: Add MachineNamePrefix field for CMPS CFE-1167: Add feature-gated MachineNamePrefix field for CMPS Nov 11, 2024
@chiragkyal chiragkyal changed the title CFE-1167: Add feature-gated MachineNamePrefix field for CMPS CFE-1167: Feature-gated MachineNamePrefix field for CMPS Nov 11, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 11, 2024

@chiragkyal: This pull request references CFE-1167 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.18.0" version, but no target version was set.

In response to this:

This PR

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.

@chiragkyal chiragkyal marked this pull request as ready for review November 11, 2024 08:18
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 11, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 11, 2024

@chiragkyal: This pull request references CFE-1167 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.18.0" version, but no target version was set.

In response to this:

This PR

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.

@chiragkyal
Copy link
Member Author

/assign @JoelSpeed

Copy link
Contributor

openshift-ci bot commented Nov 12, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chiragkyal
Once this PR has been reviewed and has the lgtm label, please ask for approval from joelspeed. For more information see the Kubernetes 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

@chiragkyal
Copy link
Member Author

It looks like the integration test is failing only on controlplanemachinesets-CustomNoUpgrade.crd.yaml and due to authoritativeAPI field.

 [machine.openshift.io/v1, Resource=controlplanemachinesets][ClusterProfiles=SelfManagedHA][FeatureSet="CustomNoUpgrade"][FeatureGate=CMPSMachineNamePrefix][File=0000_10_control-plane-machine-set_01_controlplanemachinesets-CustomNoUpgrade.crd.yaml] ControlPlaneMachineSet (+CMPSMachineNamePrefix) On Create [It] Should be able to create a minimal ControlPlaneMachineSet
/home/ckyal/go/src/github.com/openshift/api/tests/generator.go:189

  [FAILED] the following fields were expected to match but did not:
  [(spec.template.machines_v1beta1_machine_openshift_io.spec.authoritativeAPI/spec.template.machines_v1beta1_machine_openshift_io.spec.authoritativeAPI)]

Seems like authoritativeAPI field exists only in CustomNoUpgrade but not in DevPreviewNoUpgrade or TechPreviewNoUpgrade whereas the MachineAPIMigration feature-gate isn't enabled in any featureset. This behaviour is conflicting when adding the tests for the new feature gate.

properties:
authoritativeAPI:
default: MachineAPI
description: |-
authoritativeAPI is the API that is authoritative for this resource.
Valid values are MachineAPI and ClusterAPI.
When set to MachineAPI, writes to the spec of the machine.openshift.io copy of this resource will be reflected into the cluster.x-k8s.io copy.
When set to ClusterAPI, writes to the spec of the cluster.x-k8s.io copy of this resource will be reflected into the machine.openshift.io copy.
Updates to the status will be reflected in both copies of the resource, based on the controller implementing the functionality of the API.
Currently the authoritative API determines which controller will manage the resource, this will change in a future release.
To ensure the change has been accepted, please verify that the `status.authoritativeAPI` field has been updated to the desired value and that the `Synchronized` condition is present and set to `True`.
enum:
- MachineAPI
- ClusterAPI
type: string

api/features/features.go

Lines 564 to 569 in a2817b8

FeatureGateMachineAPIMigration = newFeatureGate("MachineAPIMigration").
reportProblemsToJiraComponent("OCPCLOUD").
contactPerson("jspeed").
productScope(ocpSpecific).
enhancementPR(legacyFeatureGateWithoutEnhancement).
mustRegister()

@JoelSpeed Are we expecting authoritativeAPI field to be present in CustomNoUpgrade ?

@JoelSpeed
Copy link
Contributor

@JoelSpeed Are we expecting authoritativeAPI field to be present in CustomNoUpgrade ?

No, it is as expected, we don't want the gate in any feature set just yet.

Do you know why there is a difference? There shouldn't be a default on those fields IIRC, so I wouldn't expect it to interfere

@JoelSpeed
Copy link
Contributor

Oops, it does have a default, try adding -MachineAPIMigration to your feature gates entry in the test file, I think you can comma separate the gates

@chiragkyal
Copy link
Member Author

Oops, it does have a default, try adding -MachineAPIMigration to your feature gates entry in the test file, I think you can comma separate the gates

I tried adding

featureGate: CMPSMachineNamePrefix,-MachineAPIMigration

but it looks like we cannot add more than one gate. The test is erroing out locally.

"unable to find featureGate/CMPSMachineNamePrefix,-MachineAPIMigration to check for /home/ckyal/go/src/github.com/openshift/api/machine/v1/zz_generated.crd-manifests/0000_10_control-plane-machine-set_01_controlplanemachinesets-Default.crd.yaml",

Comment on lines 50 to 52
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=32
Copy link
Member Author

Choose a reason for hiding this comment

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

We want to update the validation to check for dns1123Subdomain format., which will look something like

	// +openshift:validation:FeatureGateAwareXValidation:featureGate=CMPSMachineNamePrefix,rule="format.dns1123Subdomain.validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=245

However, the CEL format validation requires K8s 1.32 which is under WIP and will land soon in 4.18/4.19.

Signed-off-by: chiragkyal <[email protected]>
Signed-off-by: chiragkyal <[email protected]>
Copy link
Contributor

openshift-ci bot commented Nov 26, 2024

@chiragkyal: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 2d7cfbc link false /test okd-scos-e2e-aws-ovn
ci/prow/verify-crd-schema 2d7cfbc link true /test verify-crd-schema
ci/prow/e2e-aws-ovn-hypershift 2d7cfbc link true /test e2e-aws-ovn-hypershift
ci/prow/e2e-aws-serial 2d7cfbc link true /test e2e-aws-serial
ci/prow/e2e-aws-ovn-techpreview 2d7cfbc link true /test e2e-aws-ovn-techpreview

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants