Documentation ¶
Index ¶
- func GetEnvVar(podSpec corev1.PodSpec, envName string) *corev1.EnvVar
- type Client
- type ClientAsync
- type ClientAsyncImpl
- func (c ClientAsyncImpl) GetEnvValueAsync(channel chan<- EnvValueReturn, podSpec corev1.PodSpec, namespace string, ...)
- func (c ClientAsyncImpl) GetPodsAsync(channel chan<- Pods, workload *Workload)
- func (c ClientAsyncImpl) GetWorkloadAsync(channel chan<- WorkloadReturn, args args.KubernetesArgs)
- func (c ClientAsyncImpl) ScaleAsync(channel chan<- error, resource *Workload, replicas int32)
- func (c ClientAsyncImpl) Sync() Client
- func (c ClientAsyncImpl) VerifyNoHorizontalPodAutoscalerAsync(channel chan<- error, args args.KubernetesArgs)
- type ClientImpl
- func (c ClientImpl) GetEnvValue(podSpec corev1.PodSpec, namespace string, envName string) (string, error)
- func (c ClientImpl) GetPods(workload *Workload) ([]corev1.Pod, error)
- func (c ClientImpl) GetWorkload(args args.KubernetesArgs) (*Workload, error)
- func (c ClientImpl) Scale(resource *Workload, replicas int32) error
- func (c ClientImpl) VerifyNoHorizontalPodAutoscaler(args args.KubernetesArgs) error
- type EnvValueReturn
- type Pods
- type Workload
- type WorkloadReturn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { GetWorkload(args args.KubernetesArgs) (*Workload, error) VerifyNoHorizontalPodAutoscaler(args args.KubernetesArgs) error Scale(resource *Workload, replicas int32) error GetEnvValue(podSpec corev1.PodSpec, namespace string, envName string) (string, error) GetPods(workload *Workload) ([]corev1.Pod, error) }
Client is a wrapper around the client-go package for Kubernetes
type ClientAsync ¶
type ClientAsync interface { Sync() Client GetWorkloadAsync(channel chan<- WorkloadReturn, args args.KubernetesArgs) VerifyNoHorizontalPodAutoscalerAsync(channel chan<- error, args args.KubernetesArgs) ScaleAsync(channel chan<- error, resource *Workload, replicas int32) GetEnvValueAsync(channel chan<- EnvValueReturn, podSpec corev1.PodSpec, namespace string, envName string) GetPodsAsync(channel chan<- Pods, workload *Workload) }
ClientAsync is a wrapper around the client-go package for Kubernetes
func MakeFromClient ¶
func MakeFromClient(syncClient Client) ClientAsync
MakeFromClient returns a ClientAsync from the given sync client
type ClientAsyncImpl ¶
type ClientAsyncImpl struct {
// contains filtered or unexported fields
}
ClientAsyncImpl is the interface implementation of ClientAsync
func (ClientAsyncImpl) GetEnvValueAsync ¶
func (c ClientAsyncImpl) GetEnvValueAsync(channel chan<- EnvValueReturn, podSpec corev1.PodSpec, namespace string, envName string)
GetEnvValueAsync gets an environment variable value from a pod
func (ClientAsyncImpl) GetPodsAsync ¶
func (c ClientAsyncImpl) GetPodsAsync(channel chan<- Pods, workload *Workload)
GetPodsAsync gets all pods attached to some workload
func (ClientAsyncImpl) GetWorkloadAsync ¶
func (c ClientAsyncImpl) GetWorkloadAsync(channel chan<- WorkloadReturn, args args.KubernetesArgs)
GetWorkloadAsync retrieves a Workload
func (ClientAsyncImpl) ScaleAsync ¶
func (c ClientAsyncImpl) ScaleAsync(channel chan<- error, resource *Workload, replicas int32)
ScaleAsync scales a given Kubernetes resource
func (ClientAsyncImpl) Sync ¶
func (c ClientAsyncImpl) Sync() Client
Sync returns the synchronous client
func (ClientAsyncImpl) VerifyNoHorizontalPodAutoscalerAsync ¶
func (c ClientAsyncImpl) VerifyNoHorizontalPodAutoscalerAsync(channel chan<- error, args args.KubernetesArgs)
VerifyNoHorizontalPodAutoscalerAsync returns an error if the given resource has a HorizontalPodAutoscaler
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
ClientImpl is the interface implementation of Client
func (ClientImpl) GetEnvValue ¶
func (c ClientImpl) GetEnvValue(podSpec corev1.PodSpec, namespace string, envName string) (string, error)
GetEnvValue gets an environment variable value from a pod
func (ClientImpl) GetPods ¶
func (c ClientImpl) GetPods(workload *Workload) ([]corev1.Pod, error)
GetPods gets all pods attached to some workload
func (ClientImpl) GetWorkload ¶
func (c ClientImpl) GetWorkload(args args.KubernetesArgs) (*Workload, error)
GetWorkload retrieves a Workload
func (ClientImpl) Scale ¶
func (c ClientImpl) Scale(resource *Workload, replicas int32) error
Scale scales a given Kubernetes resource
func (ClientImpl) VerifyNoHorizontalPodAutoscaler ¶
func (c ClientImpl) VerifyNoHorizontalPodAutoscaler(args args.KubernetesArgs) error
VerifyNoHorizontalPodAutoscaler returns an error if the given resource has a HorizontalPodAutoscaler
type EnvValueReturn ¶
EnvValueReturn is a wrapper around string to allow returning multiple values in a channel
type Workload ¶
type Workload struct { metav1.ObjectMeta metav1.TypeMeta // FriendlyName is the name used to reference the resource in the CLI, ex: deployment/myapp FriendlyName string // The label selector used to match pods PodSelector *metav1.LabelSelector // If the resource has a pod template, this should be set PodTemplateSpec *corev1.PodTemplateSpec }
Workload represents a "base struct" for Kubernetes workloads
func GetWorkload ¶
func GetWorkload(resource *appsv1.StatefulSet) (*Workload, error)
GetWorkload creates a KubernetesWorkload from a StatefulSet
type WorkloadReturn ¶
WorkloadReturn is used to fix the issue with channels not supporting pair return values