From 6280a6202f02dc6a02fec6996c64926c33105b32 Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Mon, 9 Jan 2023 16:00:32 +0000 Subject: [PATCH] Log Dashboard version on startup --- cmd/dashboard/main.go | 3 ++- pkg/endpoints/cluster.go | 4 ++-- pkg/endpoints/dashboard.go | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index ab3901144..6558fdf3c 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -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 @@ -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)) } diff --git a/pkg/endpoints/cluster.go b/pkg/endpoints/cluster.go index 16e7aa325..150daafee 100644 --- a/pkg/endpoints/cluster.go +++ b/pkg/endpoints/cluster.go @@ -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 @@ -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{ diff --git a/pkg/endpoints/dashboard.go b/pkg/endpoints/dashboard.go index 1dbabae6b..d6aefa565 100644 --- a/pkg/endpoints/dashboard.go +++ b/pkg/endpoints/dashboard.go @@ -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 @@ -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")