diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go index b4ac57bede..4aadfaf5c3 100644 --- a/daemon/cluster/executor/container/adapter.go +++ b/daemon/cluster/executor/container/adapter.go @@ -353,6 +353,8 @@ func (c *containerAdapter) checkMounts() error { if _, err := os.Stat(mount.Source); os.IsNotExist(err) { return fmt.Errorf("invalid bind mount source, source path not found: %s", mount.Source) } + default: + // TODO(thaJeztah): make switch exhaustive; add api.MountTypeVolume, api.MountTypeTmpfs, api.MountTypeNamedPipe, api.MountTypeCluster } } @@ -542,6 +544,8 @@ func (c *containerAdapter) logs(ctx context.Context, options api.LogSubscription apiOptions.ShowStdout = true case api.LogStreamStderr: apiOptions.ShowStderr = true + default: + // TODO(thaJeztah): make switch exhaustive; add api.LogStreamUnknown } } } diff --git a/daemon/cluster/executor/container/container.go b/daemon/cluster/executor/container/container.go index 6bbdec4ecc..c222ba59bf 100644 --- a/daemon/cluster/executor/container/container.go +++ b/daemon/cluster/executor/container/container.go @@ -722,6 +722,8 @@ func (c *containerConfig) applyPrivileges(hc *containertypes.HostConfig) { // Profile is bytes, but those bytes are actually a string. This is // basically verbatim what happens in the cli after a file is read. hc.SecurityOpt = append(hc.SecurityOpt, fmt.Sprintf("seccomp=%s", seccomp.Profile)) + default: + // TODO(thaJeztah): make switch exhaustive; add api.Privileges_SeccompOpts_DEFAULT } } diff --git a/daemon/cluster/executor/container/controller.go b/daemon/cluster/executor/container/controller.go index e620fd71e8..c84b1b87cd 100644 --- a/daemon/cluster/executor/container/controller.go +++ b/daemon/cluster/executor/container/controller.go @@ -281,6 +281,8 @@ func (r *controller) Start(ctx context.Context) error { return err } return nil + default: + // TODO(thaJeztah): make switch exhaustive } case <-ctx.Done(): return ctx.Err() @@ -467,6 +469,8 @@ func (r *controller) waitReady(pctx context.Context) error { switch ctnr.State.Status { case "running", "exited", "dead": return nil + default: + // TODO(thaJeztah): make switch exhaustive } } @@ -480,6 +484,8 @@ func (r *controller) waitReady(pctx context.Context) error { switch event.Action { case "start": return nil + default: + // TODO(thaJeztah): make switch exhaustive } case <-ctx.Done(): return ctx.Err() @@ -719,9 +725,7 @@ func (r *controller) checkHealth(ctx context.Context) error { if !r.matchevent(event) { continue } - - switch event.Action { - case events.ActionHealthStatusUnhealthy: + if event.Action == events.ActionHealthStatusUnhealthy { return ErrContainerUnhealthy } }