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 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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