diff --git a/cmd/swarm-rafttool/dump.go b/cmd/swarm-rafttool/dump.go index 6360194d67..481a0ba6c4 100644 --- a/cmd/swarm-rafttool/dump.go +++ b/cmd/swarm-rafttool/dump.go @@ -200,7 +200,9 @@ 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" + } } } } @@ -208,7 +210,9 @@ func dumpSnapshot(swarmdir, unlockKey string, redact bool) error { 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" + } } } }