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 9, 2025
1 parent 7b33d9b commit 472dc2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 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/v3/pkg/generated/controllers/core"
"github.com/rancher/wrangler/v3/pkg/kubeconfig"
"github.com/rancher/wrangler/v3/pkg/signals"
Expand Down Expand Up @@ -36,6 +37,7 @@ func main() {
logrus.SetLevel(logrus.DebugLevel)
logrus.Debugf("Loglevel set to [%v]", logrus.DebugLevel)
}
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()
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 472dc2a

Please sign in to comment.