Skip to content

Commit 9d6e3ed

Browse files
committed
feat: Added e2e test for capx cluster
We need to set following vars in either env or caren.yaml NUTANIX_ENDPOINT: x.x.x.x NUTANIX_USER: admin NUTANIX_PASSWORD: “” NUTANIX_INSECURE: true NUTANIX_PORT: 9440 CONTROL_PLANE_ENDPOINT_IP: x.x.x.x CONTROL_PLANE_ENDPOINT_PORT: 6443 NUTANIX_PRISM_ELEMENT_CLUSTER_NAME: "" NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME: "" NUTANIX_SUBNET_NAME: "" DOCKER_HUB_USERNAME: “” NUTANIX_PRISM_ELEMENT_ENDPOINT: x.x.x.x NUTANIX_STORAGE_CONTAINER_NAME: “”
1 parent 86b23e7 commit 9d6e3ed

File tree

4 files changed

+93
-6
lines changed

4 files changed

+93
-6
lines changed

test/e2e/config/caren.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@ providers:
9393
- old: --metrics-addr=127.0.0.1:8080
9494
new: --metrics-addr=:8080
9595

96+
- name: nutanix
97+
type: InfrastructureProvider
98+
versions:
99+
- name: "${CAPX_VERSION}"
100+
value: "https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/${CAPX_VERSION}/infrastructure-components.yaml"
101+
type: "url"
102+
contract: v1beta1
103+
files:
104+
- sourcePath: "../data/shared/v1beta1-capx/metadata.yaml"
105+
- sourcePath: "../../../charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/nutanix-cluster-class.yaml"
106+
targetName: clusterclass-nutanix-quick-start.yaml
107+
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml"
108+
targetName: cluster-template-topology-cilium-helm-addon.yaml
109+
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml"
110+
targetName: cluster-template-topology-cilium-crs.yaml
111+
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml"
112+
targetName: cluster-template-topology-calico-helm-addon.yaml
113+
- sourcePath: "../../../examples/capi-quick-start/nutanix-cluster-calico-crs.yaml"
114+
targetName: cluster-template-topology-calico-crs.yaml
115+
replacements:
116+
- old: --metrics-addr=127.0.0.1:8080
117+
new: --metrics-addr=:8080
118+
96119
- name: helm
97120
type: AddonProvider
98121
versions:
@@ -156,6 +179,19 @@ variables:
156179
AMI_LOOKUP_FORMAT: "konvoy-ami-{{.BaseOS}}-release-?{{.K8sVersion}}-*"
157180
AMI_LOOKUP_BASEOS: "rocky-9.1"
158181
AMI_LOOKUP_ORG: "999867407951"
182+
NUTANIX_ENDPOINT: ""
183+
NUTANIX_USER: ""
184+
NUTANIX_PASSWORD: ""
185+
NUTANIX_INSECURE: false
186+
NUTANIX_PORT: 9440
187+
CONTROL_PLANE_ENDPOINT_IP: ""
188+
CONTROL_PLANE_ENDPOINT_PORT: 6443
189+
NUTANIX_PRISM_ELEMENT_CLUSTER_NAME: ""
190+
NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME: ""
191+
NUTANIX_SUBNET_NAME: ""
192+
DOCKER_HUB_USERNAME: ""
193+
NUTANIX_PRISM_ELEMENT_ENDPOINT: ""
194+
NUTANIX_STORAGE_CONTAINER_NAME: ""
159195

160196
intervals:
161197
default/wait-controllers: ["3m", "10s"]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2024 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# maps release series of major.minor to cluster-api contract version
5+
# the contract version may change between minor or major versions, but *not*
6+
# between patch versions.
7+
#
8+
# TODO(release-blocker): update this file only when a new major or minor version is released
9+
10+
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
11+
kind: Metadata
12+
releaseSeries:
13+
- major: 0
14+
minor: 1
15+
contract: v1alpha4
16+
- major: 0
17+
minor: 2
18+
contract: v1beta1
19+
- major: 0
20+
minor: 3
21+
contract: v1beta1
22+
- major: 0
23+
minor: 4
24+
contract: v1beta1
25+
- major: 0
26+
minor: 5
27+
contract: v1beta1
28+
- major: 1
29+
minor: 0
30+
contract: v1beta1
31+
- major: 1
32+
minor: 1
33+
contract: v1beta1
34+
- major: 1
35+
minor: 2
36+
contract: v1beta1
37+
- major: 1
38+
minor: 3
39+
contract: v1beta1
40+
- major: 1
41+
minor: 4
42+
contract: v1beta1
43+
- major: 0
44+
minor: 0
45+
contract: v1beta1

test/e2e/e2e_suite_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,17 @@ func initBootstrapCluster(
258258
clusterctl.InitManagementClusterAndWatchControllerLogs(
259259
context.TODO(),
260260
clusterctl.InitManagementClusterAndWatchControllerLogsInput{
261-
ClusterProxy: bootstrapClusterProxy,
262-
ClusterctlConfigPath: clusterctlConfig,
263-
InfrastructureProviders: config.GetProviderLatestVersionsByContract("*", config.InfrastructureProviders()...),
264-
AddonProviders: config.GetProviderLatestVersionsByContract("*", config.AddonProviders()...),
265-
RuntimeExtensionProviders: config.GetProviderLatestVersionsByContract("*", config.RuntimeExtensionProviders()...),
261+
ClusterProxy: bootstrapClusterProxy,
262+
ClusterctlConfigPath: clusterctlConfig,
263+
InfrastructureProviders: config.GetProviderLatestVersionsByContract(
264+
"*",
265+
config.InfrastructureProviders()...),
266+
AddonProviders: config.GetProviderLatestVersionsByContract(
267+
"*",
268+
config.AddonProviders()...),
269+
RuntimeExtensionProviders: config.GetProviderLatestVersionsByContract(
270+
"*",
271+
config.RuntimeExtensionProviders()...),
266272
LogFolder: filepath.Join(
267273
artifactFolder,
268274
"clusters",

test/e2e/quick_start_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
)
2323

2424
var _ = Describe("Quick start", Serial, func() {
25-
for _, provider := range []string{"Docker", "AWS"} {
25+
for _, provider := range []string{"Docker", "AWS", "Nutanix"} {
2626
lowercaseProvider := strings.ToLower(provider)
2727
for _, cniProvider := range []string{"Cilium", "Calico"} {
2828
for _, addonStrategy := range []string{"HelmAddon", "ClusterResourceSet"} {

0 commit comments

Comments
 (0)