Allow references to groups by name (#195)

Group names are unique so we can safely use the name as a reference
method to groups. This makes assigning resources created in the cluster
to groups that already exist a lot easier.
This commit is contained in:
Philip Laine
2026-04-23 13:12:09 +02:00
committed by GitHub
parent 1a593dafc2
commit 99ef70603f
14 changed files with 139 additions and 71 deletions
@@ -132,7 +132,7 @@ func (r *NetworkRouterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
nbv1alpha1ac.SetupKeySpec().
WithName(fmt.Sprintf("networkrouter-%s", uniqueSuffix)).
WithEphemeral(true).
WithAutoGroups(nbv1alpha1ac.ResourceReference().WithID(group.Status.GroupID)),
WithAutoGroups(nbv1alpha1ac.GroupReference().WithID(group.Status.GroupID)),
)
err = r.Client.Apply(ctx, setupKeyAC)
if err != nil {