Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label Cluster for azuredisk-csi HelmChartProxy at E2E runtime #4334

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions templates/test/ci/cluster-template-prow-azure-cni-v1.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-ci-version.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-custom-vnet.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-dual-stack.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-edgezone.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-flatcar.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-ipv6.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-machine-pool.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-nvidia-gpu.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-private.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow-topology.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/ci/cluster-template-prow.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

1 change: 0 additions & 1 deletion templates/test/ci/prow-azure-cni-v1/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ resources:
patchesStrategicMerge:
- ../patches/tags.yaml
- ../patches/controller-manager.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
1 change: 0 additions & 1 deletion templates/test/ci/prow-custom-vnet/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ patchesStrategicMerge:
- ../patches/uami-md-0.yaml
- ../patches/uami-control-plane.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
1 change: 0 additions & 1 deletion templates/test/ci/prow-dual-stack/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ patchesStrategicMerge:
- patches/azure-machine-template-control-plane.yaml
- patches/azure-machine-template.yaml
- patches/cluster-label-calico-dual-stack.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
1 change: 0 additions & 1 deletion templates/test/ci/prow-edgezone/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ patchesStrategicMerge:
- patches/machine-type.yaml
- patches/kubernetes-version.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
1 change: 0 additions & 1 deletion templates/test/ci/prow-flatcar/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ patchesStrategicMerge:
- ../patches/tags.yaml
- ../patches/controller-manager.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
2 changes: 0 additions & 2 deletions templates/test/ci/prow-ipv6/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ patchesStrategicMerge:
- ../patches/tags.yaml
- ../patches/controller-manager.yaml
- patches/cluster-label-calico-ipv6.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml

1 change: 0 additions & 1 deletion templates/test/ci/prow-machine-pool/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ patchesStrategicMerge:
- ../patches/machine-pool-worker-counts.yaml
- ../patches/windows-containerd-labels.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
configMapGenerator:
- name: cni-${CLUSTER_NAME}-calico-windows
files:
Expand Down
1 change: 0 additions & 1 deletion templates/test/ci/prow-nvidia-gpu/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ patchesStrategicMerge:
- ../patches/controller-manager.yaml
- ../patches/azurecluster-gpu.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
patches:
- path: patches/node-storage-type.yaml
target:
Expand Down
3 changes: 1 addition & 2 deletions templates/test/ci/prow-private/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ patchesStrategicMerge:
- ../prow-intree-cloud-provider/patches/intree-cp.yaml # TODO: remove once CAPI supports Helm addons
- ../prow-intree-cloud-provider/patches/intree-md-0.yaml # TODO: remove once CAPI supports Helm addons
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
patches:
- path: patches/user-assigned.yaml
target:
Expand All @@ -30,4 +29,4 @@ generatorOptions:
labels:
type: generated
annotations:
note: generated
note: generated
1 change: 0 additions & 1 deletion templates/test/ci/prow-topology/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ patchesStrategicMerge:
- ../patches/windows-containerd-labels.yaml
- cluster.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
configMapGenerator:
- name: cni-${CLUSTER_NAME}-calico-windows
files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ patchesStrategicMerge:
- ../patches/uami-md-0.yaml
- ../patches/uami-control-plane.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
1 change: 0 additions & 1 deletion templates/test/ci/prow/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ patchesStrategicMerge:
- ../patches/windows-containerd-labels.yaml
- ../patches/windows-server-version.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
patches:
- target:
group: bootstrap.cluster.x-k8s.io
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion templates/test/dev/cluster-template-custom-builds.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions test/e2e/cloud-provider-azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import (
"strings"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/types"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
)

Expand All @@ -36,6 +39,7 @@ const (
azureDiskCSIDriverHelmRepoURL = "https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts"
azureDiskCSIDriverChartName = "azuredisk-csi-driver"
azureDiskCSIDriverHelmReleaseName = "azuredisk-csi-driver-oot"
azureDiskCSIDriverCAAPHLabelName = "azuredisk-csi"
)

// InstallCNIAndCloudProviderAzureHelmChart installs the official cloud-provider-azure helm chart
Expand Down Expand Up @@ -81,6 +85,7 @@ func InstallCNIAndCloudProviderAzureHelmChart(ctx context.Context, input cluster
func EnsureAzureDiskCSIDriverHelmChart(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, installHelmChart bool, hasWindows bool) {
specName := "ensure-azuredisk-csi-drivers"
clusterProxy := input.ClusterProxy.GetWorkloadCluster(ctx, input.Namespace, input.ClusterName)
mgmtClient := input.ClusterProxy.GetClient()

if installHelmChart {
By("Installing azure-disk CSI driver components via helm")
Expand All @@ -94,6 +99,22 @@ func EnsureAzureDiskCSIDriverHelmChart(ctx context.Context, input clusterctl.App
InstallHelmChart(ctx, clusterProxy, kubesystem, azureDiskCSIDriverHelmRepoURL, azureDiskCSIDriverChartName, azureDiskCSIDriverHelmReleaseName, options, "")
} else {
By("Ensuring azure-disk CSI driver is installed via CAAPH")
cluster := &clusterv1.Cluster{}
Eventually(func(g Gomega) {
g.Expect(mgmtClient.Get(ctx, types.NamespacedName{
Namespace: input.Namespace,
Name: input.ClusterName,
}, cluster)).To(Succeed())
// Label the cluster so that CAAPH installs the azuredisk-csi helm chart via existing HelmChartProxy resource
if cluster.Labels != nil {
cluster.Labels[azureDiskCSIDriverCAAPHLabelName] = "true"
} else {
cluster.Labels = map[string]string{
azureDiskCSIDriverCAAPHLabelName: "true",
}
}
g.Expect(mgmtClient.Update(ctx, cluster)).To(Succeed())
}, e2eConfig.GetIntervals(specName, "wait-deployment")...).Should(Succeed())
CecileRobertMichon marked this conversation as resolved.
Show resolved Hide resolved
}

By("Waiting for Ready csi-azuredisk-controller deployment pods")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ bases:
patchesStrategicMerge:
- ../patches/azurecluster-identity-ref.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ patchesStrategicMerge:
- ./cluster-with-kcp.yaml
- ../patches/azurecluster-identity-ref.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ resources:
patchesStrategicMerge:
- ../patches/azurecluster-identity-ref.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ patchesStrategicMerge:
- ./md.yaml
- ../patches/azurecluster-identity-ref.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ patchesStrategicMerge:
- ./cluster-with-kcp.yaml
- ../patches/azurecluster-identity-ref.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
azuredisk-csi: "true"
cni: calico
name: ${CLUSTER_NAME}
namespace: default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ bases:
patchesStrategicMerge:
- ../patches/azurecluster-identity-ref.yaml
- ../patches/cluster-label-calico.yaml
- ../patches/cluster-label-azuredisk-csi-driver.yaml

This file was deleted.