Skip to content

Commit 02c8534

Browse files
Sneha-atcemakd
authored andcommitted
Update flags for data cache
1 parent 27b866a commit 02c8534

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

cmd/gce-pd-csi-driver/main.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ var (
7171
maxConcurrentFormat = flag.Int("max-concurrent-format", 1, "The maximum number of concurrent format exec calls")
7272
concurrentFormatTimeout = flag.Duration("concurrent-format-timeout", 1*time.Minute, "The maximum duration of a format operation before its concurrency token is released")
7373

74-
maxConcurrentFormatAndMount = flag.Int("max-concurrent-format-and-mount", 1, "If set then format and mount operations are serialized on each node. This is stronger than max-concurrent-format as it includes fsck and other mount operations")
75-
formatAndMountTimeout = flag.Duration("format-and-mount-timeout", 1*time.Minute, "The maximum duration of a format and mount operation before another such operation will be started. Used only if --serialize-format-and-mount")
76-
fallbackRequisiteZonesFlag = flag.String("fallback-requisite-zones", "", "Comma separated list of requisite zones that will be used if there are not sufficient zones present in requisite topologies when provisioning a disk")
77-
enableStoragePoolsFlag = flag.Bool("enable-storage-pools", false, "If set to true, the CSI Driver will allow volumes to be provisioned in Storage Pools")
78-
enableControllerDataCacheFlag = flag.Bool("enable-controller-data-cache", false, "If set to true, the CSI Driver will allow volumes to be provisioned with data cache configuration")
79-
enableNodeDataCacheFlag = flag.Bool("enable-node-data-cache", false, "If set to true, the CSI Driver will allow volumes to be provisioned with data cache configuration")
80-
nodeName = flag.String("node-name", "", "The node this driver is running on")
74+
maxConcurrentFormatAndMount = flag.Int("max-concurrent-format-and-mount", 1, "If set then format and mount operations are serialized on each node. This is stronger than max-concurrent-format as it includes fsck and other mount operations")
75+
formatAndMountTimeout = flag.Duration("format-and-mount-timeout", 1*time.Minute, "The maximum duration of a format and mount operation before another such operation will be started. Used only if --serialize-format-and-mount")
76+
fallbackRequisiteZonesFlag = flag.String("fallback-requisite-zones", "", "Comma separated list of requisite zones that will be used if there are not sufficient zones present in requisite topologies when provisioning a disk")
77+
enableStoragePoolsFlag = flag.Bool("enable-storage-pools", false, "If set to true, the CSI Driver will allow volumes to be provisioned in Storage Pools")
78+
enableDataCacheFlag = flag.Bool("enable-data-cache", false, "If set to true, the CSI Driver will allow volumes to be provisioned with data cache configuration")
79+
nodeName = flag.String("node-name", "", "The node this driver is running on")
8180

8281
multiZoneVolumeHandleDiskTypesFlag = flag.String("multi-zone-volume-handle-disk-types", "", "Comma separated list of allowed disk types that can use the multi-zone volumeHandle. Used only if --multi-zone-volume-handle-enable")
8382
multiZoneVolumeHandleEnableFlag = flag.Bool("multi-zone-volume-handle-enable", false, "If set to true, the multi-zone volumeHandle feature will be enabled")
@@ -217,7 +216,7 @@ func handle() {
217216
}
218217
initialBackoffDuration := time.Duration(*errorBackoffInitialDurationMs) * time.Millisecond
219218
maxBackoffDuration := time.Duration(*errorBackoffMaxDurationMs) * time.Millisecond
220-
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableControllerDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig)
219+
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig)
221220
} else if *cloudConfigFilePath != "" {
222221
klog.Warningf("controller service is disabled but cloud config given - it has no effect")
223222
}
@@ -236,15 +235,15 @@ func handle() {
236235
klog.Fatalf("Failed to set up metadata service: %v", err.Error())
237236
}
238237
nsArgs := driver.NodeServerArgs{
239-
EnableDataCache: *enableNodeDataCacheFlag,
238+
EnableDataCache: *enableDataCacheFlag,
240239
}
241240
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter, nsArgs)
242241
if *maxConcurrentFormatAndMount > 0 {
243242
nodeServer = nodeServer.WithSerializedFormatAndMount(*formatAndMountTimeout, *maxConcurrentFormatAndMount)
244243
}
245244
}
246245

247-
if *enableNodeDataCacheFlag {
246+
if *enableDataCacheFlag {
248247
if nodeName == nil || *nodeName == "" {
249248
klog.Errorf("Data cache enabled, but --node-name not passed")
250249
}

deploy/kubernetes/base/node_linux/node.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
- "--v=5"
4747
- "--endpoint=unix:/csi/csi.sock"
4848
- "--run-controller-service=false"
49-
- "--enable-node-data-cache"
49+
- "--enable-data-cache"
5050
- "--node-name=$(KUBE_NODE_NAME)"
5151
securityContext:
5252
privileged: true

pkg/gce-pd-csi-driver/cache.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ func getLvName(suffix string, volumeId string) string {
242242
}
243243

244244
func createVg(volumeGroupName string, devicePath string, raidedLocalSsds string) error {
245-
klog.V(2).Infof(" vgcreate=")
246245
args := []string{
247246
"--zero",
248247
"y",

test/e2e/utils/utils.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ func GCEClientAndDriverSetup(instance *remote.InstanceInfo, driverConfig DriverC
6767
"--use-instance-api-to-poll-attachment-disk-types=pd-ssd",
6868
"--use-instance-api-to-list-volumes-published-nodes",
6969
fmt.Sprintf("--fallback-requisite-zones=%s", strings.Join(driverConfig.Zones, ",")),
70-
"--enable-controller-data-cache",
71-
"--enable-node-data-cache",
70+
"--enable-data-cache",
7271
fmt.Sprintf("--node-name=%s", utilcommon.TestNode),
7372
}
7473
extra_flags = append(extra_flags, fmt.Sprintf("--compute-endpoint=%s", driverConfig.ComputeEndpoint))

0 commit comments

Comments
 (0)