Commit 6ff19342 authored by Lars Ekman's avatar Lars Ekman Committed by GitHub

Corrected detection of K8s minor version (#4430)

Fixes #4428
Signed-off-by: default avatarLars Ekman <lars.g.ekman@est.tech>
parent a9206996
...@@ -257,7 +257,7 @@ func (k *Kubernetes) InitKubeCache(ctx context.Context) (err error) { ...@@ -257,7 +257,7 @@ func (k *Kubernetes) InitKubeCache(ctx context.Context) (err error) {
return err return err
} }
major, _ := strconv.Atoi(sv.Major) major, _ := strconv.Atoi(sv.Major)
minor, _ := strconv.Atoi(sv.Minor) minor, _ := strconv.Atoi(strings.TrimRight(sv.Minor, "+"))
if k.opts.useEndpointSlices && major <= 1 && minor <= 18 { if k.opts.useEndpointSlices && major <= 1 && minor <= 18 {
log.Info("watching Endpoints instead of EndpointSlices in k8s versions < 1.19") log.Info("watching Endpoints instead of EndpointSlices in k8s versions < 1.19")
k.opts.useEndpointSlices = false k.opts.useEndpointSlices = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment