Skip to content

Commit

Permalink
chore: changes as a result of testing
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Case <[email protected]>
  • Loading branch information
richardcase authored and furkatgofurov7 committed Jan 3, 2024
1 parent 7dfdce4 commit 6ccc828
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
4 changes: 2 additions & 2 deletions test/e2e/data/capi-operator/capv-variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: default
type: Opaque
stringData:
VSPHERE_USERNAME: <insert-vsphere-username>
VSPHERE_PASSWORD: <insert-vsphere-password>
VSPHERE_USERNAME: "${VSPHERE_USERNAME}"
VSPHERE_PASSWORD: "${VSPHERE_PASSWORD}"
CLUSTER_TOPOLOGY: "true"
EXP_CLUSTER_RESOURCE_SET: "true"
28 changes: 17 additions & 11 deletions test/e2e/specs/import_gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ type CreateUsingGitOpsSpecInput struct {
ArtifactFolder string
RancherServerURL string

ClusterctlBinaryPath string
ClusterTemplate []byte
ClusterName string
ClusterctlBinaryPath string
ClusterTemplate []byte
ClusterName string
AdditionalTemplateVariables map[string]string

CAPIClusterCreateWaitName string
DeleteClusterWaitName string
Expand Down Expand Up @@ -160,16 +161,21 @@ func CreateUsingGitOpsSpec(ctx context.Context, inputGetter func() CreateUsingGi
clustersDir := filepath.Join(repoDir, "clusters")
os.MkdirAll(clustersDir, os.ModePerm)

additionalVars := map[string]string{
"CLUSTER_NAME": input.ClusterName,
"WORKER_MACHINE_COUNT": strconv.Itoa(workerMachineCount),
"CONTROL_PLANE_MACHINE_COUNT": strconv.Itoa(controlPlaneMachineCount),
}
for k, v := range input.AdditionalTemplateVariables {
additionalVars[k] = v
}

clusterPath := filepath.Join(clustersDir, fmt.Sprintf("%s.yaml", input.ClusterName))
Expect(turtlesframework.ApplyFromTemplate(ctx, turtlesframework.ApplyFromTemplateInput{
Getter: input.E2EConfig.GetVariable,
Template: input.ClusterTemplate,
OutputFilePath: clusterPath,
AddtionalEnvironmentVariables: map[string]string{
"CLUSTER_NAME": input.ClusterName,
"WORKER_MACHINE_COUNT": strconv.Itoa(workerMachineCount),
"CONTROL_PLANE_MACHINE_COUNT": strconv.Itoa(controlPlaneMachineCount),
},
Getter: input.E2EConfig.GetVariable,
Template: input.ClusterTemplate,
OutputFilePath: clusterPath,
AddtionalEnvironmentVariables: additionalVars,
})).To(Succeed())

fleetPath := filepath.Join(clustersDir, "fleet.yaml")
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/suites/import-gitops/import_gitops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ var _ = Describe("[vSphere] [Kubeadm] Create and delete CAPI cluster functionali
ClusterctlBinaryPath: flagVals.ClusterctlBinaryPath,
ArtifactFolder: flagVals.ArtifactFolder,
ClusterTemplate: e2e.CAPIvSphereKubeadm,
ClusterName: "cluster-vSphere-kubeadm",
ClusterName: "cluster-vsphere-kubeadm",
ControlPlaneMachineCount: ptr.To[int](1),
WorkerMachineCount: ptr.To[int](1),
GitAddr: giteaResult.GitAddress,
Expand All @@ -147,6 +147,10 @@ var _ = Describe("[vSphere] [Kubeadm] Create and delete CAPI cluster functionali
RancherServerURL: hostName,
CAPIClusterCreateWaitName: "wait-capv-create-cluster",
DeleteClusterWaitName: "wait-vSphere-delete",
AdditionalTemplateVariables: map[string]string{
"NAMESPACE": "default",
"VIP_NETWORK_INTERFACE": "",
},
}
})
})

0 comments on commit 6ccc828

Please sign in to comment.