From d62029f0577194f93f61a22470cc7b6beee3fc04 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Mon, 24 Jun 2019 16:10:38 -0700 Subject: [PATCH] try fix integration tests Signed-off-by: Vince Prignano --- scripts/ci-integration.sh | 18 +++++++++++++++++- test/integration/cluster/cluster_test.go | 6 +++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/ci-integration.sh b/scripts/ci-integration.sh index 2df3730cc451..8abdefd7a718 100755 --- a/scripts/ci-integration.sh +++ b/scripts/ci-integration.sh @@ -66,7 +66,23 @@ prepare_crd_yaml() { } create_bootstrap() { - kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}" + cat < /tmp/integration.cluster +# this config file contains all config fields with comments +kind: Cluster +apiVersion: kind.sigs.k8s.io/v1alpha3 +# patch the generated kubeadm config with some extra settings +kubeadmConfigPatches: +- | + apiVersion: kubeadm.k8s.io/v1beta1 + kind: ClusterConfiguration + metadata: + name: config + apiServer: + extraArgs: + "feature-gates": "FeatureGateName=true" +EOF + + kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}" --config /tmp/integration.cluster KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")" export KUBECONFIG diff --git a/test/integration/cluster/cluster_test.go b/test/integration/cluster/cluster_test.go index bd8e1c99b2c5..2a43cfa8fe55 100644 --- a/test/integration/cluster/cluster_test.go +++ b/test/integration/cluster/cluster_test.go @@ -30,11 +30,11 @@ import ( "k8s.io/client-go/tools/clientcmd" clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2" ) var clusterSpec = &clusterv1alpha1.ClusterSpec{ - ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{ + ClusterNetwork: &clusterv1alpha1.ClusterNetworkingConfig{ ServiceDomain: "mydomain.com", Services: clusterv1alpha1.NetworkRanges{ CIDRBlocks: []string{"10.96.0.0/12"}, @@ -84,7 +84,7 @@ var _ = Describe("Cluster-Controller", func() { // Create clusterapi client cs, err := clientset.NewForConfig(config) Expect(err).ShouldNot(HaveOccurred()) - clusterapi = cs.ClusterV1alpha1().Clusters(testNamespace) + clusterapi = cs.ClusterV1alpha2().Clusters(testNamespace) }) AfterEach(func() {