relationship

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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.

Currently, it only captures relationships between HTTPRoutes and Services and Services and EndpointSlices, but it can be extended to capture additional relationships. 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.

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.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL