Skip to content

Commit

Permalink
better error message for invalid Service Manager credentials (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerenlahav authored Dec 17, 2023
1 parent 1e4f302 commit e420ff1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.21.4-alpine as builder
FROM --platform=$BUILDPLATFORM golang:1.21.5-alpine as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
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 e420ff1

Please sign in to comment.