cli: Handle missing home directory #1455

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:fix-cli-home into master 2024-10-29 14:28:46 +00:00
Owner

go-homedir library incorrectly handles some of the errors
that could occur. It is archived, so no PR, but let's fix it on our
side. The scenario in case: executing command in an empty environment.

Testing done:

$ PATH='' HOME='' bin/frostfs-cli --version
FrostFS CLI
Version: v0.44.0-rc.7-10-g81f4cdbb-dirty
GoVersion: go1.23.2

$ PATH='' HOME='' bin/frostfs-cli --version --verbose
Get homedir: exec: "getent": executable file not found in $PATH
FrostFS CLI
Version: v0.44.0-rc.7-10-g81f4cdbb-dirty
GoVersion: go1.23.2

$ PATH='' bin/frostfs-cli --version --verbose
FrostFS CLI
Version: v0.44.0-rc.7-10-g81f4cdbb-dirty
GoVersion: go1.23.2
go-homedir library incorrectly handles some of the errors that could occur. It is archived, so no PR, but let's fix it on our side. The scenario in case: executing command in an empty environment. Testing done: ``` $ PATH='' HOME='' bin/frostfs-cli --version FrostFS CLI Version: v0.44.0-rc.7-10-g81f4cdbb-dirty GoVersion: go1.23.2 $ PATH='' HOME='' bin/frostfs-cli --version --verbose Get homedir: exec: "getent": executable file not found in $PATH FrostFS CLI Version: v0.44.0-rc.7-10-g81f4cdbb-dirty GoVersion: go1.23.2 $ PATH='' bin/frostfs-cli --version --verbose FrostFS CLI Version: v0.44.0-rc.7-10-g81f4cdbb-dirty GoVersion: go1.23.2 ```
fyrchik added 1 commit 2024-10-29 13:16:23 +00:00
cli: Handle missing home directory
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 1m40s
DCO action / DCO (pull_request) Failing after 2m36s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m41s
Tests and linters / Staticcheck (pull_request) Successful in 3m30s
Vulncheck / Vulncheck (pull_request) Successful in 3m56s
Tests and linters / Lint (pull_request) Successful in 4m0s
Build / Build Components (pull_request) Successful in 4m44s
Tests and linters / gopls check (pull_request) Successful in 4m40s
Tests and linters / Tests (pull_request) Successful in 7m56s
Tests and linters / Tests with -race (pull_request) Successful in 8m3s
416871f3d3
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik requested review from storage-core-committers 2024-10-29 13:17:17 +00:00
fyrchik requested review from storage-core-developers 2024-10-29 13:17:20 +00:00
fyrchik added the
bug
label 2024-10-29 13:18:57 +00:00
fyrchik added this to the v0.44.0 milestone 2024-10-29 13:18:59 +00:00
fyrchik added the
frostfs-cli
label 2024-10-29 13:18:59 +00:00
fyrchik force-pushed fix-cli-home from 416871f3d3 to 6649e006fc 2024-10-29 13:19:00 +00:00 Compare
Author
Owner

If you would like to argue with my choice of words for the error message, please do :)

If you would like to argue with my choice of words for the error message, please do :)
acid-ant approved these changes 2024-10-29 13:24:46 +00:00
a-savchuk approved these changes 2024-10-29 13:26:40 +00:00
Member

Please update commit message.

Please update commit message.
dstepanov-yadro approved these changes 2024-10-29 13:34:10 +00:00
fyrchik force-pushed fix-cli-home from 6649e006fc to 433aab12bb 2024-10-29 13:37:59 +00:00 Compare
fyrchik merged commit 433aab12bb into master 2024-10-29 14:28:46 +00:00
fyrchik deleted branch fix-cli-home 2024-10-29 14:28:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1455
No description provided.