podservice

package
v0.0.0-...-cae2324 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PodMaker

func PodMaker(spec api.PodSpec) []pod.PodRecipe

Types

type PodService

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

func NewPodService

func NewPodService() (*PodService, error)

func (*PodService) AddPod

func (p *PodService) AddPod(newPod pod.PodRecipe)

This will add one pod to the pipeline

func (*PodService) CheckAllPodsStatus

func (p *PodService) CheckAllPodsStatus()

Checks the status of all the pods When some pod status changes from running to stop we ping the deployment controller about the same and then we remove that pod from our list the deployment controller will then send a new request to create a new pod NOTE: This function might cause lots of issues without a mutex find out why its crashing on addition of mutex and fix this on priority basis

func (*PodService) CreatePod

func (p *PodService) CreatePod(spec pod.PodRecipe) error

Create Pod from PodRecipe This function is called from the PodSink() function of the pipeline

func (*PodService) DeleteAllPods

func (p *PodService) DeleteAllPods() error

Delete All Pods

func (*PodService) DeletePodById

func (p *PodService) DeletePodById(id string) error

Delete Pod by ID NOTE: Removal from pod list yet to be imolement

func (*PodService) DeletePodBySelector

func (p *PodService) DeletePodBySelector(spec pod.PodRecipe) error

func (*PodService) DeletePodsBySelector

func (p *PodService) DeletePodsBySelector(selector string, count uint) error

Delete specified number of pods by selector

func (*PodService) GetAllContainers

func (p *PodService) GetAllContainers() ([]types.Container, error)

Gets all the docker containers, running or not running

func (*PodService) GetAllPods

func (p *PodService) GetAllPods() []*pod.Pod

Get All Pods in service

func (*PodService) GetContainer

func (p *PodService) GetContainer(id string) (*types.ContainerJSON, error)

Get Container By ID

func (*PodService) GetFirstPodWithSelector

func (p *PodService) GetFirstPodWithSelector(selector string) *pod.Pod

Gets the first pod in the pod list with given selector

func (*PodService) GetPodById

func (p *PodService) GetPodById(id string) *pod.Pod

Get Pod By ID

func (*PodService) GetPodByName

func (p *PodService) GetPodByName(name string) *pod.Pod

Get Pod by Name

func (*PodService) GetPodIndex

func (p *PodService) GetPodIndex(pod *pod.Pod) int

func (*PodService) GetPodsBySelector

func (p *PodService) GetPodsBySelector(selector string) []*pod.Pod

Get Pods by Selector

func (*PodService) GetPodsStatusBySelector

func (p *PodService) GetPodsStatusBySelector(selector string) uint

func (*PodService) ListPodLogsByID

func (p *PodService) ListPodLogsByID(id string) (io.ReadCloser, error)

List logs of pod by ID

func (*PodService) PodSink

func (p *PodService) PodSink()

This will act like a sink/consumer for our pipeline of pod creation Instead of a queue, we use a channel that acts like a queue

func (*PodService) PodSource

func (p *PodService) PodSource(spec api.PodSpec) error

Acts as source for pod

func (*PodService) RemovePodByID

func (p *PodService) RemovePodByID(id string) error

Remove Pod by ID

func (*PodService) RunAllPods

func (p *PodService) RunAllPods() error

Run All Pods

func (*PodService) RunPodBySelector

func (p *PodService) RunPodBySelector(selector string) error

Run Pod by Selector

func (*PodService) StopPodByID

func (p *PodService) StopPodByID(id string) error

Stop Pod by ID

func (*PodService) StopPodBySelector

func (p *PodService) StopPodBySelector(selector string) error

Stop Pod By Selector Name

Jump to

Keyboard shortcuts

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