Skip to content

Commit

Permalink
fix: Print build commit SHA during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
yiannistri committed Jan 10, 2025
1 parent 9fb3d5a commit d5483b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/rancher/aks-operator/controller"
aksv1 "github.com/rancher/aks-operator/pkg/generated/controllers/aks.cattle.io"
"github.com/rancher/aks-operator/pkg/version"
core3 "github.com/rancher/wrangler/v2/pkg/generated/controllers/core"
"github.com/rancher/wrangler/v2/pkg/kubeconfig"
"github.com/rancher/wrangler/v2/pkg/signals"
Expand All @@ -30,6 +31,8 @@ func main() {
// set up signals so we handle the first shutdown signal gracefully
ctx := signals.SetupSignalContext()

logrus.Infof("Starting aks-operator (version: %s, commit: %s)", version.Version, version.GitCommit)

// This will load the kubeconfig file in a style the same as kubectl
cfg, err := kubeconfig.GetNonInteractiveClientConfig(kubeconfigFile).ClientConfig()
if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package version

var (
GitCommit string
Version string
)

0 comments on commit d5483b6

Please sign in to comment.