Skip to content

Commit

Permalink
feat: support for kubernetes 1.25
Browse files Browse the repository at this point in the history
  • Loading branch information
prometherion committed Nov 19, 2022
1 parent 0f75208 commit 4e3a4fa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions controllers/servicelabels/endpoint_slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package servicelabels

import (
"context"

"github.com/go-logr/logr"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
Expand All @@ -30,10 +29,10 @@ func (r *EndpointSlicesLabelsReconciler) SetupWithManager(ctx context.Context, m
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).
Expand Down

0 comments on commit 4e3a4fa

Please sign in to comment.