From 20a48363144d9f3f55b858bc650b0bcbc1deb83e Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 27 Jun 2022 13:38:36 +0530 Subject: [PATCH] fix: changed the csistoragecapacity check namespace The CSIStorageCapacity v1 check was attampting to create an invalid object in the default namespace. This would fail if the pod did not have permissions to the namespace. This will now use the namespace specified in the NAMESPACE env variable. Signed-off-by: N Balachandran --- cmd/csi-provisioner/csi-provisioner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/csi-provisioner/csi-provisioner.go b/cmd/csi-provisioner/csi-provisioner.go index f19349f047..01b1f543c3 100644 --- a/cmd/csi-provisioner/csi-provisioner.go +++ b/cmd/csi-provisioner/csi-provisioner.go @@ -493,7 +493,7 @@ func main() { Name: "#%123-invalid-name", }, } - createdCapacity, err := clientset.StorageV1().CSIStorageCapacities("default").Create(ctx, invalidCapacity, metav1.CreateOptions{}) + createdCapacity, err := clientset.StorageV1().CSIStorageCapacities(namespace).Create(ctx, invalidCapacity, metav1.CreateOptions{}) switch { case err == nil: klog.Fatalf("creating an invalid v1.CSIStorageCapacity didn't fail as expected, got: %s", createdCapacity)