-
Notifications
You must be signed in to change notification settings - Fork 218
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
added the fix for script for not being able to use in script source path #218
added the fix for script for not being able to use in script source path #218
Conversation
Hi @aayushrangwala. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
deploy/util/deploy-hostpath.sh
Outdated
@@ -11,7 +11,7 @@ | |||
set -e | |||
set -o pipefail | |||
|
|||
BASE_DIR=$(dirname "$0") | |||
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
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.
Do we need BASH_SOURCE
here? Why not just $0
?
Also, why the output redirection?
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.
Well both BASH_SOURCE
and $0
would serve the same purpose here just using the BASH_SOURCE
in bash script is better even if it is sourced
And for output redirection, sometimes cd prints something to stdout, in the case where a CDPATH is set and even an error can be printed. So to be safe, there is the stdout redirection to dev null and stderr to stdout
To cover CDPATH weird cases, we can even follow to unset CDPATH
at the begining and not use this redirection but still it will be changing user's config
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.
Well both BASH_SOURCE and $0 would serve the same purpose here just using the BASH_SOURCE in bash script is better even if it is sourced
I think it is better to not depend on bash features unnecessarily, because then a conversion to a non-Bash script becomes easier. Currently pipefail
is the only bashism that I am aware of, and even that may not be necessary.
And for output redirection, sometimes cd prints something to stdout
During normal operation? That's very unexpected.
in the case where a CDPATH is set and even an error can be printed.
If an error is printed, presumably the return code is non-zero, BASE_DIR
is unset and everything fails. We want to see the error message of cd
in that case.
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.
ohkay, right. we can depend on pipefail I can ignore the output redirection
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.
done
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 |
/ok-to-test |
/assign @xing-yang For approval. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aayushrangwala, pohly, xing-yang 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 |
/retest |
6613c39 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update 0e7ae99 Update k8s image repo url 77e47cc Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version 155854b Fix dep version mismatch 8f83905 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update 1d3f94d Update go version to 1.20 to match k/k v1.27 e322ce5 Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error b74a512 test: fix golint error aa61bfd Merge pull request kubernetes-csi#218 from xing-yang/update_csi_driver 7563d19 Update CSI_PROW_DRIVER_VERSION to v1.11.0 a2171be Merge pull request kubernetes-csi#216 from msau42/process cb98782 Merge pull request kubernetes-csi#217 from msau42/owners a11216e add new reviewers and remove inactive reviewers dd98675 Add step for checking builds git-subtree-dir: release-tools git-subtree-split: 6613c39
6613c39 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update 0e7ae99 Update k8s image repo url 77e47cc Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version 155854b Fix dep version mismatch 8f83905 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update 1d3f94d Update go version to 1.20 to match k/k v1.27 e322ce5 Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error b74a512 test: fix golint error aa61bfd Merge pull request kubernetes-csi#218 from xing-yang/update_csi_driver 7563d19 Update CSI_PROW_DRIVER_VERSION to v1.11.0 a2171be Merge pull request kubernetes-csi#216 from msau42/process cb98782 Merge pull request kubernetes-csi#217 from msau42/owners a11216e add new reviewers and remove inactive reviewers dd98675 Add step for checking builds git-subtree-dir: release-tools git-subtree-split: 6613c39
6613c39 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update 0e7ae99 Update k8s image repo url 77e47cc Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version 155854b Fix dep version mismatch 8f83905 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update 1d3f94d Update go version to 1.20 to match k/k v1.27 e322ce5 Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error b74a512 test: fix golint error aa61bfd Merge pull request kubernetes-csi#218 from xing-yang/update_csi_driver 7563d19 Update CSI_PROW_DRIVER_VERSION to v1.11.0 a2171be Merge pull request kubernetes-csi#216 from msau42/process cb98782 Merge pull request kubernetes-csi#217 from msau42/owners a11216e add new reviewers and remove inactive reviewers dd98675 Add step for checking builds git-subtree-dir: release-tools git-subtree-split: 6613c39
Update CSI_PROW_DRIVER_VERSION to v1.11.0
What type of PR is this?
/kind bug
What this PR does / why we need it:
The csi driver deployment script was using the base path as the curr dir where the script is triggerred, csi-snapshot class was not getting installed because of incorrect path resolution. Fixed to use the base path always using pwd and cd
Which issue(s) this PR fixes:
Fixes ##199
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
NONE