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

Variable COMPOSE_PLUGIN_PATH not set in bash_completion.d/docker script #250

Closed
pypb opened this issue Dec 13, 2023 · 2 comments
Closed
Assignees

Comments

@pypb
Copy link
Contributor

pypb commented Dec 13, 2023

In the bash completion script ~/.bash_completion.d/docker a variable COMPOSE_PLUGIN_PATH is being set by running docker info, which is used to setup completion for docker compose. This command fails due to the completion scripts being sourced before the user PATH has been setup.

On Ubuntu 22.04 completion is first sourced from /etc/profile.d/bash_completion.sh before the users .bashrc, and then again from ~/.bash_completion setup by the role. Both of them is being sourced before the PATH set in the Ansible managed block.

This is visible when logging in as the docker user:

# su - docker
-bash: docker: command not found
-bash: docker: command not found
docker@myhost:~$

If I re-order the Ansible managed block in .bashrc, putting it on the top of the file, the second run (sourced from .bashrc) works:

# su - docker
-bash: docker: command not found
docker@myhost:~$

The second sourcing could be fixed by re-ordering the tasks adding to .bashrc, but I'm unsure how to best tackle the first one. Perhaps modifying the completion-script, using some other method to locate the compose plugin.

@konstruktoid
Copy link
Owner

Hi again @pypb, I'll have a look

@konstruktoid
Copy link
Owner

#252

@pypb pypb closed this as completed Jan 31, 2024
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

No branches or pull requests

2 participants