@@ -21,9 +21,6 @@ package e2e
21
21
22
22
import (
23
23
"context"
24
- "fmt"
25
- "os"
26
- "strings"
27
24
28
25
. "github.com/onsi/ginkgo/v2"
29
26
. "github.com/onsi/gomega"
@@ -44,40 +41,14 @@ const (
44
41
45
42
// EnsureCNIAndCloudProviderAzureHelmChart installs the official cloud-provider-azure helm chart
46
43
// and a CNI and validates that expected pods exist and are Ready.
47
- func EnsureCNIAndCloudProviderAzureHelmChart (ctx context.Context , input clusterctl.ApplyCustomClusterTemplateAndWaitInput , installHelmChart bool , cidrBlocks [] string , hasWindows bool ) {
44
+ func EnsureCNIAndCloudProviderAzureHelmChart (ctx context.Context , input clusterctl.ApplyCustomClusterTemplateAndWaitInput , hasWindows bool ) {
48
45
specName := "ensure-cloud-provider-azure"
49
46
clusterProxy := input .ClusterProxy .GetWorkloadCluster (ctx , input .Namespace , input .ClusterName )
50
47
51
- if installHelmChart {
52
- By ("Installing cloud-provider-azure components via helm" )
53
- options := & HelmOptions {
54
- Values : []string {
55
- fmt .Sprintf ("infra.clusterName=%s" , input .ClusterName ),
56
- "cloudControllerManager.logVerbosity=4" ,
57
- },
58
- StringValues : []string {fmt .Sprintf ("cloudControllerManager.clusterCIDR=%s" , strings .Join (cidrBlocks , `\,` ))},
59
- }
60
- // If testing a CI version of Kubernetes, use CCM and CNM images built from source.
61
- if useCIArtifacts || usePRArtifacts {
62
- options .Values = append (options .Values , fmt .Sprintf ("cloudControllerManager.imageName=%s" , os .Getenv ("CCM_IMAGE_NAME" )))
63
- options .Values = append (options .Values , fmt .Sprintf ("cloudNodeManager.imageName=%s" , os .Getenv ("CNM_IMAGE_NAME" )))
64
- options .Values = append (options .Values , fmt .Sprintf ("cloudControllerManager.imageRepository=%s" , os .Getenv ("IMAGE_REGISTRY" )))
65
- options .Values = append (options .Values , fmt .Sprintf ("cloudNodeManager.imageRepository=%s" , os .Getenv ("IMAGE_REGISTRY" )))
66
- options .StringValues = append (options .StringValues , fmt .Sprintf ("cloudControllerManager.imageTag=%s" , os .Getenv ("IMAGE_TAG_CCM" )))
67
- options .StringValues = append (options .StringValues , fmt .Sprintf ("cloudNodeManager.imageTag=%s" , os .Getenv ("IMAGE_TAG_CNM" )))
68
- }
69
-
70
- if strings .Contains (input .ClusterName , "flatcar" ) {
71
- options .StringValues = append (options .StringValues , "cloudControllerManager.caCertDir=/usr/share/ca-certificates" )
72
- }
73
-
74
- InstallHelmChart (ctx , clusterProxy , defaultNamespace , cloudProviderAzureHelmRepoURL , cloudProviderAzureChartName , cloudProviderAzureHelmReleaseName , options , "" )
75
- } else {
76
- By ("Ensuring cloud-provider-azure is installed via CAAPH" )
77
- }
48
+ By ("Ensuring cloud-provider-azure is installed via CAAPH" )
78
49
79
50
// We do this before waiting for the pods to be ready because there is a co-dependency between CNI (nodes ready) and cloud-provider being initialized.
80
- EnsureCNI (ctx , input , installHelmChart , cidrBlocks , hasWindows )
51
+ EnsureCNI (ctx , input , hasWindows )
81
52
82
53
By ("Waiting for Ready cloud-controller-manager deployment pods" )
83
54
for _ , d := range []string {"cloud-controller-manager" } {
@@ -87,40 +58,28 @@ func EnsureCNIAndCloudProviderAzureHelmChart(ctx context.Context, input clusterc
87
58
}
88
59
89
60
// EnsureAzureDiskCSIDriverHelmChart installs the official azure-disk CSI driver helm chart
90
- func EnsureAzureDiskCSIDriverHelmChart (ctx context.Context , input clusterctl.ApplyCustomClusterTemplateAndWaitInput , installHelmChart bool , hasWindows bool ) {
61
+ func EnsureAzureDiskCSIDriverHelmChart (ctx context.Context , input clusterctl.ApplyCustomClusterTemplateAndWaitInput ) {
91
62
specName := "ensure-azuredisk-csi-drivers"
92
63
clusterProxy := input .ClusterProxy .GetWorkloadCluster (ctx , input .Namespace , input .ClusterName )
93
64
mgmtClient := input .ClusterProxy .GetClient ()
94
65
95
- if installHelmChart {
96
- By ("Installing azure-disk CSI driver components via helm" )
97
- options := & HelmOptions {
98
- Values : []string {"controller.replicas=1" , "controller.runOnControlPlane=true" },
99
- }
100
- // TODO: make this always true once HostProcessContainers are on for all supported k8s versions.
101
- if hasWindows {
102
- options .Values = append (options .Values , "windows.useHostProcessContainers=true" )
103
- }
104
- InstallHelmChart (ctx , clusterProxy , kubesystem , azureDiskCSIDriverHelmRepoURL , azureDiskCSIDriverChartName , azureDiskCSIDriverHelmReleaseName , options , "" )
105
- } else {
106
- By ("Ensuring azure-disk CSI driver is installed via CAAPH" )
107
- cluster := & clusterv1.Cluster {}
108
- Eventually (func (g Gomega ) {
109
- g .Expect (mgmtClient .Get (ctx , types.NamespacedName {
110
- Namespace : input .Namespace ,
111
- Name : input .ClusterName ,
112
- }, cluster )).To (Succeed ())
113
- // Label the cluster so that CAAPH installs the azuredisk-csi helm chart via existing HelmChartProxy resource
114
- if cluster .Labels != nil {
115
- cluster .Labels [azureDiskCSIDriverCAAPHLabelName ] = "true"
116
- } else {
117
- cluster .Labels = map [string ]string {
118
- azureDiskCSIDriverCAAPHLabelName : "true" ,
119
- }
66
+ By ("Ensuring azure-disk CSI driver is installed via CAAPH" )
67
+ cluster := & clusterv1.Cluster {}
68
+ Eventually (func (g Gomega ) {
69
+ g .Expect (mgmtClient .Get (ctx , types.NamespacedName {
70
+ Namespace : input .Namespace ,
71
+ Name : input .ClusterName ,
72
+ }, cluster )).To (Succeed ())
73
+ // Label the cluster so that CAAPH installs the azuredisk-csi helm chart via existing HelmChartProxy resource
74
+ if cluster .Labels != nil {
75
+ cluster .Labels [azureDiskCSIDriverCAAPHLabelName ] = "true"
76
+ } else {
77
+ cluster .Labels = map [string ]string {
78
+ azureDiskCSIDriverCAAPHLabelName : "true" ,
120
79
}
121
- g . Expect ( mgmtClient . Update ( ctx , cluster )). To ( Succeed ())
122
- }, e2eConfig . GetIntervals ( specName , "wait-deployment" ) ... ). Should (Succeed ())
123
- }
80
+ }
81
+ g . Expect ( mgmtClient . Update ( ctx , cluster )). To (Succeed ())
82
+ }, e2eConfig . GetIntervals ( specName , "wait-deployment" ) ... ). Should ( Succeed ())
124
83
125
84
By ("Waiting for Ready csi-azuredisk-controller deployment pods" )
126
85
for _ , d := range []string {"csi-azuredisk-controller" } {
0 commit comments