mirror of
https://github.com/rancher/k3k.git
synced 2026-08-19 04:16:16 +00:00
fix for restoring policy (#413)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user