-
Notifications
You must be signed in to change notification settings - Fork 684
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
Retain existing OwnerReferences #130
Conversation
Looking into these failing integration tests. |
Missing RBAC "get" for secret. Fixed now. |
FWIW, we're now running this latest build in production and it has resolved the problem for us. |
@anguslees, any chance to get this merged soon? |
if err != nil { | ||
return nil, fmt.Errorf("failed to read existing secret: %s", err) | ||
} | ||
existingSecret.Data = newSecret.Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existingSecret
may have come from a shared cache above, so you need to copy it before modifying it:
existingSecret = existingSecret.DeepCopy()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed.
otherwise lgtm, thanks! (apologies for not responding earlier - kubecon, holidays, and other excuses) |
@anguslees No worries. Thanks for taking a look. I think I have addressed your concerns. Could you re-review? |
@anguslees Could you give this another once-over? Keen to getting it merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Thanks!
bors r+
130: Retain existing OwnerReferences r=anguslees a=gargath This PR ensures that existing `OwnerReferences` on Secrets managed by the controller are retained when a Secret is reconciled. When an existing Secret is found, the controller will now merge existing OwnerReferences with its own, ensuring that other controllers can use OwnerReferences safely to track these Secrets. Fixes #127 Co-authored-by: Phil Taprogge <philt@pusher.com> Co-authored-by: Joel Speed <joel.speed@hotmail.co.uk>
Build succeeded |
This PR ensures that existing
OwnerReferences
on Secrets managed by the controller are retained when a Secret is reconciled.When an existing Secret is found, the controller will now merge existing OwnerReferences with its own, ensuring that other controllers can use OwnerReferences safely to track these Secrets.
Fixes #127