Documentation
¶
Index ¶
- Variables
- func ApplyPodFilter(pods []corev1.Pod, filters ...PodFilterFn) (result []corev1.Pod)
- func GetPodNameFromArgs(args []string) (string, error)
- func MinifyPod(pod *corev1.Pod) *corev1.Pod
- func SanitizeEditedPod(original, edited *corev1.Pod) (*corev1.Pod, error)
- type ContextOptions
- type KubeClientset
- func (client *KubeClientset) GetPod(ctx context.Context, namespace, name string) (*corev1.Pod, error)
- func (client *KubeClientset) ListPods(ctx context.Context, namespace string, filters ...PodFilterFn) ([]corev1.Pod, error)
- func (client *KubeClientset) UpdateEphemeralContainersForPod(ctx context.Context, pod *corev1.Pod) (*corev1.Pod, error)
- type KubeConfig
- type PodFilterFn
Constants ¶
This section is empty.
Variables ¶
var (
NAMESPACE_DEFAULT string = "default"
)
Functions ¶
func ApplyPodFilter ¶
func ApplyPodFilter(pods []corev1.Pod, filters ...PodFilterFn) (result []corev1.Pod)
Apply filters (if any) to a list of pods
func GetPodNameFromArgs ¶
Get pod name from CLI arguments
Types ¶
type ContextOptions ¶
Represent context with a cancel func
func (*ContextOptions) CancelContext ¶ added in v1.3.0
func (opts *ContextOptions) CancelContext()
Cancel execution context
func (*ContextOptions) InitContext ¶ added in v1.3.0
func (opts *ContextOptions) InitContext(timeout *string) error
Set up the options with the following steps: * Create a Context with timeout if any. Otherwise, no timeout is set (i.e. context.Background()) * Create a chan os.Signal to handle SIGTERM, SIGINT (Ctrl + C),SIGHUP (terminal is closed)
type KubeClientset ¶ added in v1.3.0
type KubeClientset struct {
kubernetes.Interface
}
func NewClientset ¶
func NewClientset(kubeConfig *KubeConfig) (*KubeClientset, error)
Get a clientset to interact with Kubernetes API Config precedence: * --kubeconfig flag pointing at a file * KUBECONFIG environment variable pointing at a file * $HOME/.kube/config if exists.
func (*KubeClientset) GetPod ¶ added in v1.3.0
func (client *KubeClientset) GetPod(ctx context.Context, namespace, name string) (*corev1.Pod, error)
Get pod by name in a specific namespace
func (*KubeClientset) ListPods ¶ added in v1.3.0
func (client *KubeClientset) ListPods(ctx context.Context, namespace string, filters ...PodFilterFn) ([]corev1.Pod, error)
List pods by filters in the specified namespace If namespace is empty (i.e. ""), list in all namespaces
func (*KubeClientset) UpdateEphemeralContainersForPod ¶ added in v1.3.0
func (client *KubeClientset) UpdateEphemeralContainersForPod(ctx context.Context, pod *corev1.Pod) (*corev1.Pod, error)
Update pod's ephemeralContainer subresource
type KubeConfig ¶
type KubeConfig struct { *genericclioptions.ConfigFlags *ContextOptions }
Represent kube client configurations