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

Shellcheck #65

Merged
merged 24 commits into from
Oct 1, 2024
Merged

Shellcheck #65

merged 24 commits into from
Oct 1, 2024

Conversation

rustydb
Copy link
Contributor

@rustydb rustydb commented Sep 24, 2024

Shellcheck issues I had time to fix up while preparing MTL-2454.

@rustydb rustydb requested a review from a team as a code owner September 24, 2024 01:51
@rustydb rustydb force-pushed the shellcheck branch 2 times, most recently from a36af4e to b4f43b7 Compare September 24, 2024 02:01
@rustydb rustydb force-pushed the shellcheck branch 3 times, most recently from b4422ac to 1da9145 Compare September 25, 2024 17:39
The next few commits in this repo will be fixing shellcheck and will
break our "sub-packages" (other dracut repos). We should prevent anyone
from installing the current versions of dracut-metal-dmk8s and
dracut-metal-luksetcd.
The very next version of those repos should contain fixes for
accommodating the changes made from shellcheck.
This note is false, `/etc/fstab.metal` is not touched in this function.
Renames the variable to match the configuration's key name.
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.
`metal_die` uses a `_reset` variable, but only `reset` was declared.
The second argument to `metal_resolve_disk` is being passed through `sed` to remove everything following a `,`, but this argument's value is always an integer (no commas). The `echo | sed` is effectively useless, not to mention confusing to readers.
`METAL_IGNORE_THRESHOLD` is calculated in another script, making it impossible to run `metal_scand` by just sourcing `metal-lig.sh` alone.
Optimize calls; replace `echo | sed` with simple bash string replacements.

Check inputs before moving on.
rustydb added a commit to Cray-HPE/dracut-metal-luksetcd that referenced this pull request Sep 27, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
rustydb added a commit to Cray-HPE/dracut-metal-luksetcd that referenced this pull request Sep 27, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
rustydb added a commit to Cray-HPE/dracut-metal-dmk8s that referenced this pull request Sep 27, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
rustydb added a commit to Cray-HPE/dracut-metal-luksetcd that referenced this pull request Sep 27, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
rustydb added a commit to Cray-HPE/dracut-metal-dmk8s that referenced this pull request Sep 27, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
rustydb added a commit to Cray-HPE/dracut-metal-luksetcd that referenced this pull request Sep 27, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
This check does not work in BASH when it is acknowledging POSIX environments, and we haven't hit this issue ever (so now is a good time for it to start happening!)
Rename the variable to something that is easier to infer a
desired/future. "old" and "new" were confusing here in my opinion.
@rustydb
Copy link
Contributor Author

rustydb commented Oct 1, 2024

Successfully PXE booted a storage, worker, and master node. Disk booted a master node.
Partitions and mounts looked great each time.

@rustydb rustydb merged commit 4d1d0e3 into main Oct 1, 2024
5 checks passed
@rustydb rustydb deleted the shellcheck branch October 1, 2024 22:00
rustydb added a commit to Cray-HPE/dracut-metal-luksetcd that referenced this pull request Oct 1, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
rustydb added a commit to Cray-HPE/dracut-metal-dmk8s that referenced this pull request Oct 1, 2024
Use upper-case vars to indicate a variable is exported elsewhere.

Fix missing double-quotes.

NOTE: This also adopts dracut-metal-mdsquash changes from Cray-HPE/dracut-metal-mdsquash#65 and thus requires dracut-metal-mdsquash>=2.5.0
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