serviceidresolver

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ServiceNameAnnotation = "intents.otterize.com/service-name"
)

Variables

This section is empty.

Functions

func ResolvePodToServiceIdentityUsingAnnotationOnly

func ResolvePodToServiceIdentityUsingAnnotationOnly(pod *corev1.Pod) (string, bool)

Types

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(c client.Client) *Resolver

func (*Resolver) GetOwnerObject

func (r *Resolver) GetOwnerObject(ctx context.Context, pod *corev1.Pod) (client.Object, error)

GetOwnerObject recursively iterates over the pod's owner reference hierarchy until reaching a root owner reference and returns it.

func (*Resolver) ResolvePodToServiceIdentity

func (r *Resolver) ResolvePodToServiceIdentity(ctx context.Context, pod *corev1.Pod) (string, error)

ResolvePodToServiceIdentity resolves a pod object to its otterize service ID, referenced in intents objects. It calls GetOwnerObject to recursively iterates over the pod's owner reference hierarchy until reaching a root owner reference. In case the pod is annotated with an "intents.otterize.com/service-name" annotation, that annotation's value will override any owner reference name as the service name.

Jump to

Keyboard shortcuts

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