docker / docker/cli

Cannot add secret to service using secret id

Open
#786 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/swarm
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

Using docker service update --add-secret I can only use secret name to reference a secret to add, not its id.

Steps to reproduce the issue:

> "secret" | docker secret create my-secret -
p6xb5qclxhrasp698a97e5fx0

> docker service ls
ID                  NAME                          MODE                REPLICAS            IMAGE                                     PORTS
411ougndilsw        friism-stack_friism-service   replicated          1/1                 nginx:latest

> docker service update --secret-add p6x friism-stack_friism-service
secret not found: p6x
> docker service update --secret-add p6xb5qclxhrasp698a97e5fx0 friism-stack_friism-service
secret not found: p6xb5qclxhrasp698a97e5fx0

> docker service update --secret-add my-secret friism-stack_friism-service
friism-stack_friism-service
overall progress: 1 out of 1 tasks
1/1: running   [==================================================>]
verify: Service converged

Describe the results you received:

secret not found: p6xb5qclxhrasp698a97e5fx0

Describe the results you expected:

Secret added to service.

Output of docker version:

Client:
 Version:       17.12.0-ce-rc4
 API version:   1.30 (downgraded from 1.35)
 Go version:    go1.9.2
 Git commit:    6a2c058
 Built: Wed Dec 20 15:53:56 2017
 OS/Arch:       windows/amd64

Server:
 Engine:
  Version:      ucp/3.0.0-0135340
  API version:  1.30 (minimum version 1.20)
  Go version:   go1.9.2
  Git commit:   0135340
  Built:        Wed Jan  3 10:06:20 UTC 2018
  OS/Arch:      linux/amd64
  Experimental: false

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the docker service update --secret-add CLI entry point and trace how the supplied secret reference is looked up. Verify the behavior with the reproduction commands, then ensure both a secret name and the reported secret ID can add the secret to the service.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.