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

[ARG] Add an option to disable API call cache #4135

Merged
merged 1 commit into from Jun 28, 2023

Conversation

lzhecheng
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

[ARG] Add an option to disable API call cache
New option: disableAPICallCache
When ARG is enabled, this option should be true.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

[ARG] Add an option to disable API call cache
New option: disableAPICallCache
When ARG is enabled, this option should be true.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 20, 2023
@netlify
Copy link

netlify bot commented Jun 20, 2023

Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.

Name Link
🔨 Latest commit e1bb0d5
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cloud-provide-azure/deploys/64993b800b6f530008606070

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lzhecheng

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 20, 2023
@lzhecheng lzhecheng changed the title [ARG] Add an option to disable API call cache [WIP][ARG] Add an option to disable API call cache Jun 20, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2023
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 25, 2023
@lzhecheng lzhecheng force-pushed the no-cache-option branch 3 times, most recently from 3386915 to e1bb0d5 Compare June 26, 2023 07:17
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 26, 2023
@lzhecheng
Copy link
Contributor Author

/test pull-cloud-provider-azure-e2e-ccm-vmss-ip-lb-capz

@lzhecheng lzhecheng changed the title [WIP][ARG] Add an option to disable API call cache [ARG] Add an option to disable API call cache Jun 26, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2023
pkg/cache/azure_cache.go Outdated Show resolved Hide resolved
// NewTimedcache creates a new TimedCache.
func NewTimedcache(ttl time.Duration, getter GetFunc) (*TimedCache, error) {
// NewTimedCache creates a new azcache.Resource.
func NewTimedCache(ttl time.Duration, getter GetFunc, disabled bool) (Resource, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getter is only used by apicaller. Maybe we can create another newapicaller func for apicaller?

And we also need another new function to assemble Resource impl based on the config(cacheDisabled)
Last but not least, we also need to generate mock for ut.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean a New() methods is needed for Resource interface?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@@ -742,6 +745,10 @@ func (az *Cloud) getPutVMSSVMBatchSize() int {
}

func (az *Cloud) initCaches() (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can init cache at creation time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the creation time? Could you please share which line of the code?

pkg/cache/azure_cache.go Outdated Show resolved Hide resolved
New option: disableAPICallCache
When ARG is enabled, this option should be true.

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
@MartinForReal
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 28, 2023
@k8s-ci-robot k8s-ci-robot merged commit 19c9e92 into kubernetes-sigs:master Jun 28, 2023
16 checks passed
@lzhecheng lzhecheng deleted the no-cache-option branch June 28, 2023 08:51
@lzhecheng
Copy link
Contributor Author

Fixed: #4130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants