resource

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindPod                     = "Pod"
	KindReplicaSet              = "ReplicaSet"
	KindConfigMap               = "ConfigMap"
	KindSecret                  = "Secret"
	KindServiceAccount          = "ServiceAccount"
	KindPersistentVolume        = "PersistentVolume"
	KindPersistentVolumeClaim   = "PersistentVolumeClaim"
	KindJob                     = "Job"
	KindPodDisruptionBudget     = "PodDisruptionBudget"
	KindHorizontalPodAutoscaler = "HorizontalPodAutoscaler"
)

Variables

This section is empty.

Functions

func CheckVolumeSatisfyClaim

func CheckVolumeSatisfyClaim(volume *corev1.PersistentVolume, claim *corev1.PersistentVolumeClaim) bool

CheckVolumeSatisfyClaim checks if the volume requested by the claim satisfies the requirements of the claim.

func ObjectToHorizontalPodAutoscaler

func ObjectToHorizontalPodAutoscaler(obj runtime.Object) (*autoscalingv1.HorizontalPodAutoscaler, error)

func ObjectToJob

func ObjectToJob(obj runtime.Object) (*batchv1.Job, error)

func ObjectToPersistentVolume

func ObjectToPersistentVolume(obj runtime.Object) (*corev1.PersistentVolume, error)

func ObjectToPod

func ObjectToPod(obj runtime.Object) (*corev1.Pod, error)

func ObjectToPodDisruptionBudget

func ObjectToPodDisruptionBudget(obj runtime.Object) (*policyv1beta1.PodDisruptionBudget, error)

func ObjectToReplicaSet added in v0.11.0

func ObjectToReplicaSet(obj runtime.Object) (*appsv1.ReplicaSet, error)

Types

type Client

type Client interface {
	ListPods(ctx context.Context, namespace string) ([]*corev1.Pod, error)
	ListReplicaSets(ctx context.Context, namespace string) ([]*appsv1.ReplicaSet, error)
	ListServiceAccounts(ctx context.Context, namespace string) ([]*corev1.ServiceAccount, error)
	ListPersistentVolumeClaims(ctx context.Context, namespace string) ([]*corev1.PersistentVolumeClaim, error)
	GetUnstructured(ctx context.Context, apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error)
}

func NewClient

func NewClient(clientset kubernetes.Interface, dynamicClient dynamic.Interface) Client

type FakeClient

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

func NewFakeClient

func NewFakeClient(objects ...runtime.Object) (*FakeClient, error)

func (*FakeClient) GetUnstructured

func (c *FakeClient) GetUnstructured(ctx context.Context, apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error)

func (*FakeClient) ListPersistentVolumeClaims

func (c *FakeClient) ListPersistentVolumeClaims(ctx context.Context, namespace string) ([]*corev1.PersistentVolumeClaim, error)

func (*FakeClient) ListPods

func (c *FakeClient) ListPods(ctx context.Context, namespace string) ([]*corev1.Pod, error)

func (*FakeClient) ListReplicaSets added in v0.11.0

func (c *FakeClient) ListReplicaSets(ctx context.Context, namespace string) ([]*appsv1.ReplicaSet, error)

func (*FakeClient) ListServiceAccounts

func (c *FakeClient) ListServiceAccounts(ctx context.Context, namespace string) ([]*corev1.ServiceAccount, error)

Jump to

Keyboard shortcuts

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