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

read from /etc/container/rhel/secrets also #187

Closed

Conversation

runcom
Copy link
Collaborator

@runcom runcom commented Aug 24, 2016

Fix #186

@rhatdan @cgwalters @parthaa PTAL

  • I'll take care of moving this patch once merged in 1.10.3 fedora and rhel
  • I've also to modify docker.spec to include /etc/container/rhel/secrets in %files as we do for /usr/share/rhel/secrets

@rhatdan
Copy link
Member

rhatdan commented Aug 24, 2016

Do we want to create this directory on install, or just document that the user can create the directory to override the default? Or should we just read both directories?

@runcom
Copy link
Collaborator Author

runcom commented Aug 24, 2016

Do we want to create this directory on install, or just document that the user can create the directory to override the default? Or should we just read both directories?

I'd go with shipping the directory as we do with the other so people are aware of this functionality on install but this is just my 2c. @cgwalters wdyt?

@rhatdan
Copy link
Member

rhatdan commented Aug 24, 2016

If we ship the directory now and the directory is empty then it will break the default secret passing. Since it only grabs /etc/containers/rhel/secrets if it exists.

@cgwalters
Copy link
Member

🚲 Can we drop the rhel/ from the path in /etc now, since this functionality can apply to other environments?

@@ -81,5 +86,8 @@ func readFile(root, name string) ([]SecretData, error) {
}

func getHostSecretData() ([]SecretData, error) {
return readAll("/usr/share/rhel/secrets", "")
if _, err := os.Stat(overrideDir); err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm...I was thinking more like individual files with the same name override (systemd like), whereas this seems to be "if /etc exists, it wins entirely", so users would have to copy over data from /usr that they want to keep.

Copy link
Member

Choose a reason for hiding this comment

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

So we really need a union of the files in both directories with /etc overriding content in /usr/share.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

on it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cgwalters I guess we want this union just for rhsm and rhel7.repo - does /etc/pki/entitlement need this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan @cgwalters case:

/usr/share/rhel/secrets/rhsm/ <- not empty
/etc/container/rhsm/ <- EMPTY

what's the end result in the container?
an empty dir or the merge? I'd say the empty dir, the other way is too much maybe or not?

Copy link
Member

Choose a reason for hiding this comment

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

Well if we went with the systemd way and had

/usr/share/rhel/secretes/rhsm/
filea, fileb, filec, filed
/etc/container/rhsm
filec,filef

We would end up with
filea, fileb, filed for /usr/share and filec, filef from /etc/container/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

alright so it's a complete merge overriding from /etc/container/ and in case of an empty dir in /etc/container/ we grab everything from /usr/share/rhel/secrets/

@runcom
Copy link
Collaborator Author

runcom commented Aug 24, 2016

Can we drop the rhel/ from the path in /etc now

no strong opinion on this, @rhatdan ?

@rhatdan
Copy link
Member

rhatdan commented Aug 24, 2016

Yes drop it.

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.

3 participants