diff --git a/test/framework/bootstrap/kind_util.go b/test/framework/bootstrap/kind_util.go index ceed622e9670..01b1d3841c1d 100644 --- a/test/framework/bootstrap/kind_util.go +++ b/test/framework/bootstrap/kind_util.go @@ -21,6 +21,7 @@ import ( "os" "path/filepath" + "github.com/blang/semver/v4" . "github.com/onsi/gomega" "github.com/pkg/errors" kindv1 "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" @@ -32,7 +33,6 @@ import ( "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/test/infrastructure/container" kindmapper "sigs.k8s.io/cluster-api/test/infrastructure/kind" - "sigs.k8s.io/cluster-api/util/version" ) // CreateKindBootstrapClusterAndLoadImagesInput is the input for CreateKindBootstrapClusterAndLoadImages. @@ -68,10 +68,11 @@ func CreateKindBootstrapClusterAndLoadImages(ctx context.Context, input CreateKi options := []KindClusterOption{} if input.KubernetesVersion != "" { - semVer, err := version.ParseMajorMinorPatchTolerant(input.KubernetesVersion) + semVer, err := semver.ParseTolerant(input.KubernetesVersion) if err != nil { Expect(err).ToNot(HaveOccurred(), "could not parse KubernetesVersion version") } + kindMapping := kindmapper.GetMapping(semVer, "") options = append(options, WithNodeImage(kindMapping.Image))