Skip to content

Commit

Permalink
checking for empty name namespace more
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoran committed Sep 14, 2024
1 parent 6dfeb48 commit 62a9c7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/vaultstaticsecret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ type eventMsg struct {

func (r *VaultStaticSecretReconciler) streamStaticSecretEvents(ctx context.Context, o *secretsv1beta1.VaultStaticSecret, wsClient *vault.WebsocketClient) error {
logger := log.FromContext(ctx).WithName("streamStaticSecretEvents")
if o.Namespace == "" || o.Name == "" {
logger.Error(fmt.Errorf("empty namespace or name"), "Empty namespace or name, stopping streamStaticSecretEvents")
return fmt.Errorf("empty namespace or name")
}
conn, err := wsClient.Connect(ctx)
if err != nil {
return fmt.Errorf("failed to connect to vault websocket: %w", err)
Expand Down

0 comments on commit 62a9c7e

Please sign in to comment.