You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: ensure correct APIVersion in AWSClusterControllerIdentity conversion
The conversion webhook for AWSClusterControllerIdentity was failing with:
- expected infrastructure.cluster.x-k8s.io/v1beta2, received infrastructure.cluster.x-k8s.io/v1beta1
- Error from server: conversion webhook returned invalid object: invalid groupVersion
Root cause:
The auto-generated conversion function (Convert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity)
copies TypeMeta directly from the source object, which includes the APIVersion field. This results in
the converted v1beta2 object retaining the v1beta1 APIVersion, causing the conversion webhook to reject
it as invalid.
Fix:
Explicitly set the APIVersion to the target version (v1beta2) after calling the auto-generated
conversion function in both ConvertTo methods for AWSClusterControllerIdentity and
AWSClusterControllerIdentityList. This ensures the converted object has the correct APIVersion
that matches the target API version expected by Kubernetes.
This fix ensures that when Kubernetes requests conversion from v1beta1 to v1beta2, the webhook
returns objects with the correct APIVersion, allowing the conversion to succeed.
0 commit comments