Skip to content

Commit 6993313

Browse files
committed
Update flags for data cache
1 parent 3a41452 commit 6993313

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

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

+10-11
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ var (
7474
maxConcurrentFormat = flag.Int("max-concurrent-format", 1, "The maximum number of concurrent format exec calls")
7575
concurrentFormatTimeout = flag.Duration("concurrent-format-timeout", 1*time.Minute, "The maximum duration of a format operation before its concurrency token is released")
7676

77-
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")
78-
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")
79-
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")
80-
enableStoragePoolsFlag = flag.Bool("enable-storage-pools", false, "If set to true, the CSI Driver will allow volumes to be provisioned in Storage Pools")
81-
enableHdHAFlag = flag.Bool("allow-hdha-provisioning", false, "If set to true, will allow the driver to provision Hyperdisk-balanced High Availability disks")
82-
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")
83-
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")
84-
nodeName = flag.String("node-name", "", "The node this driver is running on")
77+
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")
78+
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")
79+
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")
80+
enableStoragePoolsFlag = flag.Bool("enable-storage-pools", false, "If set to true, the CSI Driver will allow volumes to be provisioned in Storage Pools")
81+
enableHdHAFlag = flag.Bool("allow-hdha-provisioning", false, "If set to true, will allow the driver to provision Hyperdisk-balanced High Availability disks")
82+
enableDataCacheFlag = flag.Bool("enable-data-cache", false, "If set to true, the CSI Driver will allow volumes to be provisioned with data cache configuration")
83+
nodeName = flag.String("node-name", "", "The node this driver is running on")
8584

8685
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")
8786
multiZoneVolumeHandleEnableFlag = flag.Bool("multi-zone-volume-handle-enable", false, "If set to true, the multi-zone volumeHandle feature will be enabled")
@@ -234,7 +233,7 @@ func handle() {
234233
}
235234
initialBackoffDuration := time.Duration(*errorBackoffInitialDurationMs) * time.Millisecond
236235
maxBackoffDuration := time.Duration(*errorBackoffMaxDurationMs) * time.Millisecond
237-
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableControllerDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig, provisionableDisksConfig, *enableHdHAFlag)
236+
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig, provisionableDisksConfig, *enableHdHAFlag)
238237
} else if *cloudConfigFilePath != "" {
239238
klog.Warningf("controller service is disabled but cloud config given - it has no effect")
240239
}
@@ -255,15 +254,15 @@ func handle() {
255254
nsArgs := driver.NodeServerArgs{
256255
EnableDeviceInUseCheck: *enableDeviceInUseCheck,
257256
DeviceInUseTimeout: *deviceInUseTimeout,
258-
EnableDataCache: *enableNodeDataCacheFlag,
257+
EnableDataCache: *enableDataCacheFlag,
259258
}
260259
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter, nsArgs)
261260
if *maxConcurrentFormatAndMount > 0 {
262261
nodeServer = nodeServer.WithSerializedFormatAndMount(*formatAndMountTimeout, *maxConcurrentFormatAndMount)
263262
}
264263
}
265264

266-
if *enableNodeDataCacheFlag {
265+
if *enableDataCacheFlag {
267266
if nodeName == nil || *nodeName == "" {
268267
klog.Errorf("Data cache enabled, but --node-name not passed")
269268
}

deploy/kubernetes/base/node_linux/node.yaml

+1-1
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

-1
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ func GCEClientAndDriverSetup(instance *remote.InstanceInfo, driverConfig DriverC
7171
"--allow-hdha-provisioning",
7272
"--device-in-use-timeout=10s", // Set lower than the usual value to expedite tests
7373
fmt.Sprintf("--fallback-requisite-zones=%s", strings.Join(driverConfig.Zones, ",")),
74-
"--enable-controller-data-cache",
75-
"--enable-node-data-cache",
74+
"--enable-data-cache",
7675
fmt.Sprintf("--node-name=%s", utilcommon.TestNode),
7776
}
7877
extra_flags = append(extra_flags, fmt.Sprintf("--compute-endpoint=%s", driverConfig.ComputeEndpoint))

0 commit comments

Comments
 (0)