Skip to content

Commit

Permalink
Allow public clients without secrets (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastjan authored Apr 12, 2024
1 parent 7dcfdcd commit 7bd9ed6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions controllers/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
}

// Vault secret
if client.Secret == nil || *client.Secret == "" {
return ctrl.Result{}, fmt.Errorf("client %q has no secret", *templatedClient.ClientID)
}
if err := r.syncVaultSecret(ctx, instance, *client.Secret); err != nil {
return ctrl.Result{}, fmt.Errorf("unable to sync vault secret: %w", err)
if client.Secret != nil && *client.Secret != "" {
if err := r.syncVaultSecret(ctx, instance, *client.Secret); err != nil {
return ctrl.Result{}, fmt.Errorf("unable to sync vault secret: %w", err)
}
} else {
l.Info("Client has no secret, might be a public client. Skipping vault secret sync.")
}

// template client roles
Expand Down

0 comments on commit 7bd9ed6

Please sign in to comment.