Skip to content

Commit

Permalink
scaffold: printVersion includes operator's Version
Browse files Browse the repository at this point in the history
Currently an Operator built from scaffold does not
print the Operator's version.Version
  • Loading branch information
drnic committed Sep 21, 2019
1 parent 3a85983 commit b562ed8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pkg/scaffold/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
"{{ .Repo }}/pkg/apis"
"{{ .Repo }}/pkg/controller"
"{{ .Repo }}/pkg/version"
"github.com/operator-framework/operator-sdk/pkg/k8sutil"
kubemetrics "github.com/operator-framework/operator-sdk/pkg/kube-metrics"
Expand All @@ -75,6 +76,7 @@ var (
var log = logf.Log.WithName("cmd")
func printVersion() {
log.Info(fmt.Sprintf("Version: %s", version.Version))
log.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
log.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
log.Info(fmt.Sprintf("Version of operator-sdk: %v", sdkVersion.Version))
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/scaffold/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
"github.com/example-inc/app-operator/pkg/apis"
"github.com/example-inc/app-operator/pkg/controller"
"github.com/example-inc/app-operator/pkg/version"
"github.com/operator-framework/operator-sdk/pkg/k8sutil"
kubemetrics "github.com/operator-framework/operator-sdk/pkg/kube-metrics"
Expand All @@ -74,6 +75,7 @@ var (
var log = logf.Log.WithName("cmd")
func printVersion() {
log.Info(fmt.Sprintf("Version: %s", version.Version))
log.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
log.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
log.Info(fmt.Sprintf("Version of operator-sdk: %v", sdkVersion.Version))
Expand Down

0 comments on commit b562ed8

Please sign in to comment.