Skip to content

Commit

Permalink
allow pre versions for kind cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jul 22, 2024
1 parent 30878db commit f36777c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/framework/bootstrap/kind_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit f36777c

Please sign in to comment.