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

Minor fixes to nsenter connection plugin #249

Conversation

jgoldschrafe
Copy link
Contributor

SUMMARY

Two fixes to the nsenter connection plugin:

  • Ensure the nsenter_pid option is retrieved in _connect instead of __init__ to prevent a crasher due to bad initialization order
  • Replace the use of --all-namespaces with specific namespaces to support compatibility with Busybox nsenter (used on for example, Alpine containers)
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nsenter connection plugin

ADDITIONAL INFORMATION

N/A

Jeff Goldschrafe added 2 commits December 2, 2021 12:01
- Ensure the nsoption_pid option is retrieved in _connect instead of
  __init__ to prevent a crasher due to initialization order
- Replace the use of --all-namespaces with specific namespaces to
  support compatibility with Busybox nsenter (for example, Alpine)
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Can you please add a changelog fragment?

@felixfontein
Copy link
Collaborator

@jgoldschrafe I'm planning to do the bugfix release I announced last week by latest this weekend, so if you want to get this in, please try to work on it until then :)

@jgoldschrafe
Copy link
Contributor Author

Updated, thank you!

Co-authored-by: Felix Fontein <felix@fontein.de>
@felixfontein felixfontein merged commit d224752 into ansible-collections:main Dec 9, 2021
@patchback
Copy link

patchback bot commented Dec 9, 2021

Backport to stable-1: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-1/d224752cf1957c64af4962671b357922293a141c/pr-249

Backported as #251

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 9, 2021
* Minor fixes to nsenter connection plugin

- Ensure the nsoption_pid option is retrieved in _connect instead of
  __init__ to prevent a crasher due to initialization order
- Replace the use of --all-namespaces with specific namespaces to
  support compatibility with Busybox nsenter (for example, Alpine)

* minor tidy

* Fix PEP8 violation

* Changelog fragment

* Update changelogs/fragments/249-nsenter-fixes.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Jeff Goldschrafe <jeff.goldschrafe@flatiron.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d224752)
@felixfontein
Copy link
Collaborator

@jgoldschrafe thanks for fixing this!

felixfontein pushed a commit that referenced this pull request Dec 9, 2021
* Minor fixes to nsenter connection plugin

- Ensure the nsoption_pid option is retrieved in _connect instead of
  __init__ to prevent a crasher due to initialization order
- Replace the use of --all-namespaces with specific namespaces to
  support compatibility with Busybox nsenter (for example, Alpine)

* minor tidy

* Fix PEP8 violation

* Changelog fragment

* Update changelogs/fragments/249-nsenter-fixes.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Jeff Goldschrafe <jeff.goldschrafe@flatiron.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d224752)

Co-authored-by: Jeff Goldschrafe <jgoldschrafe@users.noreply.github.com>
spantaleev added a commit to devture/docker-ansible that referenced this pull request Apr 21, 2022
Related to:

- https://docs.ansible.com/ansible/latest/collections/community/docker/nsenter_connection.html
- ansible-collections/community.docker#249

The Docker community collection that's installed in Alpine 3.15 is old
and doesn't contain the aforementioned nsenter plugin patch, so
`--connection=community.docker.nsenter` doesn't work there.
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.

2 participants