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
Script SRE can use to manage upgrades of clusters. #56
Conversation
See README for how to use. Note you have to run the script multiple times, so it's a less than ideal. But it's a start..
/lgtm |
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.
Have some idiomatic Bash suggestions.
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.
I started reviewing this, and left some specific comments.. but there are two things throughout the script that should be fixed up:
- Anywhere a variable is used in a command passed to bash, it should be double quoted to prevent shell globbing
- Anywhere a variable is called (and especially if it's concatenated with another string) it should be wrapped in curly brackets.
The other thing I see is if you're creating temporary files on the filesystem they should either be created out of tree (in $TMPDIR or something), or they should be gitignored so they don't get committed to the git tree.
Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
Co-Authored-By: Christoph Blecker <admin@toph.ca>
Co-Authored-By: Christoph Blecker <admin@toph.ca>
Co-Authored-By: Christoph Blecker <admin@toph.ca>
Co-Authored-By: Christoph Blecker <admin@toph.ca>
Co-Authored-By: Christoph Blecker <admin@toph.ca> Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
Co-Authored-By: Christoph Blecker <admin@toph.ca>
782faeb
to
a775349
Compare
Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
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.
Some changes requested and some comments/questions.
Main overall theme is that $OCP_VERSION_FROM
will always be set so checking for it to be set after lines 6-13 is redundant.
Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
Co-Authored-By: Lisa Seelye <18159+lisa@users.noreply.github.com>
@lisa note if using -n $var need to use |
Is |
No, that might as well be |
Missed this is asking -z, not -n... I haven't checked. Given there's a working solution I'm in favor of stopping. Not really keen on learning all the nuances of these options in bash tbh. |
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
/approve
See README for how to use.
Note you have to run the script multiple times, so it's a less than ideal. But it's a start..