Documentation ¶
Index ¶
- func AddLabel(pod *v1.Pod, key, value string) error
- func AddPodLabel(name, project, namespace, key, value string) error
- func GetPod(namespace, name, project string) (*v1.Pod, error)
- func InitPodWatch()
- func K8SClient() *kubernetes.Clientset
- func PodName(pod *v1.Pod) (string, string, error)
- func RemoveLabel(pod *v1.Pod, key string) error
- func RemovePodLabel(name, project, namespace, key string) error
- type MergePodType
- type PodWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPodLabel ¶
AddPodLabel adds a label to the XDC pod with the given name.
func InitPodWatch ¶
func InitPodWatch()
InitPodwatch is required to be called befora any podatch methods. Call in your client init().
func K8SClient ¶
func K8SClient() *kubernetes.Clientset
func RemoveLabel ¶
RemoveLabel removes the given label from the given pod.
func RemovePodLabel ¶
RemovePodLabel - removes the label
Types ¶
type MergePodType ¶
type MergePodType int32
MergePodType describes all possible pod types that Merge will spawn.
const ( // NOTMERGE is not a merge pod. NOTMERGE MergePodType = 0 // XDC is an XDC XDC MergePodType = 1 // JUMP is an ssh jump host JUMP MergePodType = 2 )
type PodWatcher ¶
type PodWatcher struct { // On* functcions get called when that event happens. The interface is a k8s core API *v1.Pod. OnPodAdd func(pod *v1.Pod) OnPodDelete func(obj *v1.Pod) OnPodUpdate func(prevObj, newObj *v1.Pod) // The namespace in which to watch for events. (The XDC namespace.) Namespace string // Control callback events. Unfiltered bool // if true get all underlying k8s pod events. // Number of workers to allocate to handle events. If not given, 10 is used. WorkerPoolSize int }
PodWatcher encapsulates a client that gets pod events. Podwatcher gets events from k8s, filters out the noise, then invokes the given callbacks (OnPodadd, OnPodUpdate, OnPodDelete), in a worker thread.
func (*PodWatcher) Watch ¶
func (pw *PodWatcher) Watch()
Watch keeps track of pod events and sets up the configured callbacks. This method does not return.
Click to show internal directories.
Click to hide internal directories.