Skip to content

Commit

Permalink
fix(ui): support page error when no context given
Browse files Browse the repository at this point in the history
  • Loading branch information
christophenne committed Feb 27, 2024
1 parent 424086f commit 62faa9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion internal/web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ func (s *server) supportPage(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/bootstrap", http.StatusFound)
return
}
err := supportPageTmpl.Execute(w, err)
err := supportPageTmpl.Execute(w, &map[string]any{
"CurrentContext": "",
"KubeconfigDefaultLocation": clientcmd.RecommendedHomeFile,
"Err": err,
})
checkTmplError(err, "support")
} else {
http.Redirect(w, r, "/", http.StatusFound)
Expand Down
6 changes: 3 additions & 3 deletions internal/web/templates/pages/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
<h1>You're almost there!</h1>
</div>

{{if .KubeconfigMissing}}
{{if .Err.KubeconfigMissing}}
<p>
Glasskube did not find a
<a href="https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/"
target="_blank">kubeconfig</a>
file in the default location!
</p>
{{else if not .BootstrapMissing}}
{{else if not .Err.BootstrapMissing}}
<p class="text-center">Unfortunately, there is an error with your kubeconfig:</p>
<div class="alert alert-danger mb-3 font-monospace">{{.}}</div>
<div class="alert alert-danger mb-3 font-monospace">{{.Err}}</div>
{{ end }}

Please get a kubeconfig file from your cloud provider and drag & drop it here:
Expand Down

0 comments on commit 62faa9b

Please sign in to comment.