Skip to content

Commit

Permalink
try fix integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <[email protected]>
  • Loading branch information
vincepri committed Jun 24, 2019
1 parent e30d9b8 commit d62029f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 17 additions & 1 deletion scripts/ci-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,23 @@ prepare_crd_yaml() {
}

create_bootstrap() {
kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}"
cat <<EOF > /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

Expand Down
6 changes: 3 additions & 3 deletions test/integration/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit d62029f

Please sign in to comment.