Skip to content

Conversation

@thaJeztah
Copy link
Member

remove redundant closures around completion functions

These were remnants from some earlier implementation.

cli/command/secret: remove completion for "ls"

This command takes no arguments, so should not provide completion.

cli/command/secret: fix completion to complete names, not IDs

cli/command: fix completion for secret create, config create

These commands accept two arguments; the first is a custom name,
the second is either a filename or "-" to create from STDIN.

With this patch:

# does not provide completion
docker secret create <tab>

# starts providing completion once a non-empty name is provided
docker secret create somename<tab>
file.txt other-file.txt

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Improve shell completion for `docker secret` and `docker config` subcommands.

- A picture of a cute animal (not mandatory but encouraged)

These were remnants from some earlier implementation.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This command takes no arguments, so should not provide completion.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
These commands accept two arguments; the first is a custom name,
the second is either a filename or "-" to create from STDIN.

With this patch:

    # does not provide completion
    docker secret create <tab>

    # starts providing completion once a non-empty name is provided
    docker secret create somename<tab>
    file.txt other-file.txt

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/config/create.go 0.00% 15 Missing ⚠️
cli/command/secret/create.go 0.00% 15 Missing ⚠️
cli/command/secret/cmd.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah
Copy link
Member Author

thaJeztah commented Sep 10, 2025

Interesting failure;

--- FAIL: TestGetAutoPAT (0.00s)
    --- FAIL: TestGetAutoPAT/general_error (0.00s)
        api_test.go:388: assertion failed: expected error to contain "unexpected response from Hub: 500 Internal Server Error", got "Post \"http://127.0.0.1:49229/v2/access-tokens/desktop-generate/\"": net/http: HTTP/1.x transport connection broken: http: CloseIdleConnections called"

@thaJeztah
Copy link
Member Author

Thx! I had a couple other PRs related to completions (and some other bits) open as well; if you have time to have a peek.

@thaJeztah thaJeztah merged commit 2f6abcf into docker:master Sep 10, 2025
104 of 105 checks passed
@thaJeztah thaJeztah deleted the fix_completions branch September 10, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants