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

Fixes Issue 186: specify custom directories for rhel secrets #191

Merged

Conversation

shishir-a412ed
Copy link

Fixes #186
Signed-off-by: Shishir Mahajan shishir.mahajan@redhat.com

@shishir-a412ed
Copy link
Author

Carryover of #187
ping @rhatdan @runcom

@runcom
Copy link
Collaborator

runcom commented Sep 7, 2016

Mmm I think this isnt just a carry, instead, this PR should take care of continuing from #187 (comment) implement what Dan and Colin was saying..

if err != nil {
return nil, err
}
overrideSecrets, err := readAll("/etc/container/rhel/secrets", "")
Copy link
Member

Choose a reason for hiding this comment

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

If the directory does not exist, we should not fail.

Copy link
Member

Choose a reason for hiding this comment

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

I think we wanted just /etc/containers/secrets also, no need to hard code rhel.
/etc/containers/secrets
Note plural, which I think we are using for /var/lib/containers

@cgwalters WDYT

Copy link
Collaborator

Choose a reason for hiding this comment

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

Correct, /etc/containers/secrets

Copy link
Author

Choose a reason for hiding this comment

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

This does not fail when the directory does not exist.
e.g if /etc/container/rhel/secrets does not exist, then it is just gonna return a slice with baseSecrets and vice versa.

@rhatdan
Copy link
Member

rhatdan commented Sep 7, 2016

We probably want to merge this patch into the secrets patch once it is approved.

if err != nil {
return nil, err
}
return append(baseSecrets, overrideSecrets...), nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this take care of merging the two directories?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean, when integrating on the slice later in the code...

Copy link
Author

Choose a reason for hiding this comment

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

yes it works. If both of the directories exists, then in the container rootfs, you will eventually have the union of files in PATH1 and PATH2. With /etc/container/rhel/secrets overriding /usr/share/rhel/secrets.

@shishir-a412ed
Copy link
Author

@rhatdan Updated the override path
FROM: /etc/container/rhel/secrets
TO: /etc/containers/secrets

return readAll("/usr/share/rhel/secrets", "")
baseSecrets, err := readAll("/usr/share/rhel/secrets", "")
if err != nil {
return nil, err
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a little documentation to this error.

return nil, fmt.Errorf("Failed to read /usr/share/rhel/secrets: %s", err.Error())

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
@shishir-a412ed
Copy link
Author

@rhatdan PTAL

@runcom
Copy link
Collaborator

runcom commented Sep 8, 2016

LGTM

ping @rhatdan @cgwalters

@runcom
Copy link
Collaborator

runcom commented Sep 8, 2016

we need this patch fixed in fedora-1.10.3, rhel7-1.10.3, and docker-1.13 also, I'll take care of those once this is merged

@rhatdan
Copy link
Member

rhatdan commented Sep 8, 2016

LGTM

@rhatdan rhatdan merged commit 9c4561c into projectatomic:docker-1.12 Sep 8, 2016
@rhatdan
Copy link
Member

rhatdan commented Sep 8, 2016

Lokesh can you merge this with the secrets patch so we have one less patch.

@runcom
Copy link
Collaborator

runcom commented Sep 8, 2016

@rhatdan, @lsm5 please do not. The branch docker-1.12 is a freezed branch since upstream 1.12 is GA, we will lose commit history if we squash these changes with the secret patch. The only branch this is going to be squashed is docker-1.13 because upstream hasn't related it yet. Older branch are in a maintaining mode where patches are only added and we never lose commit history by squashing.

I'll take care of squashing these changes in docker-1.13, fedora-1.10.3 and rhel-1.10.3 need just a PR to have this changes applied as well.

@rhatdan
Copy link
Member

rhatdan commented Sep 8, 2016

SGTM. As long as the list of patches we are carrying at projectatomic.io does not grow for the master branch, I am happy

@runcom
Copy link
Collaborator

runcom commented Sep 8, 2016

Exactly, the patches in the development branch (in this case docker-1.13) never grow in numbers, that's where I squash commits because we can afford to lose git history from commit to commit.

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