Skip to content

Commit f36777c

Browse files
committed
allow pre versions for kind cluster
1 parent 30878db commit f36777c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/framework/bootstrap/kind_util.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"os"
2222
"path/filepath"
2323

24+
"github.com/blang/semver/v4"
2425
. "github.com/onsi/gomega"
2526
"github.com/pkg/errors"
2627
kindv1 "sigs.k8s.io/kind/pkg/apis/config/v1alpha4"
@@ -32,7 +33,6 @@ import (
3233
"sigs.k8s.io/cluster-api/test/framework/internal/log"
3334
"sigs.k8s.io/cluster-api/test/infrastructure/container"
3435
kindmapper "sigs.k8s.io/cluster-api/test/infrastructure/kind"
35-
"sigs.k8s.io/cluster-api/util/version"
3636
)
3737

3838
// CreateKindBootstrapClusterAndLoadImagesInput is the input for CreateKindBootstrapClusterAndLoadImages.
@@ -68,10 +68,11 @@ func CreateKindBootstrapClusterAndLoadImages(ctx context.Context, input CreateKi
6868

6969
options := []KindClusterOption{}
7070
if input.KubernetesVersion != "" {
71-
semVer, err := version.ParseMajorMinorPatchTolerant(input.KubernetesVersion)
71+
semVer, err := semver.ParseTolerant(input.KubernetesVersion)
7272
if err != nil {
7373
Expect(err).ToNot(HaveOccurred(), "could not parse KubernetesVersion version")
7474
}
75+
7576
kindMapping := kindmapper.GetMapping(semVer, "")
7677

7778
options = append(options, WithNodeImage(kindMapping.Image))

0 commit comments

Comments
 (0)