-
Notifications
You must be signed in to change notification settings - Fork 142
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
Remove mkdir call while creating the registration probe file #214
Remove mkdir call while creating the registration probe file #214
Conversation
e8ed512
to
2d19977
Compare
@@ -88,11 +87,6 @@ func TouchFile(filePath string) error { | |||
return err | |||
} | |||
if !exists { | |||
err := os.MkdirAll(filepath.Dir(filePath), 0755) |
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.
Is this assumption true for all csi drivers?
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.
The path for the temp registration file is hidden from the users, the steps to create it are:
- take the kubelet registration path:
/var/lib/kubelet/plugins/<drivername.example.com>/csi.sock
- on a successful registration, write the temp file to the same dirname:
/var/lib/kubelet/plugins/<drivername.example.com>/registration
I think the directory /var/lib/kubelet/plugins/<drivername.example.com>/
is created in advance in the driver spec e.g. from the README
volumes:
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/<drivername.example.com>/
type: DirectoryOrCreate
I checked a few drivers:
I think the assumption that this directory is created is true therefore node-driver-registrar should only create the file assuming that the dir already exists
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mauriciopoppe, msau42 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 |
6613c398 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update 0e7ae993 Update k8s image repo url 77e47cce Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version 155854b0 Fix dep version mismatch 8f839056 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update 1d3f94dd Update go version to 1.20 to match k/k v1.27 e322ce5e Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error b74a5120 test: fix golint error aa61bfd0 Merge pull request kubernetes-csi#218 from xing-yang/update_csi_driver 7563d196 Update CSI_PROW_DRIVER_VERSION to v1.11.0 a2171bef Merge pull request kubernetes-csi#216 from msau42/process cb987826 Merge pull request kubernetes-csi#217 from msau42/owners a11216e4 add new reviewers and remove inactive reviewers dd986754 Add step for checking builds b66c0824 Merge pull request kubernetes-csi#214 from pohly/junit-fixes b9b6763b filter-junit.go: fix loss of testcases when parsing Ginkgo v2 JUnit d4277839 filter-junit.go: preserve system error log 38e11468 prow.sh: publish individual JUnit files as separate artifacts git-subtree-dir: release-tools git-subtree-split: 6613c3980d1e418bebb7bc49d64c977cfff85671
What type of PR is this?
What this PR does / why we need it:
node-driver-registrar fails to come up on a filesystem where the
/var/lib/kubelet
directory is read onlyUnder the assumption that the
kubeletRegistrationPath
path exists we don't need to create subdirectories, we will still create the probe exec file by default though.Which issue(s) this PR fixes:
Fixes #213
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
/cc @jingxu97 @msau42