podManager

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

*

  • File : helpers.go
  • Author : Alexandre Saison <alexandre.saison@inarix.com>
  • Date : 28.12.2020
  • Last Modified Date: 04.05.2021
  • Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>

*

  • File : job.go
  • Author : Alexandre Saison <alexandre.saison@inarix.com>
  • Date : 29.12.2020
  • Last Modified Date: 04.05.2021
  • Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>

* * File : main.go * Author : Alexandre Saison <alexandre.saison@inarix.com> * Date : 09.12.2020 * Last Modified Date: 22.01.2021 * Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>

*

  • File : pod.go
  • Author : Alexandre Saison <alexandre.saison@inarix.com>
  • Date : 29.12.2020
  • Last Modified Date: 06.04.2021
  • Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>

Index

Constants

View Source
const (
	POD_STATUS_SUCCESS = "Succeeded"
	POD_STATUS_FAILED  = "Failed"
)

Variables

This section is empty.

Functions

func DefaultHandlerWaitingFunc

func DefaultHandlerWaitingFunc(watcher watch.Interface, pod *v1.Pod) (string, error)

Types

type HandlerWaitingFunc

type HandlerWaitingFunc func(watcher watch.Interface, pod *v1.Pod) error

type PodManager

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

func New

func New(inCluster bool) *PodManager

func (*PodManager) CreateConfigRefSpec

func (pm *PodManager) CreateConfigRefSpec(configMapRefsNames []string) []v1.ConfigMapEnvSource

func (*PodManager) CreateEnvsRefSpec

func (pm *PodManager) CreateEnvsRefSpec(envMapRefsValues map[string]string) []v1.EnvVar

func (*PodManager) CreateJob

func (pm *PodManager) CreateJob(namespace string, prefixName string, jobSpec batchv1.JobSpec) (*v1.Pod, error)

func (*PodManager) CreateJobSpec

func (pm *PodManager) CreateJobSpec(jobNamePrefix string, containerName string, containerImage string, envs []v1.EnvVar, configMapRefs []v1.ConfigMapEnvSource) *batchv1.JobSpec

func (*PodManager) DeleteJob

func (pm *PodManager) DeleteJob(namespace string, jobName string) error

func (*PodManager) DeletePod

func (pm *PodManager) DeletePod(namespace string, podName string) error

func (*PodManager) GetPod

func (pm *PodManager) GetPod(namespace string, podName string) (*v1.Pod, error)

func (*PodManager) GetPodLogs

func (pm *PodManager) GetPodLogs(namespace string, podName string) (string, string, error)

GetPodLogs: use namespace and podName args to fetch logs of an ended pod. Most of the time, it is used for Jobs since waits for pod to be completed. @args namespace: Namespace of the pod to watch for logs. @args podName: Name of the pod's logs to fetch on previously specified namespace. @returns (string, string, error): string -> returns the logs of the ended pod. string -> returns last post status (Completed/Error/Oom ...) error -> any error from kubernetes api.

func (*PodManager) GetPods

func (pm *PodManager) GetPods(namespace string) (*v1.PodList, error)

func (*PodManager) WaitForPodReady

func (pm *PodManager) WaitForPodReady(namespace string, pod *v1.Pod) (string, error)

Jump to

Keyboard shortcuts

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