Skip to content

Commit

Permalink
use slices.Equal
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 committed Nov 29, 2024
1 parent 32a37b3 commit 78ebe8e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/controller/infrastructure/actuator_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"encoding/json"
"fmt"
"slices"

"github.com/gardener/gardener/extensions/pkg/controller"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
Expand Down Expand Up @@ -36,25 +37,13 @@ func (a *actuator) Reconcile(ctx context.Context, log logr.Logger, infra *extens
}
}

if !equalStringSlices(infra.Status.Networking.Nodes, newNodes) {
if !slices.Equal(infra.Status.Networking.Nodes, newNodes) {
infra.Status.Networking.Nodes = newNodes
}

return a.reconcile(ctx, log, infra, cluster)
}

func equalStringSlices(a, b []string) bool {
if len(a) != len(b) {
return false
}
for i := range a {
if a[i] != b[i] {
return false
}
}
return true
}

func (a *actuator) reconcile(ctx context.Context, log logr.Logger, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error {
return nil
}

0 comments on commit 78ebe8e

Please sign in to comment.