Skip to content

Commit

Permalink
better error message for invalid Service Manager credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
kerenlahav committed Dec 10, 2023
1 parent 1e4f302 commit 9bfffaa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/base_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ func (r *BaseReconciler) getSMClient(ctx context.Context, object api.SAPBTPResou
}
}

if len(cfg.ClientID) == 0 ||
len(cfg.ClientSecret) == 0 ||
len(cfg.URL) == 0 ||
len(cfg.TokenURL) == 0 {
return nil, fmt.Errorf("invalid Service-Manager credentials, contact your cluster administrator")
}
cl, err := sm.NewClient(ctx, cfg, nil)
return cl, err
}
Expand Down

0 comments on commit 9bfffaa

Please sign in to comment.