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

fail fast with wrong kubelet rootdir #3331

Merged
merged 5 commits into from
Jul 12, 2023

Conversation

wangshli
Copy link
Contributor

Ⅰ. 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

Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Jul 10, 2023

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

# 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
Copy link
Collaborator

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.

Copy link
Member

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
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #3331 (83192d5) into master (79b2e2e) will decrease coverage by 0.01%.
The diff coverage is 62.50%.

❗ Current head 83192d5 differs from pull request most recent head 0a9ec0c. Consider uploading reports for the commit 0a9ec0c to get more accurate results

@@            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     
Impacted Files Coverage Δ
pkg/utils/dataset_reference.go 62.50% <62.50%> (ø)

csi/shell/entrypoint.sh Outdated Show resolved Hide resolved
Signed-off-by: wangshulin <wangshulin@smail.nju.edu.cn>
# 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!"
Copy link
Collaborator

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.

@cheyang
Copy link
Collaborator

cheyang commented Jul 12, 2023

/test fluid-e2e

Copy link
Member

@TrafalgarZZZ TrafalgarZZZ left a 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>
@fluid-e2e-bot fluid-e2e-bot bot removed the lgtm label Jul 12, 2023
local dir="$1"

if [ ! -d "$dir" ]; then
echo "Error: $dir does not exist."
Copy link
Collaborator

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.

Copy link
Contributor Author

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>
@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
11.1% 11.1% Duplication

Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Jul 12, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cheyang
Copy link
Collaborator

cheyang commented Jul 12, 2023

/test fluid-e2e

@fluid-e2e-bot fluid-e2e-bot bot merged commit b9eda4e into fluid-cloudnative:master Jul 12, 2023
9 checks passed
TrafalgarZZZ pushed a commit to TrafalgarZZZ/fluid that referenced this pull request Sep 13, 2023
* 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>
fluid-e2e-bot bot pushed a commit that referenced this pull request Sep 13, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] fail fast when users mistakenly configure kubelet rootDir
3 participants