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

Fix registry local_user functionalitity. #353

Merged
merged 1 commit into from
Oct 30, 2018

Conversation

stejanse
Copy link
Contributor

@stejanse stejanse commented Oct 5, 2018

Docker uses $HOME environment variable to determine docker.json location.
Having /root as as standard $HOME, local_user functionality is broken.

Docker uses $HOME environment variable to determine docker.json location.
Having /root as as standard $HOME, local_user functionality is broken.
davejrt
davejrt previously requested changes Oct 8, 2018
Copy link
Contributor

@davejrt davejrt left a comment

Choose a reason for hiding this comment

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

I think a better approach is to introduce another param, with the default for ROOT that can be overridden if you're not using the root user.

@stejanse
Copy link
Contributor Author

stejanse commented Oct 8, 2018

@davejrt Thanks for you response! What would be the use case for a home directory that does not match the user's home directory? Feels more or less like double configuration (both user and user's home) to me.

@davejrt
Copy link
Contributor

davejrt commented Oct 8, 2018

I've not tested it with an alternate user, so I suppose I am looking to ensure that any edge cases are covered off where an execution using another user would break something.

@stejanse
Copy link
Contributor Author

stejanse commented Oct 8, 2018

For now, using local_user simply does not work unless the user is privileged to write to /root. I do not see any reason to write the .docker/config.json to any other location than your standard $HOME. If you do, you have to override your $HOME every time you use docker pull or docker push.

If you want me to change the PR anyways as you suggested, I will. I suggest to keep it this way: making $HOME configurable will only introduce redundant configuration.

@shamil
Copy link
Contributor

shamil commented Oct 14, 2018

I've not tested it with an alternate user, so I suppose I am looking to ensure that any edge cases are covered off where an execution using another user would break something.

Tested with alternate user and currently it's broken, I can't upgrade to latest version due to exactly this issue. I agree with @stejanse no point to have $HOME configurable.

@davejrt
Copy link
Contributor

davejrt commented Oct 25, 2018

I've tested this and don't have any issue with this code as such. I'm interested to see the rest of your workflow, are you then using something else to pull images onto the box using your local user? My testing didn't allow for the images to be pulled as the script is executed as root.

@shamil
Copy link
Contributor

shamil commented Oct 28, 2018

I've tested this and don't have any issue with this code as such. I'm interested to see the rest of your workflow, are you then using something else to pull images onto the box using your local user? My testing didn't allow for the images to be pulled as the script is executed as root.

Not sure I understand the question.

My use case is simple, having a user (other than root) to be able to pull/push images to/from registry.
Pulling / pushing happens outside of puppet workflow, puppet just used to configure the user with registry pull/push rights.

@davejrt does this make sense?

@davejrt
Copy link
Contributor

davejrt commented Oct 28, 2018

It makes sense, but I don't know why you'd want to break your puppet workflow by doing half the job with Puppet, when it would make more sense to allow the user to push/pull images within the scope of the module.

@shamil
Copy link
Contributor

shamil commented Oct 28, 2018

It makes sense, but I don't know why you'd want to break your puppet workflow by doing half the job with Puppet, when it would make more sense to allow the user to push/pull images within the scope of the module.

Without going into detail of our architecture, briefly we have CI processes that are responsible to push images.

But regardless, how we do it or not, how it relates to the this issue. Currently configuring private registries with non-root is broken and we need to fix that. This PR seems like fix the original problem without breaking any other flow, or I misunderstood something?

@davejrt what should be done in your opinion to have this merged?

@davejrt
Copy link
Contributor

davejrt commented Oct 29, 2018

I know it doesn't break anything else, but in my opinion it feels like this PR only adds half of the functionality required to be able to complete the whole job with Puppet, which is ideally what we want to support in our modules.

@shamil
Copy link
Contributor

shamil commented Oct 29, 2018

@davejrt yep I see what you mean. You need this when using docker::run for example. Currenlty it's required to not use the local_user param. Which is the desired flow, due to docker::run uses root user.

I think originally (before this repo forked the original one) support for local_user was added due to request to configure it independendly from docker::run. And it was working really well, since version 2.x (as far as I remember) this feature broken, and it hold people like me from upgrading to latest versions of this module.

I agree with you, we should fix this whole thing like you suggest, BUT first we maybe need to fix the regression that was introduced since version 2.x

@davejrt
Copy link
Contributor

davejrt commented Oct 30, 2018

@shamil Thanks for pointing that out. I've just reviewed the changes and you're correct in that this was a breaking change that we introduced. Merging this now with an aim in the future to add something to complete the workflow with alternate users.

@davejrt davejrt dismissed their stale review October 30, 2018 02:53

Not required at this time

@davejrt davejrt merged commit d0f55db into puppetlabs:master Oct 30, 2018
@Ramesh7 Ramesh7 added the bugfix label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants