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

cli: retry during upgrade when node image update fails due to conflict error #2123

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

elchead
Copy link
Contributor

@elchead elchead commented Jul 20, 2023

Context

During upgrade apply the write to our NodeVersion custom resource may fail because the constellation-operator updated the status field of the resource between read and write.
Our operator solves this by retrying the write if it encounters a write conflict [1]. The CLI's upgrade apply code [2] should use the same pattern.

[1] https://github.com/edgelesssys/constellation/blob/main/operators/constellation-node-operator/controllers/joiningnode_controller.go#L65-L78
[2] https://github.com/edgelesssys/constellation/blob/main/cli/internal/kubernetes/upgrade.go#L253

Proposed change(s)

  • add a retry of the update

Related issue

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

@elchead elchead added the bug fix Fixing a bug label Jul 20, 2023
@elchead elchead requested a review from derpsteb July 20, 2023 15:30
@netlify
Copy link

netlify bot commented Jul 20, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit 685b345
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/64be339f16f01f00085592f3

@elchead elchead added this to the v2.10.0 milestone Jul 20, 2023
@elchead elchead force-pushed the fix/kubernetes/node-img-update-retry branch 2 times, most recently from 3475303 to ab60292 Compare July 20, 2023 18:44
Copy link
Member

@derpsteb derpsteb left a comment

Choose a reason for hiding this comment

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

Lgtm 👍
I like the mock pkg!
Maybe run an upgrade test before merging.

@elchead
Copy link
Contributor Author

elchead commented Jul 24, 2023

https://github.com/edgelesssys/constellation/actions/runs/5642456787 running e2e

@elchead elchead force-pushed the fix/kubernetes/node-img-update-retry branch from ab60292 to 685b345 Compare July 24, 2023 08:17
@elchead elchead merged commit 92abb89 into main Jul 24, 2023
4 checks passed
@elchead elchead deleted the fix/kubernetes/node-img-update-retry branch July 24, 2023 10:15
@elchead elchead changed the title upgrade: retry when node image update fails due to conflict error cli: retry during upgrade when node image update fails due to conflict error Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants