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

Add keyFunc for shared resources #1012

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

TaoZou1
Copy link
Contributor

@TaoZou1 TaoZou1 commented Jan 23, 2025

While listing the resources in cleanup, each resource type should be added in keyFunc.
Add shared resources to keyFunc

while disable cluster:
2025-01-23 06:38:28.141 ^[[34mINFO^[[0m ^[[33mvpc/vpc.go:1003^[[0m Cleaning up sharedResources {"Count": 0}
2025-01-23 06:38:28.335 ^[[31mERROR^[[0m ^[[33mvpc/vpc.go:299^[[0m Failed to query share {"query": "resource_type:Share AND tags.scope:ncp\/cluster AND tags.tag:af33355b-c022-4de2-b365-27644454a57f", "error": "couldn't create key for object &{Links:[] Schema: Self: Revision:0xc0057314c8 CreateTime:0xc005731418 CreateUser:0xc006dca4c0 LastModifiedTime:0xc0057313a8 LastModifiedUser:0xc006dca230 Protection:0xc006dca460 SystemOwned:0xc00573144f Description: DisplayName:0xc006dca250 Id:0xc006dca1f0 ResourceType:0xc006dca480 Tags:[{Scope:0xc006dca320 Tag:0xc006dca340} {Scope:0xc006dca3b0 Tag:0xc006dca3d0}] OriginSiteId: OwnerId:0xc006dca400 ParentPath:0xc006dca1a0 Path:0xc006dca420 RealizationId:0xc006dca180 RelativePath:0xc006dca440 RemotePath:0xc006dca270 UniqueId:0xc006dca210 Children:[] MarkedForDelete:0xc00573137f Overridden:0xc0057313ff SharedWith:[/orgs/default] SharingStrategy:0xc006dca4a0}: keyFunc doesn't support unknown type"}
2025-01-23 06:38:28.335 ^[[34mINFO^[[0m ^[[33mvpc/vpc.go:1018^[[0m Cleaning up shares {"Count": 0}

Test Done:

  1. hack the code to only ListXXX function left
  2. run the cleanup to check if the resources download

While listing the resources in cleanup, each resource type should
be added in keyFunc.
Add shared resources to keyFunc
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 74.84%. Comparing base (12943ca) to head (a9a7f02).

Files with missing lines Patch % Lines
pkg/nsx/services/vpc/store.go 0.00% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           v4.2.0    #1012      +/-   ##
==========================================
- Coverage   74.90%   74.84%   -0.06%     
==========================================
  Files         118      118              
  Lines       16377    16389      +12     
==========================================
  Hits        12267    12267              
- Misses       3343     3355      +12     
  Partials      767      767              
Flag Coverage Δ
unit-tests 74.84% <0.00%> (-0.06%) ⬇️
Files with missing lines Coverage Δ
pkg/nsx/services/vpc/store.go 59.81% <0.00%> (-7.56%) ⬇️

@TaoZou1
Copy link
Contributor Author

TaoZou1 commented Jan 23, 2025

/e2e

1 similar comment
@TaoZou1
Copy link
Contributor Author

TaoZou1 commented Jan 23, 2025

/e2e

@dantingl
Copy link
Contributor

/e2e

Copy link
Contributor

@zhengxiexie zhengxiexie left a comment

Choose a reason for hiding this comment

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

lgtm

@TaoZou1 TaoZou1 merged commit 0bdd267 into vmware-tanzu:v4.2.0 Jan 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants