Skip to content

Commit

Permalink
Populate supervisor FSS values for node plugin in guest cluster (kube…
Browse files Browse the repository at this point in the history
  • Loading branch information
akankshapanse authored and rpanduranga committed May 19, 2023
1 parent 1fee0ea commit ad61a87
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion manifests/guestcluster/1.25/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ data:
"volume-health": "true"
"online-volume-extend": "true"
"file-volume": "true"
"csi-sv-feature-states-replication": "false"
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "false"
"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func initFSS(ctx context.Context, k8sClient clientset.Interface,
// CR is not registered yet.
if controllerClusterFlavor == cnstypes.CnsClusterFlavorWorkload ||
(controllerClusterFlavor == cnstypes.CnsClusterFlavorGuest &&
!getSvFssCRAvailability() && serviceMode != "node") {
!getSvFssCRAvailability()) {
if k8sOrchestratorInstance.supervisorFSS.configMapName != "" &&
k8sOrchestratorInstance.supervisorFSS.configMapNamespace != "" {
// Retrieve configmap.
Expand Down Expand Up @@ -1013,7 +1013,7 @@ func (c *K8sOrchestrator) IsFSSEnabled(ctx context.Context, featureName string)
return internalFeatureState
}
c.internalFSS.featureStatesLock.RUnlock()
log.Debugf("Could not find the %s feature state in ConfigMap %s. "+
log.Infof("Could not find the %s feature state in ConfigMap %s. "+
"Setting the feature state to false", featureName, c.internalFSS.configMapName)
return false
} else if c.clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
Expand All @@ -1030,7 +1030,7 @@ func (c *K8sOrchestrator) IsFSSEnabled(ctx context.Context, featureName string)
return supervisorFeatureState
}
c.supervisorFSS.featureStatesLock.RUnlock()
log.Debugf("Could not find the %s feature state in ConfigMap %s. "+
log.Infof("Could not find the %s feature state in ConfigMap %s. "+
"Setting the feature state to false", featureName, c.supervisorFSS.configMapName)
return false
} else if c.clusterFlavor == cnstypes.CnsClusterFlavorGuest {
Expand All @@ -1051,7 +1051,7 @@ func (c *K8sOrchestrator) IsFSSEnabled(ctx context.Context, featureName string)
}
} else {
c.internalFSS.featureStatesLock.RUnlock()
log.Debugf("Could not find the %s feature state in ConfigMap %s. Setting the feature state to false",
log.Infof("Could not find the %s feature state in ConfigMap %s. Setting the feature state to false",
featureName, c.internalFSS.configMapName)
return false
}
Expand All @@ -1072,7 +1072,7 @@ func (c *K8sOrchestrator) IsFSSEnabled(ctx context.Context, featureName string)
}
} else {
c.supervisorFSS.featureStatesLock.RUnlock()
log.Debugf("Could not find the %s feature state in ConfigMap %s. Setting the feature state to false",
log.Infof("Could not find the %s feature state in ConfigMap %s. Setting the feature state to false",
featureName, c.supervisorFSS.configMapName)
return false
}
Expand Down
8 changes: 5 additions & 3 deletions tests/e2e/operationstorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,11 @@ var _ = ginkgo.Describe("[csi-block-vanilla] [csi-block-vanilla-parallelized] Vo
pv.Spec.CSI.VolumeHandle, podArray[podCount].Spec.NodeName))
isDiskAttached, err := e2eVSphere.isVolumeAttachedToVM(client, volumeID, vmUUID)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(isDiskAttached).To(gomega.BeTrue(),
fmt.Sprintf("Volume: %s is not attached to the node: %s",
pv.Spec.CSI.VolumeHandle, podArray[podCount].Spec.NodeName))
if !rwxAccessMode {
gomega.Expect(isDiskAttached).To(gomega.BeTrue(),
fmt.Sprintf("Volume: %s is not attached to the node: %s",
pv.Spec.CSI.VolumeHandle, podArray[podCount].Spec.NodeName))
}
podCount++
}

Expand Down
9 changes: 2 additions & 7 deletions tests/e2e/vsphere_volume_fsgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,8 @@ var _ = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] [csi-guest] [csi
if vanillaCluster {
ginkgo.By("CNS_TEST: Running for vanilla k8s setup")
scParameters[scParamDatastoreURL] = datastoreURL
accessMode := v1.ReadWriteOnce

// Check if it is file volumes setups
if rwxAccessMode {
accessMode = v1.ReadWriteMany
}
storageclasspvc, pvclaim, err = createPVCAndStorageClass(client,
namespace, nil, scParameters, diskSize, nil, "", false, accessMode)
namespace, nil, scParameters, diskSize, nil, "", false, "")
} else if supervisorCluster {
ginkgo.By("CNS_TEST: Running for WCP setup")
profileID := e2eVSphere.GetSpbmPolicyID(storagePolicyName)
Expand Down Expand Up @@ -136,6 +130,7 @@ var _ = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] [csi-guest] [csi
gomega.Expect(err).NotTo(gomega.HaveOccurred())
err = e2eVSphere.waitForCNSVolumeToBeDeleted(volHandle)
gomega.Expect(err).NotTo(gomega.HaveOccurred())

}()

// Create a Pod to use this PVC, and verify volume has been attached
Expand Down

0 comments on commit ad61a87

Please sign in to comment.