Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit 525eae9

Browse files
authored
Merge pull request #29 from mesosphere/faiq/rmdelete
🐛fix: removes use of slices.DeleteFunc because it zeros the elements a…
2 parents a29c6ce + dfc6382 commit 525eae9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

cmd/clusterctl/client/cluster/cert_manager.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package cluster
1919
import (
2020
"context"
2121
_ "embed"
22-
"slices"
2322
"time"
2423

2524
"github.com/blang/semver/v4"
@@ -346,9 +345,13 @@ func (cm *certManagerClient) shouldUpgrade(desiredVersion string, objs, installO
346345
// removes resources that are generated by the kubernetes API
347346
// this is relevant if the versions are the same, because we compare
348347
// the number of objects when version of objects are equal
349-
objs = slices.DeleteFunc(objs, func(obj unstructured.Unstructured) bool {
350-
return obj.GetKind() == "Endpoints" || obj.GetKind() == "EndpointSlice"
351-
})
348+
newObjs := []unstructured.Unstructured{}
349+
for _, o := range objs {
350+
if !(o.GetKind() == "Endpoints" || o.GetKind() == "EndpointSlice") {
351+
newObjs = append(newObjs, o)
352+
}
353+
}
354+
objs = newObjs
352355
for i := range objs {
353356
obj := objs[i]
354357

0 commit comments

Comments
 (0)