Skip to content
This repository was archived by the owner on Sep 24, 2021. It is now read-only.

Commit 0695a88

Browse files
authored
Merge pull request #70 from chuckha/versions
Be flexible with versions
2 parents aa11a01 + e93a5fe commit 0695a88

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmd/capdctl/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func makeManagementCluster(clusterName, capiVersion, capdImage, capiImageOverrid
265265
HostPath: "/var/run/docker.sock",
266266
},
267267
}
268-
cp, err := actions.CreateControlPlane(clusterName, "management-control-plane", lbipv4, "v1.14.2", cpMounts)
268+
cp, err := actions.CreateControlPlane(clusterName, fmt.Sprintf("%s-control-plane", clusterName), lbipv4, "v1.14.2", cpMounts)
269269
if err != nil {
270270
panic(err)
271271
}
@@ -293,6 +293,8 @@ func makeManagementCluster(clusterName, capiVersion, capdImage, capiImageOverrid
293293
cmd.SetStdout(os.Stdout)
294294
cmd.SetStderr(os.Stderr)
295295
if err := cmd.Run(); err != nil {
296+
out, _ := ioutil.ReadFile(f.Name())
297+
fmt.Println(out)
296298
panic(err)
297299
}
298300
}

kind/actions/kind.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"os"
2525
"path/filepath"
2626
"regexp"
27+
"strings"
2728

2829
"github.com/pkg/errors"
2930
"sigs.k8s.io/cluster-api-provider-docker/third_party/forked/loadbalancer"
@@ -291,6 +292,9 @@ func writeKubeConfig(n *nodes.Node, dest string, hostAddress string, hostPort in
291292
}
292293

293294
func image(version string) string {
295+
if !strings.HasPrefix(version, "v") {
296+
version = fmt.Sprintf("v%s", version)
297+
}
294298
// valid kindest node versions, but only > v1.14.0
295299
switch version {
296300
case "v1.14.1", "v1.14.2", "v1.14.3", "v1.15.0":

0 commit comments

Comments
 (0)