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

[BUG] compose file completion does not work #10420

Closed
nicks opened this issue Mar 30, 2023 · 2 comments
Closed

[BUG] compose file completion does not work #10420

nicks opened this issue Mar 30, 2023 · 2 comments

Comments

@nicks
Copy link
Contributor

nicks commented Mar 30, 2023

Description

Compose should autocomplete -f to a file name.

Steps To Reproduce

In a shell, type:

docker compose -f <tab>

Expected result:
a list of files in the current directory

Actual result:
Autocompletes to "y"

docker compose -f y
yaml  yml

Additional notes:

docker-compose-v1 behaves correctly

You can also reproduce as:

docker-compose __complete -f ""
yaml
yml
:8
Completion ended with directive: ShellCompDirectiveFilterFileExt

Compose Version

Docker Compose version v2.17.0-rc.1

Docker Environment

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.0-rc.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.18
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.25.0
    Path:     /usr/lib/docker/cli-plugins/docker-scan
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  v0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-scout
WARNING: Plugin "/usr/lib/docker/cli-plugins/docker-compose.14.backup" is not valid: plugin candidate "compose.14.backup" did not match "^[a-z][a-z0-9]*$"

Server:
 Containers: 18
  Running: 11
  Paused: 0
  Stopped: 7
 Images: 20
 Server Version: 20.10.23
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 7.526GiB
 Name: docker-desktop
 ID: 6UI5:YCLD:M374:NQHR:XYW5:AJAQ:WBUQ:DTN4:5RZV:GV65:6HNE:ZTGY
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@laurazard
Copy link
Member

laurazard commented Mar 30, 2023

I opened docker/cli#4136 that should address this :) Other than that, the completion scripts generated by docker completion <bash/zsh/fish> should not have that problem since they use the Cobra V2 completion.

We've closed other issues about this here since it's not really a "Compose" problem, so please track this over in the CLI repo.

@nicks
Copy link
Contributor Author

nicks commented Mar 30, 2023

Wooo thanks @laurazard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants