feat: supporting k8s >= 1.25

This commit is contained in:
Dario Tranchitella
2022-12-17 15:54:34 +01:00
parent ee213aab49
commit fb5c1a1fa6

View File

@@ -26,14 +26,14 @@ func (r *EndpointSlicesLabelsReconciler) SetupWithManager(ctx context.Context, m
}
switch {
case r.VersionMajor == 1 && r.VersionMinor <= 16:
case r.VersionMajor == 1 && r.VersionMinor < 16:
r.Log.Info("Skipping controller setup, as EndpointSlices are not supported on current kubernetes version", "VersionMajor", r.VersionMajor, "VersionMinor", r.VersionMinor)
return nil
case r.VersionMajor == 1 && r.VersionMinor >= 21:
r.abstractServiceLabelsReconciler.obj = &discoveryv1.EndpointSlice{}
default:
case r.VersionMajor == 1 && r.VersionMinor < 25:
r.abstractServiceLabelsReconciler.obj = &discoveryv1beta1.EndpointSlice{}
default:
r.abstractServiceLabelsReconciler.obj = &discoveryv1.EndpointSlice{}
}
return ctrl.NewControllerManagedBy(mgr).