Skip to content

Commit fb4ef94

Browse files
authored
Merge pull request #12685 from sbueringer/pr-cabpk-fix
🐛 Always use latest apiVersion when getting owner of KubeadmConfig in CABPK
2 parents 7d89617 + fc2ddaa commit fb4ef94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bootstrap/util/configowner.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ func getConfigOwner(ctx context.Context, c client.Client, obj metav1.Object, get
162162
for _, gk := range allowedGKs {
163163
if refGVK.Group == gk.Group && refGVK.Kind == gk.Kind {
164164
return getFn(ctx, c, &corev1.ObjectReference{
165-
APIVersion: ref.APIVersion,
165+
// Intentionally always using the latest apiVersion to get Machine or MachinePool,
166+
// even if the apiVersion in the ownerRef has not been bumped yet.
167+
APIVersion: clusterv1.GroupVersion.String(),
166168
Kind: ref.Kind,
167169
Name: ref.Name,
168170
Namespace: obj.GetNamespace(),

0 commit comments

Comments
 (0)