-
Notifications
You must be signed in to change notification settings - Fork 9
fix: Copy ClusterClass and Templates only if they do not already exist #1386
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
Conversation
|
When a failure like this happens, does it prevent the rest of the resources from being copied or is this more about fixing the controller from continuously failing? |
It is possible for some resource to exist, but a copy of it cannot be created. For example, CAPX validation became more strict without changing its API version. Templates already on the cluster remain usable. However, they cannot be copied, because the copy does not pass validation. Prior to this change, we always copied the template, and ignored the "already exists" error. Now we first check if the template exist, and only create it if it does not.
18c472b to
2359a8c
Compare
Good question. The failure does prevent the rest of the resources from being copied. In practice, we have only seen this failure when attempting to copy (a second time) a ClusterClass that is already copied, but that cannot be copied again (due to a backward incompatible change in the CEL validation for the resource). |
#1386) **What problem does this PR solve?**: It is possible for some resource to exist, but a copy of it cannot be created. For example, CAPX validation became more strict without changing its API version. Templates already on the cluster remain usable. However, they cannot be copied, because the copy does not pass validation. Prior to this change, we always copied the template, and ignored the "already exists" error. Now we first check if the template exist, and only create it if it does not. **Which issue(s) this PR fixes**: Fixes NCN-110955 **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> New unit tests exercise the changes. **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. --> (cherry picked from commit 93002a8)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
🤖 I have created a release *beep* *boop* --- ## 0.42.0 (2026-01-08) <!-- Release notes generated using configuration in .github/release.yaml at main --> ## What's Changed ### Exciting New Features 🎉 * feat: Enable multus installation for Nutanix infra by @kshitij-kumar-ngt in #1445 ### Fixes 🔧 * fix: update CoreDNS mapping file by @dkoshkin in #1447 * fix: Copy ClusterClass and Templates only if they do not already exist by @dlipovetsky in #1386 ## New Contributors * @kshitij-kumar-ngt made their first contribution in #1445 **Full Changelog**: v0.41.3...v0.42.0 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
What problem does this PR solve?:
It is possible for some resource to exist, but a copy of it cannot be created. For example, CAPX validation became more strict without changing its API version. Templates already on the cluster remain usable. However, they cannot be copied, because the copy does not pass validation.
Prior to this change, we always copied the template, and ignored the "already exists" error. Now we first check if the template exist, and only create it if it does not.
Which issue(s) this PR fixes:
Fixes NCN-110980
How Has This Been Tested?:
New unit tests exercise the changes.
Special notes for your reviewer: