-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add "check" command #44
base: main
Are you sure you want to change the base?
Conversation
38fdc89
to
a55e911
Compare
Sanity check Quipucords setup and configurations. This command will check and print the status of important files and directories that the installer creates for running Quipucords. Example of status: OK, Not owned by you and Missing. The return code for the command is the number of problematic files/dirs. Relates to JIRA: DISCOVERY-729
a55e911
to
cfe0b33
Compare
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.
The title of the original feature request was Ensure appropriate ownership and permissions of required host directories
with this acceptance criteria:
If a ~/.local (or other required directory or file) has bad ownership or mode, when running the installer's "check" command, the installer detects the problem, reports an error, and exits with a non-zero status.
However, it looks like this PR only checks the existence and ownership of the directories and files, not the permissions (modes) of them.
I pulled and switched to your branch, and I "broke" some file and directory modes like this on my local VM:
chmod 000 /home/brasmith/.local/share/quipucords/certs/server.key
chmod 000 /home/brasmith/.local/share/quipucords/db/userdata
Confirming that they are indeed "broken":
$ ls -la /home/brasmith/.local/share/quipucords/certs/server.key
----------. 1 brasmith 100000 1704 Dec 2 17:12 /home/brasmith/.local/share/quipucords/certs/server.key
$ cat /home/brasmith/.local/share/quipucords/certs/server.key
cat: /home/brasmith/.local/share/quipucords/certs/server.key: Permission denied
$ ls -la /home/brasmith/.local/share/quipucords/db/userdata
ls: cannot open directory '/home/brasmith/.local/share/quipucords/db/userdata': Permission denied
When I run the new check
command and search for those paths in the output, they appear to be "OK" when that is incorrect, and the script also exits with a successful 0
exit code which is also incorrect:
$ ./bin/quipucords-installer check | grep 'server.key\|userdata'
/home/brasmith/.local/share/quipucords/certs/server.key: OK
/home/brasmith/.local/share/quipucords/db/userdata: OK
$ ./bin/quipucords-installer check &> /dev/null
$ echo $?
0
Output: ... ERROR: Not writable by you (read-only) Relates to JIRA: DISCOVERY-729
Relates to JIRA: DISCOVERY-729
Not a priority, but PTAL at 2db827e...37919bd for a couple of suggestions. Thanks. |
Sanity check Quipucords setup and configurations.
This command will check and print the status of important files and directories that the installer creates for running Quipucords. The return code for the command is the number of problematic files/dirs found.
When all's well, the output looks like this:
The output when there are problems found:
Relates to JIRA: DISCOVERY-729