Skip to content

Commit

Permalink
update status and ACP separately
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Piccoli <[email protected]>
  • Loading branch information
rccrdpccl committed May 14, 2024
1 parent d627993 commit 9ad93a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,6 @@ func (r *AgentClusterInstallReconciler) labelWorkloadClusterNodes(ctx context.Co
log.Error(err, "error trying to update machine", "op", op, "machine", machine.Name)
return err
}
log.Info("set providerID successfully", "op", op, "machine", machine.Name)
if err := r.setNodeMetadata(ctx, targetClient, node, machine, bmhUID); err != nil {
log.Info("could not set node metadata", "name", node.Name)
} else {
log.Info("set node metadata", "name", node.Name)
}
}
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions controlplane/api/v1beta1/agentcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

const (
AgentClusterConfigurationAnnotation = "controlplane.cluster.x-k8s.io/kubeadm-cluster-configuration"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ func (r *AgentControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Re
return ctrl.Result{}, err
}
defer func() {
if rerr = r.Client.Update(ctx, acp); rerr != nil {
log.Error(rerr, "couldn't update AgentControlPlane", "name", acp.Name, "namespace", acp.Namespace)
}
if rerr = r.Client.Status().Update(ctx, acp); rerr != nil {
log.Error(rerr, "couldn't update AgentControlPlane Status", "name", acp.Name, "namespace", acp.Namespace)
}
Expand Down Expand Up @@ -140,6 +137,10 @@ func (r *AgentControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Re
Kind: "ClusterDeployment",
APIVersion: hivev1.SchemeGroupVersion.String(),
}
if err = r.Client.Update(ctx, acp); err != nil {
log.Error(rerr, "couldn't update AgentControlPlane", "name", acp.Name, "namespace", acp.Namespace)
return ctrl.Result{}, err
}
}
}

Expand Down

0 comments on commit 9ad93a5

Please sign in to comment.