Skip to content

Commit

Permalink
Update condition statement when publishing event during cluster creat…
Browse files Browse the repository at this point in the history
…ion when creating the secret
  • Loading branch information
ranatrk committed Dec 19, 2023
1 parent 73aa132 commit 48f46c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/controller/automatedclusterdiscovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,13 @@ func (r *AutomatedClusterDiscoveryReconciler) createSecret(ctx context.Context,
// publish event for ClusterCreated
r.event(acd, corev1.EventTypeNormal, "ClusterCreated", fmt.Sprintf("Cluster %s created", cluster.Name))
_, err = controllerutil.CreateOrPatch(ctx, r.Client, secret, func() error {
if value, err := clientcmd.Write(*cluster.KubeConfig); err != nil {
value, err := clientcmd.Write(*cluster.KubeConfig)
if err != nil {
return err
} else {
secret.Data["value"] = value
}

secret.Data["value"] = value

return nil
})
if err != nil {
Expand Down

0 comments on commit 48f46c3

Please sign in to comment.