Skip to content

Commit

Permalink
fix: remove hard-coded label lookup for endpoint slices
Browse files Browse the repository at this point in the history
Signed-off-by: Dustin Scott <sdustin@vmware.com>
  • Loading branch information
Dustin Scott committed Aug 1, 2021
1 parent ce98883 commit f0f6e56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ import (
)

const (
knativeIngressClassKey = "networking.knative.dev/ingress.class"
caCertKey = "konghq.com/ca-cert"
knativeIngressClassKey = "networking.knative.dev/ingress.class"
endpointSliceServiceKey = "kubernetes.io/service-name"
caCertKey = "konghq.com/ca-cert"
)

// ErrNotFound error is returned when a lookup results in no resource.
Expand Down Expand Up @@ -532,7 +533,7 @@ func (s Store) ListKnativeIngresses() ([]*knative.Ingress, error) {
func (s Store) GetEndpointSlicesForService(namespace, name string) (*discoveryv1.EndpointSlice, error) {
var eps []*discoveryv1.EndpointSlice

req, err := labels.NewRequirement("kubernetes.io/service-name", selection.Equals, []string{name})
req, err := labels.NewRequirement(endpointSliceServiceKey, selection.Equals, []string{name})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f0f6e56

Please sign in to comment.