Skip to content

Conversation

@dlipovetsky
Copy link
Contributor

@dlipovetsky dlipovetsky commented Nov 13, 2025

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?:

New unit tests exercise the changes.

Special notes for your reviewer:

@dkoshkin
Copy link
Contributor

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?

@dlipovetsky dlipovetsky marked this pull request as draft November 14, 2025 05:36
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.
@dlipovetsky dlipovetsky force-pushed the dlipovetsky/namespacesync-get-before-create branch from 18c472b to 2359a8c Compare December 1, 2025 21:01
@dlipovetsky
Copy link
Contributor Author

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?

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).

@dlipovetsky dlipovetsky marked this pull request as ready for review December 1, 2025 22:17
@github-actions github-actions bot added fix and removed fix labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants