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

Replace "which" with "command -v" #2070

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

yzxiu
Copy link
Contributor

@yzxiu yzxiu commented Dec 21, 2023

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #
On certain machines with shells like zsh, errors may occur when using "if...which".
We can resolve this issue by replacing "which" with "command -v".

[qemu-41] ~ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
[qemu-41] ~ uname -a
Linux qemu-41 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

before:
Screenshot_20231221_154627

08:16:14 UTC message: [qemu-43]
downloading image: kubesphere/pause:3.8
08:16:14 UTC message: [qemu-45]
downloading image: kubesphere/pause:3.8
08:16:14 UTC message: [qemu-43]
pull image failed: Failed to exec command: sudo -E /bin/bash -c "env PATH=$PATH crictl pull kubesphere/pause:3.8 --platform amd64" 
env: ‘crictl’: No such file or directory: Process exited with status 127
08:16:14 UTC message: [qemu-42]
pull image failed: Failed to exec command: sudo -E /bin/bash -c "env PATH=$PATH crictl pull kubesphere/pause:3.8 --platform amd64" 
env: ‘crictl’: No such file or directory: Process exited with status 127
env: ‘crictl’: No such file or directory: Process exited with status 127

after:
Screenshot_20231221_154914

Special notes for reviewers:

Does this PR introduced a user-facing change?


Additional documentation, usage docs, etc.:


@ks-ci-bot ks-ci-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 21, 2023
@yzxiu
Copy link
Contributor Author

yzxiu commented Dec 21, 2023

@pixiake

@pixiake
Copy link
Collaborator

pixiake commented Jan 5, 2024

@yzxiu Thanks for this contribution!
/lgtm
/approve

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2024
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: c48db3823228beaf749eb2af93cc280269e2621e

@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pixiake, yzxiu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 5, 2024
@ks-ci-bot ks-ci-bot merged commit c6ded1a into kubesphere:master Jan 5, 2024
7 checks passed
@pixiake
Copy link
Collaborator

pixiake commented Jan 5, 2024

@all-contributors please add @yzxiu for code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants