kubernetes

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeClient

type KubeClient interface {
	GetServicesForLB(ctx context.Context) ([]*v1.Service, error)
	GetConfig(ctx context.Context, namespace string, name string, config string) (string, error)
	GetService(ctx context.Context, namespace string, name string) (*v1.Service, error)
	GetConfigMap(ctx context.Context, namespace string, name string) (*v1.ConfigMap, error)
	PatchService(ctx context.Context, namespace string, name string, patch *Patch) (metav1.Object, error)
	WatchService(ctx context.Context) (chan [2]metav1.Object, context.CancelFunc)
}

func NewKubeClient

func NewKubeClient(kubeconfig string, logger logger.Logger) (KubeClient, error)

type MetaObject

type MetaObject interface {
	GetLabels() map[string]string
	GetAnnotations() map[string]string
}

type Patch

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

func NewPatch

func NewPatch(set ...PatchSet) *Patch

func (*Patch) Add

func (p *Patch) Add(set PatchSet)

Add a set of patches

func (*Patch) Remove

func (p *Patch) Remove(path string)

Remove a value

func (*Patch) RemoveAnnotation

func (p *Patch) RemoveAnnotation(key string)

RemoveAnnotation adds a patch set to remove a label

func (*Patch) RemoveLabel

func (p *Patch) RemoveLabel(key string)

RemoveLabel adds a patch set to remove a label

func (*Patch) Set

func (p *Patch) Set(path string, value string)

Set a value

func (*Patch) SetAnnotation

func (p *Patch) SetAnnotation(o MetaObject, key string, value string)

SetAnnotation adds a patch set to set an annotation

func (*Patch) SetLabel

func (p *Patch) SetLabel(o MetaObject, key string, value string)

SetLabel adds a patch set to set a label

func (*Patch) String

func (p *Patch) String() string

type PatchSet

type PatchSet []interface{}

Jump to

Keyboard shortcuts

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