Documentation ¶
Index ¶
- Constants
- func CheckVolumeSatisfyClaim(volume *corev1.PersistentVolume, claim *corev1.PersistentVolumeClaim) bool
- func ObjectToHorizontalPodAutoscaler(obj runtime.Object) (*autoscalingv1.HorizontalPodAutoscaler, error)
- func ObjectToJob(obj runtime.Object) (*batchv1.Job, error)
- func ObjectToPersistentVolume(obj runtime.Object) (*corev1.PersistentVolume, error)
- func ObjectToPod(obj runtime.Object) (*corev1.Pod, error)
- func ObjectToPodDisruptionBudget(obj runtime.Object) (*policyv1beta1.PodDisruptionBudget, error)
- func ObjectToReplicaSet(obj runtime.Object) (*appsv1.ReplicaSet, error)
- type Client
- type FakeClient
- func (c *FakeClient) GetUnstructured(ctx context.Context, apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error)
- func (c *FakeClient) ListPersistentVolumeClaims(ctx context.Context, namespace string) ([]*corev1.PersistentVolumeClaim, error)
- func (c *FakeClient) ListPods(ctx context.Context, namespace string) ([]*corev1.Pod, error)
- func (c *FakeClient) ListReplicaSets(ctx context.Context, namespace string) ([]*appsv1.ReplicaSet, error)
- func (c *FakeClient) ListServiceAccounts(ctx context.Context, namespace string) ([]*corev1.ServiceAccount, error)
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 ObjectToPersistentVolume ¶
func ObjectToPersistentVolume(obj runtime.Object) (*corev1.PersistentVolume, 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) }
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) 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)
Click to show internal directories.
Click to hide internal directories.