plugins

package
v0.0.0-...-5ee5d88 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NativePlugins = map[schema.GroupVersionKind]Plugin{
	appsv1.SchemeGroupVersion.WithKind(common.DeploymentKind): &deploymentPlugin{},
}

Functions

func GetSpecifiedOwnerFromObj

func GetSpecifiedOwnerFromObj(
	ctx context.Context,
	client dynamic.Interface,
	obj client.Object,
	ownerAPIResource metav1.APIResource,
) (ownerObj *unstructured.Unstructured, found bool, err error)

GetSpecifiedOwnerFromObj returns the owner of the given object matches the APIResource.

Types

type ClusterHandle

type ClusterHandle struct {
	DynamicClient dynamic.Interface
	KubeClient    kubernetes.Interface
}

type Plugin

type Plugin interface {
	GetPodsForClusterObject(
		ctx context.Context,
		obj *unstructured.Unstructured,
		handle ClusterHandle,
	) ([]*corev1.Pod, error)

	GetTargetObjectFromPod(
		ctx context.Context,
		pod *corev1.Pod,
		handle ClusterHandle,
	) (obj *unstructured.Unstructured, found bool, err error)
}

func ResolvePlugin

func ResolvePlugin(gvk schema.GroupVersionKind) (Plugin, error)

Jump to

Keyboard shortcuts

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