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

Add output for "secrets" and "configs" on stack deploy #593

Merged
merged 1 commit into from Oct 3, 2017

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 3, 2017

When deploying a stack from a compose file, the output did not show
that a secret or config was created. This patch adds messages for these.

Create a configuration file and compose file:

$ cat > config.yml <<EOF
hello: world
EOF

$ cat > secret.txt <<EOF
p@ssw0rd
EOF


$ cat > docker-compose.yml <<EOF
version: "3.3"
services:
   test:
     image: nginx:alpine
     configs:
     - source: myconfig
       target: /my-config.yml
     secrets:
     - source: mysecret
       target: /my-secret.txt
configs:
  myconfig:
    file: ./config.yml
secrets:
  mysecret:
    file: ./secret.txt
EOF

Before this patch is applied:

$ docker stack deploy -c docker-compose.yml example

Creating network example_default
Creating service example_test

After this patch is applied:

$ docker stack deploy -c docker-compose.yml example
Creating network example_default
Creating secret example_mysecret
Creating config example_myconfig
Creating service example_test

- What I did

Added additional messages during docker stack deploy

- How to verify it

See steps above

- Description for the changelog

* Add informational messages about creating `secrets` and `configs` during `docker stack deploy` [docker/cli#593](https://github.com/docker/cli/pull/593)

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

@codecov-io
Copy link

codecov-io commented Oct 3, 2017

Codecov Report

Merging #593 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master     #593      +/-   ##
==========================================
- Coverage   49.41%   49.41%   -0.01%     
==========================================
  Files         208      208              
  Lines       17184    17186       +2     
==========================================
  Hits         8492     8492              
- Misses       8260     8262       +2     
  Partials      432      432

@@ -251,6 +252,7 @@ func createConfigs(
}
case apiclient.IsErrConfigNotFound(err):
// config does not exist, then we create a new one.
fmt.Fprintf(dockerCli.Out(), "Creating secret %s\n", configSpec.Name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/secret/config/ 👼

Copy link
Member Author

Choose a reason for hiding this comment

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

thx 😅 fixed

When deploying a stack from a compose file, the output did not show
that a secret or config was created. This patch adds messages for these.

Create a configuration file and compose file:

    $ cat > config.yml <<EOF
    hello: world
    EOF

    $ cat > secret.txt <<EOF
    p@ssw0rd
    EOF

    $ cat > docker-compose.yml <<EOF
    version: "3.3"
    services:
       test:
         image: nginx:alpine
         configs:
         - source: myconfig
           target: /my-config.yml
         secrets:
         - source: mysecret
           target: /my-secret.txt
    configs:
      myconfig:
        file: ./config.yml
    secrets:
      mysecret:
        file: ./secret.txt
    EOF

Before this patch is applied:

    $ docker stack deploy -c docker-compose.yml example
    Creating network example_default
    Creating service example_test

After this patch is applied:

    $ docker stack deploy -c docker-compose.yml example
    Creating network example_default
    Creating secret example_mysecret
    Creating config example_myconfig
    Creating service example_test

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 merged commit 1367fc1 into docker:master Oct 3, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.11.0 milestone Oct 3, 2017
@thaJeztah thaJeztah deleted the add-create-output branch October 3, 2017 15:42
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.

None yet

6 participants