Modernize for Go 1.26 (#232)

This change replaces all uses of pointer utils with the new `new`
function which does the same job.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine
2026-05-05 13:53:44 +02:00
committed by GitHub
parent 69afe3aade
commit ea9f1cb081
14 changed files with 71 additions and 88 deletions
@@ -147,7 +147,7 @@ func (r *NBRoutingPeerReconciler) handleDeployment(ctx context.Context, req ctrl
Kind: "NBRoutingPeer",
Name: nbrp.Name,
UID: nbrp.UID,
BlockOwnerDeletion: util.Ptr(true),
BlockOwnerDeletion: new(true),
},
},
Labels: labels,
@@ -215,7 +215,7 @@ func (r *NBRoutingPeerReconciler) handleDeployment(ctx context.Context, req ctrl
Kind: "NBRoutingPeer",
Name: nbrp.Name,
UID: nbrp.UID,
BlockOwnerDeletion: util.Ptr(true),
BlockOwnerDeletion: new(true),
},
}
updatedDeployment.ObjectMeta.Labels = labels
@@ -345,7 +345,7 @@ func (r *NBRoutingPeerReconciler) handleSetupKey(ctx context.Context, req ctrl.R
// Create new setup key with group Status.GroupID
setupKey, err := r.Netbird.SetupKeys.Create(ctx, api.CreateSetupKeyRequest{
AutoGroups: []string{*nbGroup.Status.GroupID},
Ephemeral: util.Ptr(true),
Ephemeral: new(true),
Name: networkName,
Type: "reusable",
})
@@ -368,7 +368,7 @@ func (r *NBRoutingPeerReconciler) handleSetupKey(ctx context.Context, req ctrl.R
Kind: "NBRoutingPeer",
Name: nbrp.Name,
UID: nbrp.UID,
BlockOwnerDeletion: util.Ptr(true),
BlockOwnerDeletion: new(true),
},
},
Labels: r.DefaultLabels,
@@ -478,7 +478,7 @@ func (r *NBRoutingPeerReconciler) handleGroup(ctx context.Context, req ctrl.Requ
Kind: "NBRoutingPeer",
Name: nbrp.Name,
UID: nbrp.UID,
BlockOwnerDeletion: util.Ptr(true),
BlockOwnerDeletion: new(true),
},
},
Finalizers: []string{"netbird.io/group-cleanup", "netbird.io/routing-peer-cleanup"},