Skip to content

Commit

Permalink
Add keyFunc for shared resources
Browse files Browse the repository at this point in the history
While listing the resources in cleanup, each resource type should
be added in keyFunc.
Add shared resources to keyFunc
  • Loading branch information
TaoZou1 committed Jan 23, 2025
1 parent 12943ca commit a9a7f02
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/nsx/services/vpc/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ func keyFunc(obj interface{}) (string, error) {
return generateVirtualServerKey(*v)
case *model.LBPool:
return generatePoolKey(*v)
case *model.SharedResource:
return *v.Path, nil
case *model.LBAppProfile:
return *v.Path, nil
case *model.TlsCertificate:
return *v.Path, nil
case *model.LBPersistenceProfile:
return *v.Path, nil
case *model.Share:
return *v.Path, nil
case *model.LBMonitorProfile:
return *v.Path, nil
default:
return "", errors.New("keyFunc doesn't support unknown type")
}
Expand Down

0 comments on commit a9a7f02

Please sign in to comment.