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

fix ready condition not being set to true #303

Merged

Conversation

d-honeybadger
Copy link
Collaborator

Description of your changes

Follow-up for #294:
When the managed resource is modified in-place, turns out sometimes Crossplane applies these changes at the end of Observe and sometimes it doesn't. During the initial PR testing, I must've had local debugging changes to the vendored crossplane-runtime packages that messed up with this behavior and made it so that managed resource changes were always applied.
In this PR, status condition changes are persisted explicitly.

Fix Ready condition not getting set when its status is True

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Same as #294

@@ -448,6 +448,10 @@ func (c *external) handleLastApplied(ctx context.Context, lastParameters *v1alph
isLastSyncOK := (desired.GetCondition(xpv1.TypeSynced).Status == v1.ConditionTrue)

if isUpToDate && isLastSyncOK {
desired.SetConditions(xpv1.Available())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When setting Ready condition right after a successful run, various transient errors can happen preventing this status update, and, potentially, leaving the condition False forever. This ensures Ready is set even if such errors occur

@d-honeybadger d-honeybadger marked this pull request as ready for review February 6, 2024 14:12
@fahedouch fahedouch added this to the v0.5.1 (tentative) milestone Feb 24, 2024
Copy link
Collaborator

@fahedouch fahedouch left a comment

Choose a reason for hiding this comment

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

Thanks

@fahedouch fahedouch merged commit 4cc844c into crossplane-contrib:main Mar 8, 2024
7 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