diff --git a/pkg/cluster/config/encoding/testdata/invalid-apiversion.yaml b/pkg/cluster/config/encoding/testdata/invalid-apiversion.yaml index 9f08271ed8..22771e0ae4 100644 --- a/pkg/cluster/config/encoding/testdata/invalid-apiversion.yaml +++ b/pkg/cluster/config/encoding/testdata/invalid-apiversion.yaml @@ -1,3 +1,3 @@ -# this file contains an invalid config api version for testing -kind: Config -apiVersion: not-valid +# this file contains an invalid config kind for testing +kind: not-valid +apiVersion: kind.sigs.k8s.io/v1alpha2 diff --git a/pkg/cluster/config/encoding/testdata/invalid-kind.yaml b/pkg/cluster/config/encoding/testdata/invalid-kind.yaml new file mode 100644 index 0000000000..b5f797a633 --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/invalid-kind.yaml @@ -0,0 +1,3 @@ +# this file contains an invalid config api version for testing +kind: Node +apiVersion: not-valid diff --git a/pkg/cluster/config/encoding/testdata/invalid-no-apiversion.yaml b/pkg/cluster/config/encoding/testdata/invalid-no-apiversion.yaml new file mode 100644 index 0000000000..a5ffac0cc8 --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/invalid-no-apiversion.yaml @@ -0,0 +1,2 @@ +# this file contains an invalid config without apiVersion for testing +kind: Node diff --git a/pkg/cluster/config/encoding/testdata/invalid-no-kind.yaml b/pkg/cluster/config/encoding/testdata/invalid-no-kind.yaml new file mode 100644 index 0000000000..eafbaab066 --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/invalid-no-kind.yaml @@ -0,0 +1,2 @@ +# this file contains an invalid config without kind for testing +apiVersion: kind.sigs.k8s.io/v1alpha2 diff --git a/pkg/cluster/config/encoding/testdata/v1alpha1/invalid-minimal-two-nodes.yaml b/pkg/cluster/config/encoding/testdata/v1alpha1/invalid-minimal-two-nodes.yaml new file mode 100644 index 0000000000..21ec42116b --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/v1alpha1/invalid-minimal-two-nodes.yaml @@ -0,0 +1,6 @@ +# invalid v1alpha1 config file with two documents +kind: Config +apiVersion: kind.sigs.k8s.io/v1alpha1 +--- +kind: Config +apiVersion: kind.sigs.k8s.io/v1alpha1 \ No newline at end of file diff --git a/pkg/cluster/config/encoding/testdata/v1alpha2/invalid-minimal-duplicated-names.yaml b/pkg/cluster/config/encoding/testdata/v1alpha2/invalid-minimal-duplicated-names.yaml new file mode 100644 index 0000000000..ee22fff54e --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/v1alpha2/invalid-minimal-duplicated-names.yaml @@ -0,0 +1,6 @@ +# invalid config file with nodes with the same name +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +--- +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 \ No newline at end of file diff --git a/pkg/cluster/config/encoding/testdata/v1alpha2/valid-full-ha.yaml b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-full-ha.yaml new file mode 100644 index 0000000000..7b04c7cad9 --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-full-ha.yaml @@ -0,0 +1,18 @@ +# technically valid, config file with a full ha cluster +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +role: control-plane +replicas: 3 +--- +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +role: worker +replicas: 2 +--- +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +role: external-etcd +--- +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +role: external-load-balancer diff --git a/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal-two-nodes.yaml b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal-two-nodes.yaml new file mode 100644 index 0000000000..1404d6d8b6 --- /dev/null +++ b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal-two-nodes.yaml @@ -0,0 +1,7 @@ +# technically valid, minimal config file with two nodes +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +--- +kind: Node +apiVersion: kind.sigs.k8s.io/v1alpha2 +role: worker \ No newline at end of file diff --git a/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal.yaml b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal.yaml index bffca0fd7d..f960aa0653 100644 --- a/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal.yaml +++ b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-minimal.yaml @@ -1,3 +1,3 @@ # technically valid, minimal config file -kind: Config +kind: Node apiVersion: kind.sigs.k8s.io/v1alpha2 diff --git a/pkg/cluster/config/encoding/testdata/v1alpha2/valid-with-lifecyclehooks.yaml b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-with-lifecyclehooks.yaml index 5b1521ddbf..29ad5ae50d 100644 --- a/pkg/cluster/config/encoding/testdata/v1alpha2/valid-with-lifecyclehooks.yaml +++ b/pkg/cluster/config/encoding/testdata/v1alpha2/valid-with-lifecyclehooks.yaml @@ -1,4 +1,4 @@ -kind: Config +kind: Node apiVersion: kind.sigs.k8s.io/v1alpha2 nodeLifecycle: preKubeadm: