Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainToURL

func DomainToURL(domain string) string

DomainToURL converts a domain into an HTTP URL.

func ObjectReference

func ObjectReference(ctx context.Context, dynamicClient dynamic.Interface, namespace string, ref *corev1.ObjectReference) (json.Marshaler, error)

ObjectReference resolves an object based on an ObjectReference.

func ResourceInterface

func ResourceInterface(dynamicClient dynamic.Interface, namespace string, gvk schema.GroupVersionKind) (dynamic.ResourceInterface, error)

ResourceInterface creates a resource interface for the given ObjectReference.

Types

type ListableTracker

type ListableTracker interface {
	// TrackInNamespace returns a function that can be used to watch arbitrary apis.Listable resources in the same
	// namespace as obj. Any change will cause a callback for obj.
	TrackInNamespace(ctx context.Context, obj metav1.Object) Track
	// TrackInNamespaceKReference returns a function that can be used to watch arbitrary apis.Listable resources
	// in the same namespace as obj. Any change will cause a callback for obj.
	TrackInNamespaceKReference(ctx context.Context, obj metav1.Object) TrackKReference
	// ListerFor returns the lister for the object reference. It returns an error if the lister does not exist.
	ListerFor(ref corev1.ObjectReference) (cache.GenericLister, error)
	// InformerFor returns the informer for the object reference. It returns an error if the informer does not exist.
	InformerFor(ref corev1.ObjectReference) (cache.SharedIndexInformer, error)
	// ListerFor returns the lister for the KReference. It returns an error if the lister does not exist.
	ListerForKReference(ref duckv1.KReference) (cache.GenericLister, error)
	// InformerFor returns the informer for the KReference. It returns an error if the informer does not exist.
	InformerForKReference(ref duckv1.KReference) (cache.SharedIndexInformer, error)
}

ListableTracker is a tracker capable of tracking any object that implements the apis.Listable interface.

func NewListableTracker

func NewListableTracker(ctx context.Context, getter func(context.Context) duck.InformerFactory, callback func(types.NamespacedName), lease time.Duration) ListableTracker

NewListableTracker creates a new ListableTracker, backed by a TypedInformerFactory.

type Track

type Track func(corev1.ObjectReference) error

type TrackKReference

type TrackKReference func(duckv1.KReference) error