mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Set Go toolchain to v1.26.1 and apply modernizations (#138)
This change makes sure that we use the latest Go version when building and applies some modernization fixes.
This commit is contained in:
@@ -3,6 +3,8 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -123,9 +125,7 @@ func (r *NBRoutingPeerReconciler) handleDeployment(ctx context.Context, req ctrl
|
||||
}
|
||||
|
||||
labels := r.DefaultLabels
|
||||
for k, v := range nbrp.Spec.Labels {
|
||||
labels[k] = v
|
||||
}
|
||||
maps.Copy(labels, nbrp.Spec.Labels)
|
||||
podLabels := labels
|
||||
podLabels["app.kubernetes.io/name"] = "netbird-router"
|
||||
|
||||
@@ -617,7 +617,7 @@ func (r *NBRoutingPeerReconciler) handleDelete(ctx context.Context, req ctrl.Req
|
||||
}
|
||||
}
|
||||
|
||||
if nbGroup.Spec.Name != "" && util.Contains(nbGroup.Finalizers, "netbird.io/routing-peer-cleanup") {
|
||||
if nbGroup.Spec.Name != "" && slices.Contains(nbGroup.Finalizers, "netbird.io/routing-peer-cleanup") {
|
||||
nbGroup.Finalizers = util.Without(nbGroup.Finalizers, "netbird.io/routing-peer-cleanup")
|
||||
logger.Info("Removing netbird.io/routing-peer-cleanup finalizer NBGroup", "namespace", nbGroup.Namespace, "name", nbGroup.Name)
|
||||
err = r.Client.Update(ctx, &nbGroup)
|
||||
|
||||
Reference in New Issue
Block a user