-
Notifications
You must be signed in to change notification settings - Fork 993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support PrintVersion for scheduler&controller binaries #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -43,6 +44,7 @@ func (s *ServerOption) AddFlags(fs *pflag.FlagSet) { | |||
fs.BoolVar(&s.EnableLeaderElection, "leader-elect", s.EnableLeaderElection, "Start a leader election client and gain leadership before "+ | |||
"executing the main loop. Enable this when running replicated kar-scheduler for high availability.") | |||
fs.StringVar(&s.LockObjectNamespace, "lock-object-namespace", s.LockObjectNamespace, "Define the namespace of the lock object.") | |||
fs.BoolVar(&s.PrintVersion, "version", false, "Show version and quit") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also support -v
@@ -19,6 +19,7 @@ import ( | |||
"fmt" | |||
"os" | |||
"time" | |||
"volcano.sh/volcano/pkg/version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close to other vk pkg.
@@ -19,6 +19,7 @@ import ( | |||
"fmt" | |||
"os" | |||
"time" | |||
"volcano.sh/volcano/pkg/version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
fmt.Sprintf("Version: %s", Version), | ||
fmt.Sprintf("Git SHA: %s", GitSHA), | ||
fmt.Sprintf("Built At: %s", Built), | ||
fmt.Sprintf("Go Version: %s", runtime.Version()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will that change in different environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, golang lib is compiled in
|
||
if s.PrintVersion { | ||
version.PrintVersionAndExit() | ||
os.Exit(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be removed
@TommyLike , please continue your work with new branch :) |
Support printing version in scheduler&controller binaries, output as below:
For #77
NOTE: Image TAG should be updated when releasing.