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

ARO-13398, HOSTEDCP-1972: hypershift-operator: allow opting into pull secret rotation #5307

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

Conversation

stevekuznetsov
Copy link
Contributor

There is no technical reason that we cannot react to changes to referenced secrets for pull credentials; allow users to opt into this behavior by labelling their secret.

A follow-up will make this change not cause node rollout.

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

openshift-ci-robot commented Dec 16, 2024

@stevekuznetsov: This pull request references ARO-13398 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.

This pull request references HOSTEDCP-1972 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:

There is no technical reason that we cannot react to changes to referenced secrets for pull credentials; allow users to opt into this behavior by labelling their secret.

A follow-up will make this change not cause node rollout.

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 enxebre and sjenning December 16, 2024 19:31
@openshift-ci openshift-ci bot added area/api Indicates the PR includes changes for the API area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release labels Dec 16, 2024
Copy link
Contributor

openshift-ci bot commented Dec 16, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: stevekuznetsov
Once this PR has been reviewed and has the lgtm label, please assign csrwng 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed do-not-merge/needs-area labels Dec 16, 2024
Copy link
Contributor

openshift-ci bot commented Dec 16, 2024

Hi @stevekuznetsov. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@stevekuznetsov stevekuznetsov force-pushed the skuznets/watch-pull-secrets branch from 02ebd49 to 8f2bea6 Compare December 16, 2024 19:34
@enxebre
Copy link
Member

enxebre commented Dec 17, 2024

A follow-up will make this change not cause node rollout.

Please note that this change won't trigger a rollout either as it is now. Only changing the ref will.

So this PR will be no-op from ux pov atm. Can we include at commit in the PR to implement the inplace rollout?

@stevekuznetsov
Copy link
Contributor Author

@enxebre ah right - I can update the hash in this PR as well - WDYT? Also could you please /ok-to-test me :)

@enxebre
Copy link
Member

enxebre commented Dec 17, 2024

@enxebre ah right - I can update the hash in this PR as well - WDYT?

Unfortunately that's a no go because a non backward compatible change in how we build the hash would transparently cause a global rollout for the whole cluster fleet as soon as this change gets shipped in to a management cluster, which we don't want to.
That's why this is sensitive and we need to think carefully about the implementation.

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 17, 2024
@stevekuznetsov
Copy link
Contributor Author

@enxebre of course - that's the reason I wanted a dual-sided accept. New field in HostedClusterSpec to opt into the behavior.

@stevekuznetsov stevekuznetsov force-pushed the skuznets/watch-pull-secrets branch 2 times, most recently from ad3f5d0 to 48e2919 Compare December 18, 2024 15:54
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is technically backwards incompat as well, unclear - would have been invalid anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(I couldn't embed corev1.LocalObjectReference as it somehow broke the applyconfiggenerator)

@@ -373,11 +373,16 @@ func (r *NodePoolReconciler) token(ctx context.Context, hcluster *hyperv1.Hosted
return nil, fmt.Errorf("failed to look up release image metadata: %w", err)
}

pullSecret, err := r.getPullSecret(ctx, hcluster)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sheer number of times we do lookups for all sorts of data in this reconciler even when a parent func has the context is pretty wild. This all hits listers so it's pretty cheap but it certainly makes it hard to grok the data flow and introduces lots of opportunities for races, incoherent cache access, etc

@openshift-ci openshift-ci bot added area/cli Indicates the PR includes changes for CLI area/documentation Indicates the PR includes changes for documentation labels Dec 18, 2024
@stevekuznetsov stevekuznetsov force-pushed the skuznets/watch-pull-secrets branch from 48e2919 to e9a8974 Compare December 18, 2024 16:32
@stevekuznetsov
Copy link
Contributor Author

I think I need another /ok-to-test? weird.

@stevekuznetsov
Copy link
Contributor Author

Nvm, was just impatient for Prow

@stevekuznetsov stevekuznetsov force-pushed the skuznets/watch-pull-secrets branch from e9a8974 to 70137b6 Compare December 18, 2024 17:21
@stevekuznetsov
Copy link
Contributor Author

e2e failing with

    util.go:145: ImagePullCredentialsValid=False: InvalidConfiguration(Referenced image pull credential e2e-clusters-xvwrz/example-49p4t-pull-secret is invalid - ensure the secret is of dockerconfigjson type and has the appropriate content)

That's my new condition ... how was this working in the past with invalid pull credentials? huh?

@stevekuznetsov stevekuznetsov force-pushed the skuznets/watch-pull-secrets branch from 70137b6 to 0c446f4 Compare December 18, 2024 20:17
There is no technical reason that we cannot react to changes to
referenced secrets for pull credentials; allow users to opt into this
behavior by labelling their secret.

Signed-off-by: Steve Kuznetsov <[email protected]>
@stevekuznetsov stevekuznetsov force-pushed the skuznets/watch-pull-secrets branch from 0c446f4 to 28208f3 Compare December 19, 2024 13:36
@stevekuznetsov
Copy link
Contributor Author

@enxebre ready for review, the previous e2e was a known flake

Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

@stevekuznetsov: 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 28208f3 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-aws-4-18 28208f3 link true /test e2e-aws-4-18

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
area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI 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 jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants