pkg/proxy: using generic sets
pkg/proxy: using generic sets Signed-off-by: Daman <aroradaman@gmail.com>
This commit is contained in:
@@ -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())
|
||||
|
Reference in New Issue
Block a user