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

Secret volume plugin iteration 1 #4515

Merged
merged 1 commit into from
Feb 18, 2015
Merged

Conversation

pmorie
Copy link
Member

@pmorie pmorie commented Feb 18, 2015

Split off from the prototype developed with #4126, contains initial implementation of secret volume plugin. Next steps: tmpfs filesystem for secrets on node.

@googlebot
Copy link

Thanks for your pull request.

It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/.

If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits.

Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name.

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune Ready for a review of the generalities / e2e test, but still in need of tmpfs-related changes

@erictune
Copy link
Member

@thockin or @dchen1107 might have a look at this.

@erictune
Copy link
Member

@pmorie rebase now that other two PRs merged.

@erictune
Copy link
Member

Some comments in pmorie@c80ec0a

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune rebased

@@ -27,7 +27,7 @@ import (

func TestCanSupport(t *testing.T) {
plugMgr := volume.PluginMgr{}
plugMgr.InitPlugins(ProbeVolumePlugins(), &volume.FakeHost{"/tmp/fake"})
plugMgr.InitPlugins(ProbeVolumePlugins(), &volume.FakeHost{"/tmp/fake", nil})
Copy link
Member

Choose a reason for hiding this comment

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

Are these changes actually necessary? Doesn't go initialize an unspecified value to nil?

Copy link
Member Author

Choose a reason for hiding this comment

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

@erictune you're right, I'm not sure why I did that.

Copy link
Member Author

Choose a reason for hiding this comment

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

@erictune I remember why now; if you use field initializers you have to initialize all the fields. If you just do:

volume.FakeHost{"/tmp/fake"}

you get a too-few fields in initializer error. If you don't want to supply the nil, you have to do:

volume.FakeHost{RootDir: "/tmp/fake"}

I'm open to changing it or making a factory method.

Copy link
Member

Choose a reason for hiding this comment

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

no, leave it as is.

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune Do you want the tmpfs changes in this PR or in another one?

@erictune
Copy link
Member

no preference.

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune I don't want the keys in a secret to be coupled to being paths. I'd prefer to use an existing format, but I don't think C_IDENTIFIER or DNS_label is quite appropriate. I want users to be able to use - and _ and to have filename like constructions (viz: id_rsa.pub), but definitely not path separators. Thoughts on the following format?

[a-zA-Z][a-zA-Z0-9_-]*\.?[a-zA-Z0-9]

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

no preference.

I think I would prefer to get the generalities in first in this PR and do tmpfs as a follow-up.

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune something like v1beta3 DNS_SUBDOMAIN but with _

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune I'm inclined for now to say that keys have to be a DNS_SUBDOMAIN, and we can make the SecretSource and volume plugin adapt things into filenames if people need fine grained control over file names.

@pmorie pmorie changed the title WIP: Secret volume plugin Secret volume plugin iteration 1 Feb 18, 2015
@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune This is in the state I want it for this PR. Will do tmpfs and fine-grained control of paths for files in volumes in subsequent PRs.

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune My e2e test passes locally. I'm doing a run in GCE now.

@pmorie
Copy link
Member Author

pmorie commented Feb 18, 2015

@erictune My e2e test passes in GCE as well.

erictune added a commit that referenced this pull request Feb 18, 2015
Secret volume plugin iteration 1
@erictune erictune merged commit af67829 into kubernetes:master Feb 18, 2015
// Adapts a Secret into a VolumeSource.
//
// The contents of the target Secret's Data field will be presented in a volume
// as files using the keys in the Data field as the file names.
type SecretSource struct {
Copy link
Member

Choose a reason for hiding this comment

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

Did we consider SecretSource holding a slice of ObjectReferences so you could pack more than one secret into a single mount?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants