Skip to content
Permalink
Browse files

drop kind v1alpha2

  • Loading branch information...
BenTheElder committed Jun 25, 2019
1 parent e74ee54 commit c8bc82efc9ca66c602fbae36b1eacac941cdaf05
@@ -57,10 +57,6 @@ cd "${FAKE_REPOPATH}"
"${BINDIR}/deepcopy-gen" -i ./pkg/cluster/config/ -O zz_generated.deepcopy --go-header-file hack/boilerplate.go.txt
"${BINDIR}/defaulter-gen" -i ./pkg/cluster/config/ -O zz_generated.default --go-header-file hack/boilerplate.go.txt

"${BINDIR}/deepcopy-gen" -i ./pkg/cluster/config/v1alpha2 -O zz_generated.deepcopy --go-header-file hack/boilerplate.go.txt
"${BINDIR}/defaulter-gen" -i ./pkg/cluster/config/v1alpha2 -O zz_generated.default --go-header-file hack/boilerplate.go.txt
"${BINDIR}/conversion-gen" -i ./pkg/cluster/config/v1alpha2 -O zz_generated.conversion --go-header-file hack/boilerplate.go.txt

"${BINDIR}/deepcopy-gen" -i ./pkg/cluster/config/v1alpha3 -O zz_generated.deepcopy --go-header-file hack/boilerplate.go.txt
"${BINDIR}/defaulter-gen" -i ./pkg/cluster/config/v1alpha3 -O zz_generated.default --go-header-file hack/boilerplate.go.txt
"${BINDIR}/conversion-gen" -i ./pkg/cluster/config/v1alpha3 -O zz_generated.conversion --go-header-file hack/boilerplate.go.txt
@@ -27,7 +27,6 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

"sigs.k8s.io/kind/pkg/cluster/config"
"sigs.k8s.io/kind/pkg/cluster/config/v1alpha2"
"sigs.k8s.io/kind/pkg/cluster/config/v1alpha3"
)

@@ -45,7 +44,6 @@ func init() {
func AddToScheme(scheme *runtime.Scheme) {
utilruntime.Must(config.AddToScheme(scheme))
utilruntime.Must(v1alpha3.AddToScheme(scheme))
utilruntime.Must(v1alpha2.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1alpha3.SchemeGroupVersion))
}

@@ -22,34 +22,29 @@ import (

func TestLoadCurrent(t *testing.T) {
cases := []struct {
TestName string
Path string
ExpectReplicas []string
ExpectError bool
TestName string
Path string
ExpectError bool
}{
{
TestName: "no config",
Path: "",
ExpectReplicas: []string{"control-plane"}, // no config (empty config path) should return a single node cluster
ExpectError: false,
TestName: "no config",
Path: "",
ExpectError: false,
},
{
TestName: "v1alpha2 minimal",
Path: "./testdata/v1alpha2/valid-minimal.yaml",
ExpectReplicas: []string{"control-plane"},
ExpectError: false,
TestName: "v1alpha3 minimal",
Path: "./testdata/v1alpha3/valid-minimal.yaml",
ExpectError: false,
},
{
TestName: "v1alpha2 config with 2 nodes",
Path: "./testdata/v1alpha2/valid-minimal-two-nodes.yaml",
ExpectReplicas: []string{"control-plane", "worker"},
ExpectError: false,
TestName: "v1alpha3 config with 2 nodes",
Path: "./testdata/v1alpha3/valid-minimal-two-nodes.yaml",
ExpectError: false,
},
{
TestName: "v1alpha2 full HA",
Path: "./testdata/v1alpha2/valid-full-ha.yaml",
ExpectReplicas: []string{"etcd", "lb", "control-plane1", "control-plane2", "control-plane3", "worker1", "worker2"},
ExpectError: false,
TestName: "v1alpha3 full HA",
Path: "./testdata/v1alpha3/valid-full-ha.yaml",
ExpectError: false,
},
{
TestName: "invalid path",
@@ -85,10 +80,8 @@ func TestLoadCurrent(t *testing.T) {
return
}
// - not nil, in which case we should expect errors or fail
if err == nil {
if c.ExpectError {
t.Fatalf("unexpected lack or error while Loading config")
}
if c.ExpectError {
t.Fatalf("unexpected lack or error while Loading config")
}
})
}
@@ -1,3 +1,3 @@
# this file contains an invalid config kind for testing
kind: not-valid
apiVersion: kind.sigs.k8s.io/v1alpha2
apiVersion: kind.sigs.k8s.io/v1alpha3

This file was deleted.

This file was deleted.

@@ -0,0 +1,10 @@
# technically valid, config file with a full ha cluster
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: control-plane
- role: control-plane
- role: worker
- role: worker
- role: worker
@@ -1,6 +1,6 @@
# technically valid, minimal config file with two nodes
kind: Config
apiVersion: kind.sigs.k8s.io/v1alpha2
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
@@ -0,0 +1,3 @@
# technically valid, minimal config file
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit c8bc82e

Please sign in to comment.
You can’t perform that action at this time.