Skip to content

Conversation

shafeeqes
Copy link
Contributor

How to categorize this PR?

/area quality
/kind bug

What this PR does / why we need it:
In the Shoot reconciliation flow, we don't set the credentialsRotation status to Prepared if there are manual in-place workers pending update. When they are updated, shoot status reconciler will annotate the shoot with gardener.cloud/operation=reconcile,

if shootNeedsReconcile || (noInPlacePendingWorkers && kubernetesutils.HasMetaDataAnnotation(shoot, v1beta1constants.GardenerOperation, v1beta1constants.ShootOperationForceInPlaceUpdate)) {
patch := client.MergeFromWithOptions(shoot.DeepCopy(), client.MergeFromWithOptimisticLock{})
if shootNeedsReconcile {
log.Info("Triggering a Shoot reconciliation after credential rotations for manual in-place workers are prepared")
metav1.SetMetaDataAnnotation(&shoot.ObjectMeta, v1beta1constants.GardenerOperation, v1beta1constants.GardenerOperationReconcile)
} else {
delete(shoot.Annotations, v1beta1constants.GardenerOperation)
}
if err := r.GardenClient.Patch(ctx, shoot, patch); err != nil {
return reconcile.Result{}, fmt.Errorf("failed to patch Shoot: %w", err)
}
}

so that the reconcile flow is run again and the status is set to Prepared. However if the shoot status is updated with zero manual in place update pending workers,
log.Info("Updating Shoot status with manual in-place pending workers", "manualInPlacePendingWorkers", sets.List(manualInPlacePendingWorkers))
if err := r.GardenClient.Status().Patch(ctx, shoot, patch); err != nil {
return reconcile.Result{}, fmt.Errorf("failed to patch Shoot status: %w", err)
}

and the above patching of shoot with operation annotation fails, the next time the reconciliation is retried, we exit early:
// If there are no manual in-place update workers in the shoot status, then nothing to do
if shoot.Status.InPlaceUpdates == nil || shoot.Status.InPlaceUpdates.PendingWorkerUpdates == nil || len(shoot.Status.InPlaceUpdates.PendingWorkerUpdates.ManualInPlaceUpdate) == 0 {
return reconcile.Result{}, nil
}

This is not ideal and can cause failures like the one below.
This PR fixes this behaviour.

Thanks @rfranzke for reporting.

Which issue(s) this PR fixes:
Fixes failures like: https://prow.gardener.cloud/view/gs/gardener-prow/pr-logs/pull/gardener_gardener/12213/pull-gardener-e2e-kind-ha-multi-zone/1932519479678341120

Special notes for your reviewer:

Release note:

An issue causing the Shoot credentials rotation status not to correctly get updated, after all the manual in-place pending workers are updated, is now fixed.

@gardener-prow gardener-prow bot added area/quality Output qualification (tests, checks, scans, automation in general, etc.) related kind/bug Bug cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 11, 2025
@shafeeqes
Copy link
Contributor Author

/cherry-pick release-v1.121

@gardener-ci-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-v1.121

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.

@shafeeqes
Copy link
Contributor Author

/cherry-pick release-v1.120

@gardener-ci-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-v1.120

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.

@shafeeqes
Copy link
Contributor Author

/cherry-pick release-v1.119

@gardener-ci-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-v1.119

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.

@shafeeqes
Copy link
Contributor Author

/cherry-pick release-v1.118

@gardener-ci-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-v1.118

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.

@shafeeqes shafeeqes requested a review from rfranzke June 11, 2025 13:06
Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
/retest

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2025
Copy link
Contributor

gardener-prow bot commented Jun 11, 2025

LGTM label has been added.

Git tree hash: 477952c0b58543771a3051f95c8296f91559a121

Copy link
Contributor

gardener-prow bot commented Jun 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rfranzke

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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2025
@ary1992
Copy link
Contributor

ary1992 commented Jun 12, 2025

/retest

@shafeeqes
Copy link
Contributor Author

/test pull-gardener-e2e-kind-ha-multi-zone

@gardener-prow gardener-prow bot merged commit 4a7b32d into gardener:master Jun 12, 2025
19 checks passed
@gardener-ci-robot
Copy link
Contributor

@shafeeqes: new pull request created: #12303

In response to this:

/cherry-pick release-v1.120

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.

@gardener-ci-robot
Copy link
Contributor

@shafeeqes: new pull request created: #12304

In response to this:

/cherry-pick release-v1.119

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.

@gardener-ci-robot
Copy link
Contributor

@shafeeqes: new pull request created: #12305

In response to this:

/cherry-pick release-v1.118

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.

@gardener-ci-robot
Copy link
Contributor

@shafeeqes: new pull request created: #12306

In response to this:

/cherry-pick release-v1.121

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.

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. area/quality Output qualification (tests, checks, scans, automation in general, etc.) related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/bug Bug lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants