Skip to content

fix for OCPBUGS-55135: userDataSecret.name should be a Required value on AWS #1399

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

Merged
merged 7 commits into from
Aug 12, 2025

Conversation

germanparente
Copy link
Contributor

aligning the check on webhook side to prevent the userDataSecret name to be empty, as it's already happening in other providers.

@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2025
@openshift-ci-robot
Copy link
Contributor

@germanparente: This pull request references Jira Issue OCPBUGS-55135, which is invalid:

  • expected the bug to target the "4.20.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

aligning the check on webhook side to prevent the userDataSecret name to be empty, as it's already happening in other providers.

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.

@germanparente
Copy link
Contributor Author

/jira refresh

@germanparente
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2025
@openshift-ci-robot
Copy link
Contributor

@germanparente: This pull request references Jira Issue OCPBUGS-55135, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

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.

@openshift-ci openshift-ci bot requested a review from sunzhaohua2 August 4, 2025 16:29
@germanparente
Copy link
Contributor Author

I see that ci/prow/unit
is failing testing the removal of the userDataSecret.

I had checked that in other providers, when there's no userDataSecret, it's set to a default one and them I wanted to have the same behaviour in AWS. Should we allow removing it ?

@JoelSpeed
Copy link
Contributor

Requiring a field that previously was not required is a breaking change, and would prevent existing MachineSets from spawning new Machines. We need to be very careful here.

What exactly is the behaviour today if no name is provided?

@germanparente
Copy link
Contributor Author

@JoelSpeed in fact, when we install from scratch, we have a default userDataSecret what a name.

And there's a test failing by removing the full userDataSecret, not only the name:

--- FAIL: TestMachineUpdate/with_an_AWS_ProviderSpec,_removing_the_user_data_secret (1.13s)

So, it seems that in aws we should allow removing the full userDataSecret but not allow to leave the userDataSecret with name nullified.

I will check this and come back with another patch.

@JoelSpeed
Copy link
Contributor

Requiring a name where we did not previously is still a breaking change. Even though the default machinesets include a name, this does not mean that all machinesets in all clusters do.

If you want to make this change, can we verify from insights data that all recorded AWS machinesets have a name field set? This would give us at least some confidence that the majority would not be broken by this change

@JoelSpeed
Copy link
Contributor

Hmm, looking at the linked bug, it appears that if you do not have this value, then machines cannot be successfully created, if that's the case, we could argue that no one should have a machineset where this value is missing, and therefore, the breaking change here is safe 🤔

@germanparente
Copy link
Contributor Author

Thanks @JoelSpeed then, I think the current patch is the right one requiring a value for name but not necessarily requiring the full userDaraSecret information that seems can be removed. Since there's a unit test doing this

I will check the test failures on Thursday.

Thanks for your review

Comment on lines 726 to 733
if providerSpec.UserDataSecret == nil {
errs = append(
errs,
field.Required(
field.NewPath("providerSpec", "userDataSecret"),
"expected providerSpec.userDataSecret to be populated",
),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect we still want this, and the new validation. Though looking at the new defaulting, can we ever get here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @JoelSpeed
My understanding was that there's a test that is checking that we can remove completely:

userDataSecret:
name: xxxxx

That's why I have switched to validate only that the name cannot be empty if the sctructure exists that is what the ocpbugs states as improvement.

If I re-add those lines and there's a test removing the full userDataSecret information, we will have the failure.

@germanparente
Copy link
Contributor Author

Just to clarify, the first time the test has failed because it was expecting this message:

"expected providerSpec.userDataSecret to be populated"

and my pr was returning instead "userDataSecret must be provided"

@germanparente
Copy link
Contributor Author

/test e2e-metal-ipi-ovn-ipv6

)
errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "expected providerSpec.userDataSecret to be populated"))
} else if providerSpec.UserDataSecret.Name == "" {
errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets add a test case that checks that this error is produced please

@germanparente
Copy link
Contributor Author

unit test added.

@JoelSpeed
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Aug 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 8, 2025
Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Thanks a lot @germanparente 🎉

The change looks reasonable to me, as it aligns with GCP and Azure.

Regarding breaking changes behaviour, if the Machine wouldn't come up, I think it is ok to break behaviour as it improves the UX preventing the Provisioning + Failure as it explains why it is invalid.

Left a small fixup suggestion for the unit failure.

Copy link
Contributor

openshift-ci bot commented Aug 8, 2025

@germanparente: 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 1682aa6 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-vsphere-host-groups-ovn 1682aa6 link false /test e2e-vsphere-host-groups-ovn
ci/prow/e2e-vsphere-ovn-serial 1682aa6 link false /test e2e-vsphere-ovn-serial
ci/prow/e2e-gcp-ovn 1682aa6 link false /test e2e-gcp-ovn
ci/prow/e2e-vsphere-ovn 1682aa6 link false /test e2e-vsphere-ovn
ci/prow/e2e-vsphere-ovn-techpreview-serial 1682aa6 link false /test e2e-vsphere-ovn-techpreview-serial
ci/prow/e2e-vsphere-ovn-multi-vcenter 1682aa6 link false /test e2e-vsphere-ovn-multi-vcenter
ci/prow/e2e-vsphere-static-ovn 1682aa6 link false /test e2e-vsphere-static-ovn
ci/prow/e2e-openstack 1682aa6 link false /test e2e-openstack

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.

@germanparente
Copy link
Contributor Author

/cherry-pick release-4.19

@openshift-cherrypick-robot

@germanparente: once the present PR merges, I will cherry-pick it on top of release-4.19 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.19

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.

@JoelSpeed
Copy link
Contributor

@damdo looks like your changes are addressed, can you LGTM or have you any further feedback?

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Thanks a lot @germanparente 🎉

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2025
@theobarberbany
Copy link
Contributor

theobarberbany commented Aug 12, 2025

Heya @germanparente, can we squash down these commits to an atomic one? :)

@openshift-merge-bot openshift-merge-bot bot merged commit d977735 into openshift:main Aug 12, 2025
26 of 35 checks passed
@openshift-ci-robot
Copy link
Contributor

@germanparente: Jira Issue OCPBUGS-55135: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-55135 has been moved to the MODIFIED state.

In response to this:

aligning the check on webhook side to prevent the userDataSecret name to be empty, as it's already happening in other providers.

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-cherrypick-robot

@germanparente: new pull request created: #1403

In response to this:

/cherry-pick release-4.19

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.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-machine-api-operator
This PR has been included in build ose-machine-api-operator-container-v4.20.0-202508122224.p0.gd977735.assembly.stream.el9.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants