-
Notifications
You must be signed in to change notification settings - Fork 946
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
fail fast with wrong kubelet rootdir #3331
fail fast with wrong kubelet rootdir #3331
Conversation
Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
Hi @wangshli. Thanks for your PR. I'm waiting for a fluid-cloudnative 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. |
csi/shell/entrypoint.sh
Outdated
# if KUBELET_ROOTDIR not contains config.yaml, it is not likely a real kubelet rootdir, exit with 1 | ||
if [ ! "$(ls $KUBELET_ROOTDIR/config.yaml)" ] ; then | ||
echo "KUBELET_ROOTDIR [$KUBELET_ROOTDIR] is not likely a real kubelet rootdir, please configure csi.kubelet.rootDir in helm charts! " | ||
exit 1 |
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.
Tthis logic is for a generic kubelet check, it is recommended to remove the helm charts related information or change it to a generic configuration option name.
For example: Error: $KUBELET_ROOTDIR does not contain config.yaml file, it's not a kubelet rootdir.
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.
I don't think check config.yaml
is a good idea. It is possible that users put config.yaml elsewhere in customized K8s env. BTW, I suggest use [ -d <dir> ]
or [ -f <file> ]
instead of checking ls <file or dir>
's exit code.
Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
Codecov Report
@@ Coverage Diff @@
## master #3331 +/- ##
==========================================
- Coverage 65.45% 65.44% -0.01%
==========================================
Files 401 402 +1
Lines 23240 23256 +16
==========================================
+ Hits 15211 15221 +10
- Misses 6250 6254 +4
- Partials 1779 1781 +2
|
Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
csi/shell/entrypoint.sh
Outdated
# Check if required subfolders exist in $KUBELET_ROOTDIR folder | ||
if [ ! -d "$KUBELET_ROOTDIR/pods" ]; then | ||
echo "Error: $KUBELET_ROOTDIR does not contain /pods folder, it is not a kubelet rootdir." | ||
echo "See https://github.com/fluid-cloudnative/fluid/blob/master/docs/zh/troubleshooting/debug-fuse.md#%E6%AD%A5%E9%AA%A41-1 for more information!" |
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.
I suggest using English doc instead.
/test fluid-e2e |
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
Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
csi/shell/entrypoint.sh
Outdated
local dir="$1" | ||
|
||
if [ ! -d "$dir" ]; then | ||
echo "Error: $dir does not exist." |
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.
Could you put more information into the message? For example, we have to indicate that root dir of kubelet is misconfigured.
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.
Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
5c2933b
to
0a9ec0c
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheyang 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 |
/test fluid-e2e |
* fail fast with wrong kubelet rootdir Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> * check /pods dir Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> * check kubelet rootdir /plugins Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> * function check_directory Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> * add more info Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> --------- Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
* fail fast with wrong kubelet rootdir * check /pods dir * check kubelet rootdir /plugins * function check_directory * add more info --------- Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn> Co-authored-by: wangshulin <89928606+wangshli@users.noreply.github.com>
Ⅰ. Describe what this PR does
fail fast with wrong kubelet rootdir
Ⅱ. Does this pull request fix one issue?
fixes #3327
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews