Skip to content

Commit 4135920

Browse files
authored
Makes run command version details in sync with the version command (#5023)
* Makes run command version details in sync with the version command * Makes helm-operator run command version details in sync with the version command Signed-off-by: sujil02 <[email protected]>
1 parent 925f842 commit 4135920

File tree

2 files changed

+10
-2
lines changed
  • internal/cmd

2 files changed

+10
-2
lines changed

internal/cmd/ansible-operator/run/cmd.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ import (
5252
var log = logf.Log.WithName("cmd")
5353

5454
func printVersion() {
55+
version := sdkVersion.GitVersion
56+
if version == "unknown" {
57+
version = sdkVersion.Version
58+
}
5559
log.Info("Version",
5660
"Go Version", runtime.Version(),
5761
"GOOS", runtime.GOOS,
5862
"GOARCH", runtime.GOARCH,
59-
"ansible-operator", sdkVersion.Version,
63+
"ansible-operator", version,
6064
"commit", sdkVersion.GitCommit)
6165
}
6266

internal/cmd/helm-operator/run/cmd.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ import (
4848
var log = logf.Log.WithName("cmd")
4949

5050
func printVersion() {
51+
version := sdkVersion.GitVersion
52+
if version == "unknown" {
53+
version = sdkVersion.Version
54+
}
5155
log.Info("Version",
5256
"Go Version", runtime.Version(),
5357
"GOOS", runtime.GOOS,
5458
"GOARCH", runtime.GOARCH,
55-
"helm-operator", sdkVersion.Version,
59+
"helm-operator", version,
5660
"commit", sdkVersion.GitCommit)
5761
}
5862

0 commit comments

Comments
 (0)