fix for restoring policy (#413)

This commit is contained in:
Enrico Candino
2025-07-17 10:25:09 +02:00
committed by GitHub
parent 0a55bec305
commit 748a439d7a
+3 -2
View File
@@ -231,9 +231,10 @@ func (c *ClusterReconciler) reconcile(ctx context.Context, cluster *v1alpha1.Clu
return err
}
if policyName, found := ns.Labels[policy.PolicyNameLabelKey]; found {
cluster.Status.PolicyName = policyName
policyName, found := ns.Labels[policy.PolicyNameLabelKey]
cluster.Status.PolicyName = policyName
if found && policyName != "" {
var policy v1alpha1.VirtualClusterPolicy
if err := c.Client.Get(ctx, client.ObjectKey{Name: policyName}, &policy); err != nil {
return err