Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

TommyLike
Copy link
Contributor

@TommyLike TommyLike commented Apr 9, 2019

Support printing version in scheduler&controller binaries, output as below:

Version: latest
Git SHA: da1b7ceb66a34c0b153be976d6f0320459e92be7
Built At: 2019-04-09 14:34:01
Go Version: go1.11.4
Go OS/Arch: linux/amd64

For #77
NOTE: Image TAG should be updated when releasing.

@TommyLike TommyLike requested review from k82cn and asifdxtreme April 9, 2019 06:38
Copy link
Contributor

@asifdxtreme asifdxtreme left a 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")
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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()),
Copy link
Member

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?

Copy link
Collaborator

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

@k82cn k82cn closed this Apr 26, 2019
@k82cn k82cn deleted the bug/binaries branch April 26, 2019 06:43

if s.PrintVersion {
version.PrintVersionAndExit()
os.Exit(0)
Copy link
Contributor

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

@k82cn
Copy link
Member

k82cn commented May 7, 2019

@TommyLike , please continue your work with new branch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants