Skip to content

Commit 631f07c

Browse files
committed
try fix integration tests
Signed-off-by: Vince Prignano <[email protected]>
1 parent e30d9b8 commit 631f07c

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

hack/ensure-go.sh

+1
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ verify_go_version
4646

4747
# Explicitly opt into go modules, even though we're inside a GOPATH directory
4848
export GO111MODULE=on
49+
export GOFLAGS="-mod=vendor"

scripts/ci-integration.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,23 @@ prepare_crd_yaml() {
6666
}
6767

6868
create_bootstrap() {
69-
kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}"
69+
cat <<EOF > /tmp/integration.cluster
70+
# this config file contains all config fields with comments
71+
kind: Cluster
72+
apiVersion: kind.sigs.k8s.io/v1alpha3
73+
# patch the generated kubeadm config with some extra settings
74+
kubeadmConfigPatches:
75+
- |
76+
apiVersion: kubeadm.k8s.io/v1beta1
77+
kind: ClusterConfiguration
78+
metadata:
79+
name: config
80+
apiServer:
81+
extraArgs:
82+
"feature-gates": "CustomResourceWebhookConversion=true"
83+
EOF
84+
85+
kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}" --config /tmp/integration.cluster
7086
KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")"
7187
export KUBECONFIG
7288

test/integration/cluster/cluster_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ import (
3030
"k8s.io/client-go/tools/clientcmd"
3131
clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2"
3232
clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset"
33-
client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1"
33+
client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2"
3434
)
3535

3636
var clusterSpec = &clusterv1alpha1.ClusterSpec{
37-
ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{
37+
ClusterNetwork: &clusterv1alpha1.ClusterNetworkingConfig{
3838
ServiceDomain: "mydomain.com",
3939
Services: clusterv1alpha1.NetworkRanges{
4040
CIDRBlocks: []string{"10.96.0.0/12"},
@@ -84,7 +84,7 @@ var _ = Describe("Cluster-Controller", func() {
8484
// Create clusterapi client
8585
cs, err := clientset.NewForConfig(config)
8686
Expect(err).ShouldNot(HaveOccurred())
87-
clusterapi = cs.ClusterV1alpha1().Clusters(testNamespace)
87+
clusterapi = cs.ClusterV1alpha2().Clusters(testNamespace)
8888
})
8989

9090
AfterEach(func() {

0 commit comments

Comments
 (0)