-
Notifications
You must be signed in to change notification settings - Fork 12
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
Handle file mode for kubeconfig files #42
Conversation
I don't suppose there's some vox pupuli module that's done file mode handling, since the code here is very fragile. |
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.
Looks OK to me. @ananace can you please verify that mode => 'u-x+rw,g-rwx,o-rwx' does also work?
@tuxmea I can verify that such a mode most definitely does not work, since the code has no concept except for octal modes at the moment. Hence my asking if there was any examples for using the mode parsing code from the Puppet file type outside of it, since I very much want to support mode strings as well. |
@ananace on any puppet installation, check /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/symbolic_file_mode.rb |
@tuxmea Yes, those are the exact files I was asking about if anyone has actually used outside of said type. The symbolic file mode handling looks exactly like what I want after all, but they proved annoying to use in-place, and I wanted to avoid having to copy out Puppet code into module-local classes when they already exist. |
@ananace is this ready for merge? |
It should be, I was debating the handling of multiple kubeconfig contexts - or contexts in files created elsewhere, but I figure it's very unlikely that the default of 0600 is going to cause any issues for people - since it's what the K8s tooling itself expects anyway. |
Probably not the most optimal implementation, though it's best to at least ensure it's 0600 by default.