From ab8db1040841dc3fc643ff468d1b9796565256d6 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Fri, 1 Sep 2023 11:14:23 +0200 Subject: [PATCH] linters: enable whitespace Not changing the world but useful hygiene. Signed-off-by: Valentin Rothberg --- common/.golangci.yml | 1 - common/libimage/filters.go | 1 - common/libimage/pull.go | 2 -- common/pkg/cgroups/blkio_linux.go | 1 - common/pkg/cgroups/systemd_linux.go | 1 - common/pkg/configmaps/configmaps.go | 1 - common/pkg/retry/retry.go | 1 - common/pkg/secrets/shelldriver/shelldriver.go | 1 - common/pkg/subscriptions/subscriptions.go | 1 - 9 files changed, 10 deletions(-) diff --git a/common/.golangci.yml b/common/.golangci.yml index 579bb613ad..7137343b4f 100644 --- a/common/.golangci.yml +++ b/common/.golangci.yml @@ -36,7 +36,6 @@ linters: - misspell - nestif - unconvert - - whitespace - wsl - contextcheck - cyclop diff --git a/common/libimage/filters.go b/common/libimage/filters.go index 0c97fe5b7f..648c8a5081 100644 --- a/common/libimage/filters.go +++ b/common/libimage/filters.go @@ -110,7 +110,6 @@ func (r *Runtime) compileImageFilters(ctx context.Context, options *ListImagesOp key = split[0] value = split[1] switch key { - case "after", "since": img, err := r.time(key, value) if err != nil { diff --git a/common/libimage/pull.go b/common/libimage/pull.go index bdf172d17b..579eae2c0b 100644 --- a/common/libimage/pull.go +++ b/common/libimage/pull.go @@ -138,7 +138,6 @@ func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullP // Dispatch the copy operation. switch ref.Transport().Name() { - // DOCKER REGISTRY case registryTransport.Transport.Name(): pulledImages, pullError = r.copyFromRegistry(ctx, ref, possiblyUnqualifiedName, pullPolicy, options) @@ -218,7 +217,6 @@ func (r *Runtime) copyFromDefault(ctx context.Context, ref types.ImageReference, // Figure out a name for the storage destination. var storageName, imageName string switch ref.Transport().Name() { - case dockerDaemonTransport.Transport.Name(): // Normalize to docker.io if needed (see containers/podman/issues/10998). named, err := reference.ParseNormalizedNamed(ref.StringWithinTransport()) diff --git a/common/pkg/cgroups/blkio_linux.go b/common/pkg/cgroups/blkio_linux.go index ced461e693..dd18ed5658 100644 --- a/common/pkg/cgroups/blkio_linux.go +++ b/common/pkg/cgroups/blkio_linux.go @@ -34,7 +34,6 @@ func (c *linuxBlkioHandler) Apply(ctr *CgroupControl, res *configs.Resources) er return err } return man.Set(res) - } path := filepath.Join(cgroupRoot, Blkio, ctr.config.Path) return c.Blkio.Set(path, res) diff --git a/common/pkg/cgroups/systemd_linux.go b/common/pkg/cgroups/systemd_linux.go index e8107604de..843042b654 100644 --- a/common/pkg/cgroups/systemd_linux.go +++ b/common/pkg/cgroups/systemd_linux.go @@ -250,7 +250,6 @@ func resourcesToProps(res *configs.Resources, v2 bool) (map[string]uint64, map[s } else { structMap["BlockIODeviceWeight"] = append(structMap["BlockIODeviceWeight"], newWeight) } - } } diff --git a/common/pkg/configmaps/configmaps.go b/common/pkg/configmaps/configmaps.go index 9377103083..4632c0d054 100644 --- a/common/pkg/configmaps/configmaps.go +++ b/common/pkg/configmaps/configmaps.go @@ -270,7 +270,6 @@ func validateConfigMapName(name string) error { strings.HasSuffix(name, "-") || strings.HasSuffix(name, ".") || strings.HasSuffix(name, "_") { - return fmt.Errorf("only 253 [a-zA-Z0-9-_.] characters allowed, and the start and end character must be [a-zA-Z0-9]: %s: %w", name, errInvalidConfigMapName) } return nil diff --git a/common/pkg/retry/retry.go b/common/pkg/retry/retry.go index 5cf311b436..d47e47e101 100644 --- a/common/pkg/retry/retry.go +++ b/common/pkg/retry/retry.go @@ -74,7 +74,6 @@ func IsErrorRetryable(err error) bool { } switch e := err.(type) { - case errcode.Error: switch e.Code { case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeDenied, diff --git a/common/pkg/secrets/shelldriver/shelldriver.go b/common/pkg/secrets/shelldriver/shelldriver.go index 87dc317a98..c903ca7491 100644 --- a/common/pkg/secrets/shelldriver/shelldriver.go +++ b/common/pkg/secrets/shelldriver/shelldriver.go @@ -58,7 +58,6 @@ func (cfg *driverConfig) ParseOpts(opts map[string]string) error { cfg.ListCommand == "" || cfg.LookupCommand == "" || cfg.StoreCommand == "" { - return errMissingConfig } return nil diff --git a/common/pkg/subscriptions/subscriptions.go b/common/pkg/subscriptions/subscriptions.go index b751f48772..a2924737ec 100644 --- a/common/pkg/subscriptions/subscriptions.go +++ b/common/pkg/subscriptions/subscriptions.go @@ -242,7 +242,6 @@ func addSubscriptionsFromMountsFile(filePath, mountLabel, containerRunDir string // In the event of a restart, don't want to copy subscriptions over again as they already would exist in ctrDirOrFileOnHost _, err = os.Stat(ctrDirOrFileOnHost) if errors.Is(err, os.ErrNotExist) { - hostDirOrFile, err = resolveSymbolicLink(hostDirOrFile) if err != nil { return nil, err