Skip to content

Commit

Permalink
Merge pull request #1012 from TaoZou1/keyfunc
Browse files Browse the repository at this point in the history
Add keyFunc for shared resources
  • Loading branch information
TaoZou1 authored Jan 23, 2025
2 parents 12943ca + a9a7f02 commit 0bdd267
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 0bdd267

Please sign in to comment.