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

Use precondition when deleting secrets #5273

Merged
merged 3 commits into from
Feb 4, 2022
Merged

Conversation

srteam2020
Copy link
Contributor

@srteam2020 srteam2020 commented Jan 23, 2022

Fix #5249

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

3 similar comments
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service
Copy link

cla-checker-service bot commented Jan 23, 2022

💚 CLA has been signed

@botelastic botelastic bot added the triage label Jan 23, 2022
@pebrc
Copy link
Collaborator

pebrc commented Jan 24, 2022

Hey thanks for the PR ! You would have to sign the CLA linked above in the checks section in order for use to merge the PR.

Also I think we would want to add the same predicate here:

if err := c.Delete(context.Background(), &secret); err != nil && !apierrors.IsNotFound(err) {

And should maybe add a unit test to the existing test cases testing the new behaviour.

@pebrc pebrc added the >bug Something isn't working label Jan 25, 2022
@botelastic botelastic bot removed the triage label Jan 25, 2022
@botelastic botelastic bot removed the triage label Jan 25, 2022
@pebrc
Copy link
Collaborator

pebrc commented Jan 26, 2022

Jenkins test this please

@srteam2020
Copy link
Contributor Author

Hello @pebrc we have updated the PR but we didn't find a good way to write unit test to test the new behavior. Do you have any suggestion on that? What should we do to help merge this PR?

@pebrc
Copy link
Collaborator

pebrc commented Feb 3, 2022

Hey @srteam2020 if you could add the precondition also to the line I linked above #5273 (comment)

Once that's done I think I would be OK to merge this as is.

@srteam2020
Copy link
Contributor Author

Sorry I missed that. Just updated the PR again.

Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

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

LGTM!

@pebrc pebrc changed the title fix 5249: use precondition when deleting secrets Use precondition when deleting secrets Feb 3, 2022
@pebrc
Copy link
Collaborator

pebrc commented Feb 4, 2022

Jenkins test this please

@pebrc pebrc merged commit a1f1f00 into elastic:main Feb 4, 2022
fantapsody pushed a commit to fantapsody/cloud-on-k8s that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Elastic operator mistakenly deletes the secret objects when seeing a stale cluster state
3 participants