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

pkg/resource: add StoreCurrentRV #534

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Sep 5, 2023

Description of your changes

To detect when an Apply is a no-op or not. Compare crossplane/crossplane#4572.

origRV := ""
if err := r.client.Apply(ctx, crd, resource.MustBeControllableBy(d.GetUID()), resource.StoreCurrentRV(&origRV)); err != nil {
    return reconcile.Result{}, err
}
if crd.GetResourceVersion() != origRV {
    r.record.Event(d, event.Normal(reasonEstablishXR, fmt.Sprintf("Applied composite resource CustomResourceDefinition: %s", crd.GetName())))
}

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@upbound.io>
@turkenh turkenh merged commit a2674ee into crossplane:master Sep 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants