Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn instead of fail when cannot resolve bearer token on cluster #543

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions clients/ui/bff/internal/api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ func (app *App) AttachRESTClient(handler func(http.ResponseWriter, *http.Request
var bearerToken string
bearerToken, err = resolveBearerToken(app.kubernetesClient)
if err != nil {
app.serverErrorResponse(w, r, fmt.Errorf("failed to resolve BearerToken): %v", err))
return
app.logger.Warn("failed to resolve bearer token", "error", err)
}

client, err := integrations.NewHTTPClient(modelRegistryBaseURL, bearerToken)
Expand All @@ -69,7 +68,7 @@ func resolveBearerToken(k8s integrations.KubernetesClientInterface) (string, err
if err == nil {
//in cluster
//TODO (eder) load bearerToken probably from x-forwarded-access-bearerToken
return "", fmt.Errorf("failed to create Rest client (not implemented yet - inside cluster): %v", err)
return "", fmt.Errorf("failed to fetch bearer token: %v", err)
} else {
//off cluster (development)
bearerToken, err = k8s.BearerToken()
Expand Down