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

dockerng: compare sets instead of lists of security_opt #39483

Closed

Conversation

Foxlik
Copy link

@Foxlik Foxlik commented Feb 17, 2017

What does this PR do?

Apparently some versions of docker add label=disabled to security_opt when the container is launched as privileged. This causes Salt to relaunch the container to remove it on next run.
Container started as privileged and with the security_opt set, causes it to have the option set twice and makes salt want to remove one instance. With this fix, dockerng will compare just (non-)existence of the flag. So containers started with privileged flag and security_opt set to label=disabled will not get relaunched on every salt run.

What issues does this PR fix or reference?

Fixes #39447

Previous Behavior

security_opt lists were compared as sorted lists. Having one option multiple times being seen as a difference

New Behavior

security_opt lists are compared as sorted sets, effectively just comparing (non-)existence of the flag regardless of count.

Tests written?

No

Apparently some versions of docker add label=disabled to security_opt
when the container is launched as privileged. This causes Salt to
relaunch the container to remove it on next run.
Container started as privileged and with the security_opt set, causes it
to have the option set twice and makes salt want to remove one instance.
With this fix, dockerng will compare just (non-)existence of the flag.
So containers started with privileged flag and security_opt set to
label=disabled will not get relaunched on every salt run.
Fixes saltstack#39447
@terminalmage
Copy link
Contributor

@Foxlik Thanks for this fix! I cherry-picked your fix on top of the 2016.3 release branch so that we can merge it forward and the fix will not need to be backported to earlier release branches. You can read more about our merge-forward workflow here.

Resubmitting this fix against 2016.3 also ensures that there will be no conflicts with a PR I opened to deprecate the old (pre-dockerng) docker modules (#39474).

Thanks again! I'm going to go ahead and close this in favor of #39498.

@Foxlik
Copy link
Author

Foxlik commented Feb 19, 2017

thanks for getting it in Erik! ;-)

@terminalmage
Copy link
Contributor

@Foxlik no problem. The new PR (#39498) is still pending merge, I wanted to get some input from the person with whom you were speaking in #39447.

terminalmage pushed a commit that referenced this pull request Feb 20, 2017
Resubmit PR #39483 against 2016.3 branch
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.

dockerng keeps restarting privileged container
2 participants