Skip to content

Improve server version detection - #9

Merged
benni-as merged 6 commits into
masterfrom
feature/improve-version-detection
Mar 26, 2024
Merged

Improve server version detection#9
benni-as merged 6 commits into
masterfrom
feature/improve-version-detection

Conversation

@benni-as

Copy link
Copy Markdown
Contributor

Comment thread bin/check-minio-update.rb
@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

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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.

@jonathanschlue-as jonathanschlue-as left a comment

Copy link
Copy Markdown
Contributor

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 👍

Comment thread README.md Outdated
Comment thread bin/check-minio-update.rb
@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

Copy link
Copy Markdown
Contributor

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 <49396111+jonathanschlue-as@users.noreply.github.com>
@benni-as
benni-as merged commit 9735985 into master Mar 26, 2024
@benni-as
benni-as deleted the feature/improve-version-detection branch March 26, 2024 11:15
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.

2 participants