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

🐛 Make clusterctl move tolerant to APIserver ServerTimeoutError bug when re-creating objects with GenerateName set #5185

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

alejandroEsc
Copy link
Contributor

What this PR does / why we need it:
More details found in slack: https://kubernetes.slack.com/archives/C8TSNPY4T/p1630421115076500

The move function is not idempotent because currently the Kubernetes apiserver returns a ServerTimoutError for those objects whose metadata has the generateName flag. This can be verified by creating a resource with this flag, and then trying to create -f the file again with the same name in place.

This is a known Kubernetes issue kubernetes/kubernetes#32220

Until a fix is in place, we propose this solution which would allow the move function to be idempotent and handle these kind of objects without tossing an unexpected error.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 1, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @alejandroEsc. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 1, 2021
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 1, 2021
@alejandroEsc
Copy link
Contributor Author

/assign @timothysc

@vincepri
Copy link
Member

vincepri commented Sep 1, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 1, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 1, 2021
@alejandroEsc
Copy link
Contributor Author

/assign @timothysc

@alejandroEsc
Copy link
Contributor Author

/retest

@fabriziopandini
Copy link
Member

Would it be possible to rename the PR and amend comments so we make explicit we making move tolerant to a known Kuberenetes defect?

@alejandroEsc
Copy link
Contributor Author

Would it be possible to rename the PR and amend comments so we make explicit we making move tolerant to a known Kuberenetes defect?

Please rename, what comments do you suggest?

@fabriziopandini
Copy link
Member

The comment was fixed according to #5185 (review).
PR title still need to be fixed

@alejandroEsc
Copy link
Contributor Author

The comment was fixed according to #5185 (review).
PR title still need to be fixed

Could you please suggest s change to the title you would like?

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

@alejandroEsc please squash commits, we should be good to go

ran gofmt

remove generateName metadata instead of changing the AlreadyExist error

remove unnecessary comment

Update cmd/clusterctl/client/cluster/mover.go

Co-authored-by: Daniel Lipovetsky <[email protected]>

Update cmd/clusterctl/client/cluster/mover.go

Co-authored-by: Vince Prignano <[email protected]>
@alejandroEsc alejandroEsc changed the title 🐛 make move idempotent by handling machine objs correctly 🐛 Allow move cmd idempotent by making it tolerant to kubernetes issues #32220 Sep 2, 2021
@alejandroEsc alejandroEsc changed the title 🐛 Allow move cmd idempotent by making it tolerant to kubernetes issues #32220 🐛 Allow move cmd idempotent by making it tolerant to a known kubernetes issue Sep 2, 2021
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 2, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 2, 2021
@k8s-ci-robot k8s-ci-robot merged commit 0c1b1fc into kubernetes-sigs:master Sep 2, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Sep 2, 2021
@alejandroEsc alejandroEsc deleted the ae/move/fix branch September 2, 2021 02:17
@fabriziopandini fabriziopandini changed the title 🐛 Allow move cmd idempotent by making it tolerant to a known kubernetes issue 🐛 Mave clusterctl move tolerant to APIserver ServerTimeoutError bug when re-creating objects with GenerateName set Sep 2, 2021
@fabriziopandini fabriziopandini changed the title 🐛 Mave clusterctl move tolerant to APIserver ServerTimeoutError bug when re-creating objects with GenerateName set 🐛 Make clusterctl move tolerant to APIserver ServerTimeoutError bug when re-creating objects with GenerateName set Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants