pkg/proxy: using generic sets

pkg/proxy: using generic sets

Signed-off-by: Daman <aroradaman@gmail.com>
This commit is contained in:
Daman
2023-04-15 22:59:21 +05:30
parent 940101e07e
commit c2c8b8d178
17 changed files with 244 additions and 244 deletions

View File

@@ -81,7 +81,7 @@ type endpointInfo struct {
Addresses []string
NodeName *string
Zone *string
ZoneHints sets.String
ZoneHints sets.Set[string]
Ready bool
Serving bool
@@ -141,7 +141,7 @@ func newEndpointSliceInfo(endpointSlice *discovery.EndpointSlice, remove bool) *
if utilfeature.DefaultFeatureGate.Enabled(features.TopologyAwareHints) {
if endpoint.Hints != nil && len(endpoint.Hints.ForZones) > 0 {
epInfo.ZoneHints = sets.String{}
epInfo.ZoneHints = sets.New[string]()
for _, zone := range endpoint.Hints.ForZones {
epInfo.ZoneHints.Insert(zone.Name)
}
@@ -190,11 +190,11 @@ func (cache *EndpointSliceCache) updatePending(endpointSlice *discovery.Endpoint
// pendingChanges returns a set whose keys are the names of the services whose endpoints
// have changed since the last time checkoutChanges was called
func (cache *EndpointSliceCache) pendingChanges() sets.String {
func (cache *EndpointSliceCache) pendingChanges() sets.Set[string] {
cache.lock.Lock()
defer cache.lock.Unlock()
changes := sets.NewString()
changes := sets.New[string]()
for serviceNN, esTracker := range cache.trackerByServiceMap {
if len(esTracker.pending) > 0 {
changes.Insert(serviceNN.String())