mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Add feature to add default labels to all resources (#62)
Fixes #41 Thanks to @mhartmann-jaconi for the Helm changes in #42
This commit is contained in:
@@ -27,6 +27,7 @@ type ServiceReconciler struct {
|
||||
ClusterDNS string
|
||||
NamespacedNetworks bool
|
||||
ControllerNamespace string
|
||||
DefaultLabels map[string]string
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -138,6 +139,7 @@ func (r *ServiceReconciler) exposeService(ctx context.Context, req ctrl.Request,
|
||||
Name: "router",
|
||||
Namespace: routerNamespace,
|
||||
Finalizers: []string{"netbird.io/cleanup"},
|
||||
Labels: r.DefaultLabels,
|
||||
},
|
||||
Spec: netbirdiov1.NBRoutingPeerSpec{},
|
||||
}
|
||||
@@ -205,6 +207,7 @@ func (r *ServiceReconciler) reconcileNBResource(nbResource *netbirdiov1.NBResour
|
||||
|
||||
nbResource.ObjectMeta.Name = req.Name
|
||||
nbResource.ObjectMeta.Namespace = req.Namespace
|
||||
nbResource.ObjectMeta.Labels = r.DefaultLabels
|
||||
nbResource.Finalizers = []string{"netbird.io/cleanup"}
|
||||
nbResource.Spec.Name = resourceName
|
||||
nbResource.Spec.NetworkID = *routingPeer.Status.NetworkID
|
||||
|
||||
Reference in New Issue
Block a user