Documentation ¶
Index ¶
- type Capturer
- type CapturerImpl
- func (c *CapturerImpl) Capture(obj client.Object)
- func (c *CapturerImpl) Exists(resourceType client.Object, nsname types.NamespacedName) bool
- func (c *CapturerImpl) GetRefCountForService(svcName types.NamespacedName) int
- func (c *CapturerImpl) Remove(resourceType client.Object, nsname types.NamespacedName)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capturer ¶
type Capturer interface { Capture(obj client.Object) Remove(resourceType client.Object, nsname types.NamespacedName) Exists(resourceType client.Object, nsname types.NamespacedName) bool }
Capturer captures relationships between Kubernetes objects and can be queried for whether a relationship exists for a given object.
The relationships between HTTPRoutes -> Services are many to 1, so these relationships are tracked using a counter. A Service relationship exists if at least one HTTPRoute references it. An EndpointSlice relationship exists if its Service owner is referenced by at least one HTTPRoute.
A Namespace relationship exists if it has labels that match a Gateway listener's label selector.
type CapturerImpl ¶
type CapturerImpl struct {
// contains filtered or unexported fields
}
CapturerImpl implements the Capturer interface.
func NewCapturerImpl ¶
func NewCapturerImpl() *CapturerImpl
NewCapturerImpl creates a new instance of CapturerImpl.
func (*CapturerImpl) Capture ¶
func (c *CapturerImpl) Capture(obj client.Object)
Capture captures relationships for the given object.
func (*CapturerImpl) Exists ¶
func (c *CapturerImpl) Exists(resourceType client.Object, nsname types.NamespacedName) bool
Exists returns true if the given object has a relationship with another object.
func (*CapturerImpl) GetRefCountForService ¶
func (c *CapturerImpl) GetRefCountForService(svcName types.NamespacedName) int
GetRefCountForService is used for unit testing purposes. It is not exposed through the Capturer interface.
func (*CapturerImpl) Remove ¶
func (c *CapturerImpl) Remove(resourceType client.Object, nsname types.NamespacedName)
Remove removes the relationship for the given object from the CapturerImpl.