Skip to content

Commit

Permalink
Corrected detection of K8s minor version (coredns#4430)
Browse files Browse the repository at this point in the history
Fixes coredns#4428

Signed-off-by: Lars Ekman <[email protected]>
  • Loading branch information
Lars Ekman authored and sgreene570 committed Mar 8, 2021
1 parent 8a53aec commit 4c1fe83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (k *Kubernetes) InitKubeCache(ctx context.Context) (err error) {
return err
}
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 {
log.Info("watching Endpoints instead of EndpointSlices in k8s versions < 1.19")
k.opts.useEndpointSlices = false
Expand Down

0 comments on commit 4c1fe83

Please sign in to comment.