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

Secret with Custom File Name is being overridden upon updating a Service via SwarmPit #166

Closed
ghost opened this issue Oct 30, 2017 · 2 comments
Assignees
Labels
kind/bug Something isn't working
Projects
Milestone

Comments

@ghost
Copy link

ghost commented Oct 30, 2017

Steps to reproduce:

  1. Create a service with any image, set replicas to 1.
  2. Create a secret echo myval | docker secret create mysecret -
  3. Add the secret to the service, with a custom file name: docker service update --secret-add source=mysecret,target=/custompath/mysecret
  4. In Swarmpit, choose the service, and change value for replicas to 0, then Save the service

What happens:

  • upon inspecting the service with docker service inspect ..., the custom secret filename (.Spec.TaskTemplate.Secrets.File.Name), has been overwritten with the value of the secret name (.Spec.TaskTemplate.Secrets.SecretName).

Compare .Spec and .PreviousSpec to see more clearly. i.e. -

                        {
                            "File": {
                                "Name": "/custompath/mysecret",
                                "UID": "0",
                                "GID": "0",
                                "Mode": 292
                            },
                            "SecretID": "xxx",
                            "SecretName": "yyy"
                        }

vs

"Secrets": [
                        {
                            "File": {
                                "Name": "yyy",      # <---- whoops? should stayed /custompath/mysecret
                                "UID": "0",
                                "GID": "0",
                                "Mode": 292
                            },
                            "SecretID": "xxx",
                            "SecretName": "yyy"
                        }
                    ]

What should happen:

  • upon viewing the service with docker service inspect..., the custom secret filename should have been preserved.
@nohaapav nohaapav self-assigned this Oct 31, 2017
@nohaapav nohaapav added the kind/bug Something isn't working label Oct 31, 2017
@nohaapav nohaapav added this to the 1.3 milestone Oct 31, 2017
@nohaapav nohaapav added this to In Progress in 1.3 Oct 31, 2017
nohaapav added a commit that referenced this issue Nov 1, 2017
nohaapav added a commit that referenced this issue Nov 1, 2017
@nohaapav nohaapav moved this from In Progress to Done in 1.3 Nov 1, 2017
@nohaapav
Copy link
Member

nohaapav commented Nov 1, 2017

@mpsmith Thanks Matthew for reporting this bug. Should be fixed. Please fetch latest version.

@nohaapav nohaapav closed this as completed Nov 1, 2017
@ghost
Copy link
Author

ghost commented Nov 1, 2017

Tried it out. Works great! Thanks for the quick turn-around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
No open projects
1.3
Done
Development

No branches or pull requests

1 participant