Merge pull request #121259 from borg-land/skip-deploying-gce-pd-csi

Skip deploying gce-pd csi driver if it is already installed
This commit is contained in:
Kubernetes Prow Robot 2023-12-14 23:22:33 +01:00 committed by GitHub
commit f49d2950cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -894,6 +894,12 @@ func (g *gcePDCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework
return cfg
}
// Check if the cluster is already running gce-pd CSI Driver
deploy, err := f.ClientSet.AppsV1().Deployments("gce-pd-csi-driver").Get(ctx, "csi-gce-pd-controller", metav1.GetOptions{})
if err == nil && deploy != nil {
framework.Logf("The csi gce-pd driver is already installed.")
return cfg
}
ginkgo.By("deploying csi gce-pd driver")
// Create secondary namespace which will be used for creating driver
driverNamespace := utils.CreateDriverNamespace(ctx, f)
@ -922,7 +928,7 @@ func (g *gcePDCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework
"test/e2e/testing-manifests/storage-csi/gce-pd/controller_ss.yaml",
}
err := utils.CreateFromManifests(ctx, f, driverNamespace, nil, manifests...)
err = utils.CreateFromManifests(ctx, f, driverNamespace, nil, manifests...)
if err != nil {
framework.Failf("deploying csi gce-pd driver: %v", err)
}