Skip to content

Commit

Permalink
Merge pull request #2897 from trapier/dump-snapshot-redacted-nil-deref
Browse files Browse the repository at this point in the history
Fix nil pointer deref in dump-snapshot --redacted [FIELD-2081]
  • Loading branch information
dperny committed Sep 20, 2019
2 parents a8bbe7d + a4e520a commit 8a69c0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/swarm-rafttool/dump.go
Expand Up @@ -200,15 +200,19 @@ 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"
if container.PullOptions != nil {
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"
if container.PullOptions != nil {
container.PullOptions.RegistryAuth = "REDACTED"
}
}
}
}
Expand Down

0 comments on commit 8a69c0d

Please sign in to comment.