Skip to content

Conversation

benashz
Copy link
Collaborator

@benashz benashz commented Feb 16, 2024

Make updating a resource's status more consistent for all secret controllers, by factoring out the Status.Update() calls to controller methods, and always setting the lastGeneraton from the reconciled object.

The root cause of #608 seems to be API schema differences when going directly from v0.2.0 to v0.5.0. In v0.5.0 we added finalizers the VPS, VSS, and HCPVSA controllers. Finalizers were being added before the object's status was updated, unfortunately that would result in a error that would prevent the secret from ever being synced, and the object's status from ever being updated. The workaround is documented here: #608 (comment)

The solution is to add the finalizer after the status update. All controllers that have finalizers have been updated accordingly.

Make updating a resource's status more consistent for all secret
controllers, by factoring out the Status.Update() calls to controller
methods, and always setting the lastGeneraton from the reconciled
object.
@benashz benashz requested a review from a team as a code owner February 16, 2024 15:54
@benashz benashz linked an issue Feb 16, 2024 that may be closed by this pull request
@benashz benashz linked an issue Feb 16, 2024 that may be closed by this pull request
@benashz benashz requested a review from tvoran February 16, 2024 15:58
@thyton
Copy link
Collaborator

thyton commented Feb 18, 2024

LGTM!

@benashz benashz requested a review from thyton February 19, 2024 21:49
Copy link
Collaborator

@thyton thyton left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@benashz benashz changed the title Ensure that status.lastGeneration is always set Always add finalizers after status updates Feb 19, 2024
@benashz benashz added this to the v0.5.1 milestone Feb 19, 2024
@benashz benashz merged commit e8ea84e into main Feb 20, 2024
@benashz benashz deleted the VAULT-24169/ensure-lastGeneration-is-always-set branch February 20, 2024 00:37
@benashz benashz changed the title Always add finalizers after status updates Only add finalizers after status updates Feb 20, 2024
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.

Secret sync fails after upgrading directly from v0.2.0 to v0.5.0 Impossible to upgrade to 0.5.0
2 participants