Skip to content

Commit

Permalink
Log Dashboard version on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGreene authored and tekton-robot committed Jan 9, 2023
1 parent d0c0f53 commit d27ddba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cmd/dashboard/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 The Tekton Authors
Copyright 2019-2023 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -109,6 +109,7 @@ func main() {
return
}

logging.Log.Infof("Tekton Dashboard version %s", resource.GetDashboardVersion())
logging.Log.Infof("Starting to serve on %s", l.Addr().String())
logging.Log.Fatal(server.ServeOnListener(l))
}
4 changes: 2 additions & 2 deletions pkg/endpoints/cluster.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 The Tekton Authors
Copyright 2019-2023 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -41,7 +41,7 @@ type Properties struct {
func (r Resource) GetProperties(response http.ResponseWriter, request *http.Request) {
pipelineNamespace := r.Options.GetPipelinesNamespace()
triggersNamespace := r.Options.GetTriggersNamespace()
dashboardVersion := getDashboardVersion(r, r.Options.InstallNamespace)
dashboardVersion := r.GetDashboardVersion()
pipelineVersion := getPipelineVersion(r, pipelineNamespace)

properties := Properties{
Expand Down
7 changes: 4 additions & 3 deletions pkg/endpoints/dashboard.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020-2022 The Tekton Authors
Copyright 2020-2023 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -31,8 +31,9 @@ func getVersion(r Resource, projectName string, namespace string) string {
return configMap.Data["version"]
}

func getDashboardVersion(r Resource, namespace string) string {
version := getVersion(r, "dashboard", namespace)
// GetDashboardVersion returns the version string for the Tekton Dashboard
func (r Resource) GetDashboardVersion() string {
version := getVersion(r, "dashboard", r.Options.InstallNamespace)

if version == "" {
logging.Log.Error("Error getting the Tekton Dashboard deployment version. Version is unknown")
Expand Down

0 comments on commit d27ddba

Please sign in to comment.