public ImmutableList <string> Update(WatchEventType eventType, V1Endpoints endpoints) { if (endpoints is null) { throw new ArgumentNullException(nameof(endpoints)); } var serviceName = endpoints.Name(); lock (_sync) { if (eventType == WatchEventType.Added || eventType == WatchEventType.Modified) { _endpointsData[serviceName] = new Endpoints(endpoints); } else if (eventType == WatchEventType.Deleted) { _endpointsData.Remove(serviceName); } if (_serviceToIngressNames.TryGetValue(serviceName, out var ingressNames)) { return(ingressNames); } else { return(ImmutableList <string> .Empty); } } }
public Endpoints(V1Endpoints endpoints) { if (endpoints is null) { throw new ArgumentNullException(nameof(endpoints)); } Name = endpoints.Name(); Subsets = endpoints.Subsets; }