Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add disable-update-cache flag #1643

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
k8s.io/kubernetes v1.26.0
k8s.io/mount-utils v0.0.0
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221221045724-c33f413c0ef5
sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221223035925-99af5be5b9fb
sigs.k8s.io/yaml v1.3.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 h1:LYqFq+6Cj2D0gFfrJvL7iElD4ET6ir3VDdhDdTK7rgc=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33/go.mod h1:soWkSNf2tZC7aMibXEqVhCd73GOY5fJikn8qbdzemB0=
sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221221045724-c33f413c0ef5 h1:W13Iq9axV6oPV3gA+wrlpgKzKoJrRXiUy8e/QHN7Rzs=
sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221221045724-c33f413c0ef5/go.mod h1:7ksoxa026xKQGAc0HYGk1ksucEweJnwxXiuk3krfP4c=
sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221223035925-99af5be5b9fb h1:WS2/h0sHh6Tnp70KL9rbo228Yn/hN/ZKDKOT8L7kxak=
sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221223035925-99af5be5b9fb/go.mod h1:7ksoxa026xKQGAc0HYGk1ksucEweJnwxXiuk3krfP4c=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
Expand Down
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
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ k8s.io/utils/trace
## explicit; go 1.17
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client
# sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221221045724-c33f413c0ef5
# sigs.k8s.io/cloud-provider-azure v1.26.1-0.20221223035925-99af5be5b9fb
## explicit; go 1.19
sigs.k8s.io/cloud-provider-azure/pkg/auth
sigs.k8s.io/cloud-provider-azure/pkg/azureclients
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 22 additions & 18 deletions vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 34 additions & 9 deletions vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.