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

[windows] Don't chown existing directory in MkdirAll #129242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tallclair
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

os.MkdirAll ignores the permission bits on Windows (golang/go#65377), so Kubelet uses a utility method that changes the permissions on the directory after it's created. However, the previous implementation changed the permissions regardless of whether a new directory was created, which differs from the Linux behavior.

This change checks whether the directory exists before calling os.MkdirAll, and skips the Chmod call if it does.

Which issue(s) this PR fixes:

Fixes #128897

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

/sig windows node
/priority important-soon
/milestone v1.33
/triage accepted
/assign @marosset

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Dec 16, 2024
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Dec 16, 2024
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/windows Categorizes an issue or PR as relevant to SIG Windows. sig/node Categorizes an issue or PR as relevant to SIG Node. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Dec 16, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tallclair
Once this PR has been reviewed and has the lgtm label, please assign liggitt for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: No status
3 participants