From 531b6aa6678821314e9529a703db7690de4f1d09 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Mon, 10 Jun 2024 11:00:36 +0200 Subject: [PATCH] Remvove usage of deprecated containerd docker package The right place for this is distribution/reference nowadays. Signed-off-by: Tom Wieczorek --- go.mod | 2 +- pkg/apis/k0s/v1beta1/images.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3870cb3d3de4..515425ca0a25 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/cloudflare/cfssl v1.6.4 github.com/containerd/cgroups/v3 v3.0.3 github.com/containerd/containerd v1.7.18 + github.com/distribution/reference v0.5.0 github.com/evanphx/json-patch v5.7.0+incompatible github.com/fsnotify/fsnotify v1.7.0 github.com/go-logr/logr v1.4.2 @@ -118,7 +119,6 @@ require ( github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/daviddengcn/go-colortext v1.0.0 // indirect - github.com/distribution/reference v0.5.0 // indirect github.com/docker/cli v25.0.1+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v25.0.5+incompatible // indirect diff --git a/pkg/apis/k0s/v1beta1/images.go b/pkg/apis/k0s/v1beta1/images.go index 9ab42d856473..4530ab15f2ba 100644 --- a/pkg/apis/k0s/v1beta1/images.go +++ b/pkg/apis/k0s/v1beta1/images.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/validation/field" - "github.com/containerd/containerd/reference/docker" + "github.com/distribution/reference" ) // ImageSpec container image settings @@ -48,7 +48,7 @@ func (s *ImageSpec) Validate(path *field.Path) (errs field.ErrorList) { errs = append(errs, field.Invalid(path.Child("image"), s.Image, "must not have leading or trailing whitespace")) } - versionRe := regexp.MustCompile(`^` + docker.TagRegexp.String() + `$`) + versionRe := regexp.MustCompile(`^` + reference.TagRegexp.String() + `$`) if !versionRe.MatchString(s.Version) { errs = append(errs, field.Invalid(path.Child("version"), s.Version, "must match regular expression: "+versionRe.String())) }