Skip to content

Commit

Permalink
Merge pull request moby#2501 from dperny/redact-registry-auth
Browse files Browse the repository at this point in the history
Redact registry auth token from swarm-rafttool
  • Loading branch information
anshulpundir authored Feb 12, 2018
2 parents 1a0c0d5 + 8fbde78 commit 2543c41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/swarm-rafttool/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,16 @@ func dumpWAL(swarmdir, unlockKey string, start, end uint64, redact bool) error {
case *api.StoreAction_Task:
if container := actype.Task.Spec.GetContainer(); container != nil {
container.Env = []string{"ENVVARS REDACTED"}
if container.PullOptions != nil {
container.PullOptions.RegistryAuth = "REDACTED"
}
}
case *api.StoreAction_Service:
if container := actype.Service.Spec.Task.GetContainer(); container != nil {
container.Env = []string{"ENVVARS REDACTED"}
if container.PullOptions != nil {
container.PullOptions.RegistryAuth = "REDACTED"
}
}
}
}
Expand Down Expand Up @@ -192,13 +198,15 @@ func dumpSnapshot(swarmdir, unlockKey string, redact bool) error {
if task != nil {
if container := task.Spec.GetContainer(); container != nil {
container.Env = []string{"ENVVARS REDACTED"}
container.PullOptions.RegistryAuth = "REDACTED"
}
}
}
for _, service := range s.Store.Services {
if service != nil {
if container := service.Spec.Task.GetContainer(); container != nil {
container.Env = []string{"ENVVARS REDACTED"}
container.PullOptions.RegistryAuth = "REDACTED"
}
}
}
Expand Down

0 comments on commit 2543c41

Please sign in to comment.