utils

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodeObject added in v0.0.5

func GetNodeObject(clientset *kubernetes.Clientset, hostnameOverride string) (*apiv1.Node, error)

GetNodeObject returns the node API object for the node

func GetPodCidrFromCniSpec

func GetPodCidrFromCniSpec(cniConfFilePath string) (net.IPNet, error)

GetPodCidrFromCniSpec gets pod CIDR allocated to the node from CNI spec file and returns it

func GetPodCidrFromNodeSpec

func GetPodCidrFromNodeSpec(clientset *kubernetes.Clientset, hostnameOverride string) (string, error)

GetPodCidrFromNodeSpec reads the pod CIDR allocated to the node from API node object and returns it

func InsertPodCidrInCniSpec

func InsertPodCidrInCniSpec(cniConfFilePath string, cidr string) error

InsertPodCidrInCniSpec inserts the pod CIDR allocated to the node by kubernetes controlller manager and stored it in the CNI specification

Types

type Broadcaster

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

Broadcaster holds the details of registered listeners

func NewBroadcaster

func NewBroadcaster() *Broadcaster

NewBroadcaster returns an instance of Broadcaster object

func (*Broadcaster) Add

func (b *Broadcaster) Add(listener Listener)

Add lets to register a listener

func (*Broadcaster) Notify

func (b *Broadcaster) Notify(instance interface{})

Notify notifies an update to registered listeners

type Listener

type Listener interface {
	OnUpdate(instance interface{})
}

type ListenerFunc

type ListenerFunc func(instance interface{})

func (ListenerFunc) OnUpdate

func (f ListenerFunc) OnUpdate(instance interface{})

Jump to

Keyboard shortcuts

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