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

[release-1.1] Deepcopy results of cache Get() #2705

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

lzhecheng
Copy link
Contributor

Signed-off-by: Zhecheng Li zhechengli@microsoft.com

What type of PR is this?

/kind bug

What this PR does / why we need it:

[release-1.1] Deepcopy results of cache Get()
Considering thread safety, results of cache Get() should be deepcopied before used.

  • Support deepcopy and add UT for all types
  • Add TestGet UT
  • Update current UT
  • Make Entry structs exported to adjust for deepcopy
  • Delete cacheKey for VMSS VM and VMSS deletion

#2445

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Considering thread safety, results of cache Get() should be deepcopied before used.

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/bug Categorizes issue or PR as related to a bug. labels Nov 4, 2022
@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 the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 4, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 4, 2022
@lzhecheng lzhecheng force-pushed the cp-2445-1.1 branch 3 times, most recently from 8eb939a to e1f4587 Compare November 4, 2022 06:32
@coveralls
Copy link

coveralls commented Nov 4, 2022

Coverage Status

Coverage increased (+0.01%) to 80.709% when pulling 6be6850 on lzhecheng:cp-2445-1.1 into 7adb4d1 on kubernetes-sigs:release-1.1.

@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 Nov 8, 2022
@lzhecheng
Copy link
Contributor Author

/retest

@lzhecheng
Copy link
Contributor Author

/test pull-cloud-provider-azure-unit-1-22

@MartinForReal
Copy link
Contributor

@lzhecheng Should we ignore all test for kubetest2?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2022
@lzhecheng
Copy link
Contributor Author

@lzhecheng Should we ignore all test for kubetest2?

What are the kubetest2 tests? I don't see any.

Considering thread safety, results of cache Get() should be
deepcopied before used.
* Support deepcopy and add UT for all types
* Add TestGet UT
* Update current UT
* Make Entry structs exported to adjust for deepcopy
* Delete cacheKey for VMSS VM and VMSS deletion

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 Nov 9, 2022
@lzhecheng
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 3080891 into kubernetes-sigs:release-1.1 Nov 11, 2022
@lzhecheng lzhecheng deleted the cp-2445-1.1 branch November 11, 2022 03:56
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/bug Categorizes issue or PR as related to a bug. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants