-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve server version detection #9
Conversation
@@ -72,7 +72,7 @@ def latest_version | |||
def local_version | |||
@local_version ||= begin | |||
stdout, stderr, status = Open3.capture3( | |||
{ 'PATH' => ENV['PATH'] }, 'minio --version', unsetenv_others: true | |||
{ 'PATH' => ENV['PATH'] }, 'journalctl --boot --unit minio | grep "Version: RELEASE" | tail -n 1', unsetenv_others: true # rubocop:disable Layout/LineLength |
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.
--boot
bedeutet, dass wir nur die frischestens logs bekommen. Sonst werden die mitunter ganz schön lang und wir haben unnötig Disk IO.
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.
Darüber hinaus hatte ich auch nach einem Version String im health endpoint geschaut, aber den hat minio aus Sicherheitsgründen vor längerer Zeit ausgebaut.
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.
FTR: Ich hab lokal via bin/console
überprüft, ob Open3#capture3 auch Shell pipes unterstützt ✅
irb(main):014:1* Open3.capture3(
irb(main):015:1* { 'PATH' => ENV['PATH'] }, 'echo foo | wc -l', unsetenv_others: true # rubocop:disable Layout/LineLength
irb(main):016:0> )
=> ["1\n", "", #<Process::Status: pid 24932 exit 0>]
Dafür musste ich noch 1 File hinzufügen, siehe a3b8b20
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.
Ah, danke für den Check. Ich hatte das gar nicht lokal ausprobiert und mich auf den test verlassen. Aber jetzt fällt mir auf, dass der Test ja Open3 komplett mockt (was ja auch nicht anders geht). Also gut, dass nochmal ausprobiert zu haben.
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.
Hinweis: Habe selber noch bin/console gefixt als Commit in diesem PR.
Wunsch: Bitte noch README anpassen (yay).
Approve schonmal.
LGTM 👍
@@ -72,7 +72,7 @@ def latest_version | |||
def local_version | |||
@local_version ||= begin | |||
stdout, stderr, status = Open3.capture3( | |||
{ 'PATH' => ENV['PATH'] }, 'minio --version', unsetenv_others: true | |||
{ 'PATH' => ENV['PATH'] }, 'journalctl --boot --unit minio | grep "Version: RELEASE" | tail -n 1', unsetenv_others: true # rubocop:disable Layout/LineLength |
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.
FTR: Ich hab lokal via bin/console
überprüft, ob Open3#capture3 auch Shell pipes unterstützt ✅
irb(main):014:1* Open3.capture3(
irb(main):015:1* { 'PATH' => ENV['PATH'] }, 'echo foo | wc -l', unsetenv_others: true # rubocop:disable Layout/LineLength
irb(main):016:0> )
=> ["1\n", "", #<Process::Status: pid 24932 exit 0>]
Dafür musste ich noch 1 File hinzufügen, siehe a3b8b20
Co-authored-by: Jonathan Schlue <[email protected]>
https://trello.com/c/JUtcafnV/6223-1-minio-update-stabilisieren-opsmaintenance6223jutcafnv