Skip to content

add option to force a reauth for a docker registry - #36893

Merged
rallytime merged 2 commits into
saltstack:developfrom
tyhunt99:aws_ecr_force_reauth
Oct 13, 2016
Merged

rallytime merged 2 commits into
saltstack:developfrom
tyhunt99:aws_ecr_force_reauth

Conversation

@tyhunt99

Copy link
Copy Markdown

What does this PR do?

Adds ability to specify reauth in the docker-registry pillar data structure to specify the reauth kwarg passed to docker-py login call. If not specified it defaults to old behavior of False.

This makes credentials in the .docker/config.json file used by docker-py, which are possibly out of date or have been manually modified, to not interfere with credentials passed in pillar data without having to mange the config file via salt.

What issues does this PR fix or reference?

Fixes #32829

Previous Behavior

Retains old behavior of default reauth=False when calling docker login through docker-py

New Behavior

Ability to specify if a reauth is done during docker login call

Tests written?

No

Please review Salt's Contributing Guide for best practices.

Fixes #32829. Adds ability to specify reauth in the docker-registry pillar data structure to specify the reauth kwarg to docker-py login call. If not specified it defaults to old behaviour of False

@rallytime

Copy link
Copy Markdown
Contributor

Go Go Jenkins!

@rallytime

Copy link
Copy Markdown
Contributor

Thanks for submitting this @tyhunt99.

@ticosax Does this approach look good to you? I wanted to ping you here so you had a chance to review this change as well as to see this comment that is related to the motivation of this change. You're much more involved in this code than I am, so I wanted to make sure you had a chance to see it.

@tyhunt99 Based on the response from @ticosax and if this approach looks good, then I think getting some documentation added so users will know to use this option would be good.

@tyhunt99

Copy link
Copy Markdown
Author

Jenkins was quite sluggish.

@rallytime Do I need to worry about the failing checks? It says the lint failed but didn't actually give me any feedback as to what might be wrong.

For documentation should I just add another commit to this pr?

@rallytime

Copy link
Copy Markdown
Contributor

The ubuntu and centos failures are not related to your change, however the following pylint error is:
https://jenkins.saltstack.com/job/PR/job/salt-pr-lint-n/5931/violations/file/salt/modules/dockerng.py/

And yeah, you can add the doc change in a new commit. Any new commits will trigger a new test run, too.

Tyler Hunt added 2 commits October 11, 2016 14:30
Fixes #32829. Adds ability to specify reauth in the docker-registry pillar data structure to specify the reauth kwarg to docker-py login call. If not specified it defaults to old behaviour of False
…guration

also fixed a typo in the new code where I used cred instead of creds
@tyhunt99

Copy link
Copy Markdown
Author

Okay I fixed the linter issue and also added what I believe is passable documentation. If there are any issues let me know.

Also are there any guidelines as to how documentation should be written?

@rallytime

Copy link
Copy Markdown
Contributor

Thanks @tyhunt99 that looks great. Thanks for updating this!

There are some guidelines for adding docs. You can find those here for future reference.

I'll give @ticosax a little more time to respond, but from my standpoint I think this looks good. Thanks!

@rallytime rallytime added the pending-discussion The issue or pull request needs more discussion before it can be closed or merged label Oct 12, 2016
@ticosax

ticosax commented Oct 13, 2016

Copy link
Copy Markdown
Contributor

thx @rallytime for the ping.

@rallytime
rallytime merged commit 39cd3ca into saltstack:develop Oct 13, 2016
@tyhunt99

Copy link
Copy Markdown
Author

I see the new version was released but this PR was not in in it. When will this be merged into a release?

@rallytime

Copy link
Copy Markdown
Contributor

@tyhunt99 This PR was made against the develop branch, so as it stands it won't be in a release until Nitrogen comes out (the current feature release name of the develop branch). I think we could backport this to a release branch though. I'll backport it to 2016.3 so that it will be included in the 2016.3.5 and the 2016.11.1 release.

@tyhunt99

Copy link
Copy Markdown
Author

Awesome thanks @rallytime! How do you tell which release develop is currently pointing to?

@rallytime

Copy link
Copy Markdown
Contributor

@tyhunt99 Develop is the branch that all feature additions go into. We branch from develop about every six months to create the new feature release. 2016.11 is the latest upcoming feature release, which will be officially announced soon. These develop feature releases are codenamed after the periodic table before we cut the date-based branch. We're currently on Nitrogen.

Bug fixes go into the release branches themselves, and we merge those fixes forward to all newer branches. So for example, the back-port I made just now is only against the 2016.3 branch, but once it goes in, it will be merged into 2016.11, too.

Does that help? We also have some docs explaining this a bit more here.

@tyhunt99

Copy link
Copy Markdown
Author

@rallytime Yes that helps. Thanks!

rallytime pushed a commit that referenced this pull request Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-discussion The issue or pull request needs more discussion before it can be closed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockerng appears to not be using docker registries pillar data

3 participants