Skip to content

Commit

Permalink
Refactor ensure azuredisk csi function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Oct 9, 2023
1 parent e63dde0 commit 4e28ee5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 8 additions & 12 deletions test/e2e/cloud-provider-azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,15 @@ func InstallCNIAndCloudProviderAzureHelmChart(ctx context.Context, input cluster
}
}

// InstallAzureDiskCSIDriverHelmChart installs the official azure-disk CSI driver helm chart
func InstallAzureDiskCSIDriverHelmChart(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, hasWindows bool) {
specName := "azuredisk-csi-drivers-install"
By("Installing azure-disk CSI driver components via helm")
options := &HelmOptions{
Values: []string{"controller.replicas=1", "controller.runOnControlPlane=true"},
}
// TODO: make this always true once HostProcessContainers are on for all supported k8s versions.
if hasWindows {
options.Values = append(options.Values, "windows.useHostProcessContainers=true")
}
// EnsureAzureDiskCSIDriverHelmChart installs the official azure-disk CSI driver helm chart
func EnsureAzureDiskCSIDriverHelmChart(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput) {
specName := "ensure-azuredisk-csi-drivers"
By("Ensuring azure-disk CSI driver is installed via CAAPH")
// // TODO: make this always true once HostProcessContainers are on for all supported k8s versions.
// if hasWindows {
// options.Values = append(options.Values, "windows.useHostProcessContainers=true")
// }
clusterProxy := input.ClusterProxy.GetWorkloadCluster(ctx, input.Namespace, input.ClusterName)
InstallHelmChart(ctx, clusterProxy, kubesystem, azureDiskCSIDriverHelmRepoURL, azureDiskCSIDriverChartName, azureDiskCSIDriverHelmReleaseName, options, "")
By("Waiting for Ready csi-azuredisk-controller deployment pods")
for _, d := range []string{"csi-azuredisk-controller"} {
waitInput := GetWaitForDeploymentsAvailableInput(ctx, clusterProxy, d, kubesystem, specName)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func ensureControlPlaneInitialized(ctx context.Context, input clusterctl.ApplyCu
EnsureCNI(ctx, input, installHelmCharts, cluster.Spec.ClusterNetwork.Pods.CIDRBlocks, hasWindows)
}
controlPlane := discoveryAndWaitForControlPlaneInitialized(ctx, input, result)
InstallAzureDiskCSIDriverHelmChart(ctx, input, hasWindows)
EnsureAzureDiskCSIDriverHelmChart(ctx, input)
result.ControlPlane = controlPlane
}

Expand Down

0 comments on commit 4e28ee5

Please sign in to comment.