Skip to content

Commit

Permalink
feat: add disable-update-cache flag
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Dec 23, 2022
1 parent 01fca9c commit b0804b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/azuredisk/azuredisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type DriverOptions struct {
SupportZone bool
GetNodeInfoFromLabels bool
EnableDiskCapacityCheck bool
DisableUpdateCache bool
VMSSCacheTTLInSeconds int64
VMType string
}
Expand Down Expand Up @@ -108,6 +109,7 @@ type DriverCore struct {
supportZone bool
getNodeInfoFromLabels bool
enableDiskCapacityCheck bool
disableUpdateCache bool
vmssCacheTTLInSeconds int64
vmType string
}
Expand Down Expand Up @@ -142,6 +144,7 @@ func newDriverV1(options *DriverOptions) *Driver {
driver.supportZone = options.SupportZone
driver.getNodeInfoFromLabels = options.GetNodeInfoFromLabels
driver.enableDiskCapacityCheck = options.EnableDiskCapacityCheck
driver.disableUpdateCache = options.DisableUpdateCache
driver.vmssCacheTTLInSeconds = options.VMSSCacheTTLInSeconds
driver.vmType = options.VMType
driver.volumeLocks = volumehelper.NewVolumeLocks()
Expand Down Expand Up @@ -207,6 +210,8 @@ func (d *Driver) Run(endpoint, kubeconfig string, disableAVSetNodes, testingMock
d.cloud.VmssCacheTTLInSeconds = int(d.vmssCacheTTLInSeconds)
}

d.cloud.DisableUpdateCache = d.disableUpdateCache

d.deviceHelper = optimization.NewSafeDeviceHelper()

if d.getPerfOptimizationEnabled() {
Expand Down
2 changes: 2 additions & 0 deletions pkg/azurediskplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var (
enableListVolumes = flag.Bool("enable-list-volumes", false, "boolean flag to enable ListVolumes on controller")
enableListSnapshots = flag.Bool("enable-list-snapshots", false, "boolean flag to enable ListSnapshots on controller")
enableDiskCapacityCheck = flag.Bool("enable-disk-capacity-check", false, "boolean flag to enable volume capacity check in CreateVolume")
disableUpdateCache = flag.Bool("disable-update-cache", false, "boolean flag to disable update cache during disk attach/detach")
vmssCacheTTLInSeconds = flag.Int64("vmss-cache-ttl-seconds", -1, "vmss cache TTL in seconds (600 by default)")
)

Expand Down Expand Up @@ -103,6 +104,7 @@ func handle() {
SupportZone: *supportZone,
GetNodeInfoFromLabels: *getNodeInfoFromLabels,
EnableDiskCapacityCheck: *enableDiskCapacityCheck,
DisableUpdateCache: *disableUpdateCache,
VMSSCacheTTLInSeconds: *vmssCacheTTLInSeconds,
VMType: *vmType,
}
Expand Down

0 comments on commit b0804b5

Please sign in to comment.