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

Chmod created hostpath directories to 777 #1991

Merged
merged 2 commits into from
Sep 27, 2017
Merged

Chmod created hostpath directories to 777 #1991

merged 2 commits into from
Sep 27, 2017

Conversation

yuvipanda
Copy link
Contributor

Fixes #1990

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 20, 2017
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@yuvipanda
Copy link
Contributor Author

I'm not entirely sure if the defer for setting the umask back is good enough, or if I should try to set it back more immediately in the two obvious paths it needs to be set back

@r2d4
Copy link
Contributor

r2d4 commented Sep 20, 2017

@minikube-bot ok to test

@codecov-io
Copy link

codecov-io commented Sep 20, 2017

Codecov Report

Merging #1991 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1991      +/-   ##
==========================================
- Coverage   29.87%   29.85%   -0.02%     
==========================================
  Files          77       77              
  Lines        4760     4763       +3     
==========================================
  Hits         1422     1422              
- Misses       3158     3161       +3     
  Partials      180      180
Impacted Files Coverage Δ
pkg/localkube/storage_provisioner.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 685f570...b50944a. Read the comment docs.

@yuvipanda
Copy link
Contributor Author

Can someone help me understand what the test failures mean? Am unsure...

@r2d4
Copy link
Contributor

r2d4 commented Sep 21, 2017

@yuvipanda sorry was related to me working on some of the integration servers.

@minikube-bot retest this please

@yuvipanda yuvipanda changed the title Set umask to 0 before creating hostpath volumes Chmod created hostpath directories to 777 Sep 21, 2017
@yuvipanda
Copy link
Contributor Author

Updated to use chmod per suggestion from @dlorenc

umask affects the entire process, while this is clearer
@@ -73,6 +73,11 @@ func (p *hostPathProvisioner) Provision(options controller.VolumeOptions) (*v1.P
return nil, err
}

// Explictly chmod created dir, so we know mode is set to 0777 regardless of umask
if err := os.Chmod(path, 0777); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@yuvipanda
Copy link
Contributor Author

Are these failures real?

@dlorenc
Copy link
Contributor

dlorenc commented Sep 27, 2017

Should be ok.

@dlorenc dlorenc merged commit d7bb7c3 into kubernetes:master Sep 27, 2017
@yuvipanda yuvipanda deleted the hostpath branch September 27, 2017 16:50
@yuvipanda
Copy link
Contributor Author

Thank you very much!!!

@lawrencedudley
Copy link

Can I be a massive pain and ask if we can get a release with this in? It's causing me all sorts of headaches at the moment.

Nightly is fine but I can't find a way that's current where I can access the build for this PR.

@aaron-prindle
Copy link
Contributor

aaron-prindle commented Oct 3, 2017

We publish CI artifacts for each PR:
https://github.com/kubernetes/minikube/blob/master/docs/contributors/ci_builds.md

To access this build (for Mac) the link would be:
https://storage.googleapis.com/minikube-builds/1991/minikube-darwin-amd64

@lawrencedudley
Copy link

Thanks! I did see that - what threw me was I couldn't access 2025 for some reason so I assumed based on the directory index that these had stopped being published in February.

I've downloaded that - it seems to fix directory permissions but I'm still seeing weird issues with files that have been written into said directories. Am I mad or is that a possibility? Seems to only be after they've been written by a user in the container who is not root, i.e. write a file as a non-root user, then try to write to it again and you get a permissions issue.

I can replicate this with php -a and then file_put_contents to a file (first write is fine, subsequent one isn't).

Using vim, I get read-only file but then with the option to overwrite with :w!

Super confusing anyway :(

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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants