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

Fixed predicates to allow events for Etcd resource that have never been reconciled before #900

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

unmarshall
Copy link
Contributor

reconciled before (#898)

How to categorize this PR?

/area control-plane
/kind bug

What this PR does / why we need it:
For gardener use cases the predicates for the etcd reconciler have been changed to allow events for existing Etcd resources for which the original Create event could not be processed. Subsequent update events triggered by gardenlet reconciliation loop should be allowed to be processed.

Which issue(s) this PR fixes:
Partially Fixes #898

Special notes for your reviewer:
This partially fixes #898 for gardener usage. For open source consumption (without gardener) this fix will only work if there is another component which can generate an update event. So we need to further think on how to do this properly for non-gardener use cases.

Release note:

Fixes the predicate to allow update events for existing Etcd resource that never got reconciled before.

@unmarshall unmarshall requested a review from a team as a code owner October 29, 2024 05:31
@gardener-robot gardener-robot added needs/review Needs review area/control-plane Control plane related kind/bug Bug size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Oct 29, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 29, 2024
@unmarshall
Copy link
Contributor Author

/test pull-etcd-druid-e2e-kind-nondistroless-etcd

@unmarshall
Copy link
Contributor Author

/test pull-etcd-druid-e2e-kind

Copy link
Contributor

@shafeeqes shafeeqes left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Oct 29, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 29, 2024
Copy link
Contributor

@anveshreddy18 anveshreddy18 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @unmarshall.
LGTM !!

Copy link
Member

@renormalize renormalize left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

We should ensure that we fix this bug even for the general use case without the external update event soon.


// GetLatestEtcdPartialObjectMeta returns the latest version of the Etcd object metadata.
func GetLatestEtcdPartialObjectMeta(ctx context.Context, client client.Client, objectKey client.ObjectKey, etcdObjMetadata *metav1.PartialObjectMetadata) ReconcileStepResult {
if err := client.Get(ctx, objectKey, etcdObjMetadata); err != nil {
if apierrors.IsNotFound(err) {
return DoNotRequeue()
}
return ReconcileWithError(err)
}
return ContinueReconcile()
}

If the above function is invoked, we know for sure that an event is triggered for a particular etcd CR. Instead of never requeuing if that particular resource is not found, maybe we could requeue after a certain backoff period?

@unmarshall unmarshall merged commit 38a654d into gardener:master Oct 29, 2024
11 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 29, 2024
anveshreddy18 pushed a commit to anveshreddy18/etcd-druid that referenced this pull request Oct 29, 2024
unmarshall added a commit that referenced this pull request Oct 29, 2024
@unmarshall unmarshall deleted the predicates branch December 12, 2024 08:08
@unmarshall unmarshall restored the predicates branch December 12, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane Control plane related kind/bug Bug needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow refresh of informer cache results in delayed processing of Etcd resources
7 participants