namespace

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERR_TYPE = fmt.Errorf("type must be *corev1.Namespace, corev1.Namespace or string")

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Options *typed.HandlerOptions
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, kubeconfig string) (handler *Handler, err error)

New returns a namespace handler from kubeconfig or in-cluster config.

func (*Handler) Apply

func (h *Handler) Apply(filename string) (*corev1.Namespace, error)

Apply apply namespace from yaml file, alias to "ApplyFromFile".

func (*Handler) ApplyFromBytes

func (h *Handler) ApplyFromBytes(data []byte) (namespace *corev1.Namespace, err error)

ApplyFromBytes apply namespace from bytes.

func (*Handler) ApplyFromFile

func (h *Handler) ApplyFromFile(filename string) (namespace *corev1.Namespace, err error)

ApplyFromFile apply namespace from yaml file.

func (*Handler) ApplyFromRaw

func (h *Handler) ApplyFromRaw(raw map[string]interface{}) (*corev1.Namespace, error)

ApplyFromRaw apply namespace from map[string]interface{}.

func (*Handler) Clientset added in v0.2.0

func (h *Handler) Clientset() *kubernetes.Clientset

func (*Handler) Create

func (h *Handler) Create(filename string) (*corev1.Namespace, error)

Create create namespace from yaml file, alias to "CreateFromFile".

func (*Handler) CreateFromBytes

func (h *Handler) CreateFromBytes(data []byte) (*corev1.Namespace, error)

CreateFromBytes create namespace from bytes.

func (*Handler) CreateFromFile

func (h *Handler) CreateFromFile(filename string) (*corev1.Namespace, error)

CreateFromFile create namespace from yaml file.

func (*Handler) CreateFromRaw

func (h *Handler) CreateFromRaw(raw map[string]interface{}) (*corev1.Namespace, error)

CreateFromRaw create namespace from map[string]interface{}.

func (*Handler) DeepCopy

func (in *Handler) DeepCopy() *Handler

func (*Handler) Delete

func (h *Handler) Delete(name string) error

Delete delete namespace by name, alias to "DeleteByName".

func (*Handler) DeleteByName

func (h *Handler) DeleteByName(name string) error

DeleteByName delete namespace by name.

func (*Handler) DeleteFromBytes

func (h *Handler) DeleteFromBytes(data []byte) error

DeleteFromBytes delete namespace from bytes.

func (*Handler) DeleteFromFile

func (h *Handler) DeleteFromFile(path string) error

DeleteFromFile delete namespace from yaml file.

func (*Handler) DiscoveryClient added in v0.2.0

func (h *Handler) DiscoveryClient() *discovery.DiscoveryClient

func (*Handler) DynamicClient added in v0.2.0

func (h *Handler) DynamicClient() dynamic.Interface

func (*Handler) Get

func (h *Handler) Get(name string) (*corev1.Namespace, error)

Get get namespace by name, alias to "GetByName".

func (*Handler) GetAge added in v0.2.0

func (h *Handler) GetAge(object interface{}) (time.Duration, error)

func (*Handler) GetByName

func (h *Handler) GetByName(name string) (*corev1.Namespace, error)

GetByName get namespace by name.

func (*Handler) GetFromBytes

func (h *Handler) GetFromBytes(data []byte) (*corev1.Namespace, error)

GetFromBytes get namespace from bytes.

func (*Handler) GetFromFile

func (h *Handler) GetFromFile(filename string) (*corev1.Namespace, error)

GetFromFile get namespace from yaml file.

func (*Handler) List

func (h *Handler) List(labels string) (*corev1.NamespaceList, error)

List list namespaces by labels, alias to "ListByLabel".

func (*Handler) ListAll

func (h *Handler) ListAll(labels string) (*corev1.NamespaceList, error)

ListAll list all namespaces in the k8s cluster.

func (*Handler) ListByLabel

func (h *Handler) ListByLabel(labels string) (*corev1.NamespaceList, error)

ListByLabel list namespaces by labels.

func (*Handler) RESTClient added in v0.2.0

func (h *Handler) RESTClient() *rest.RESTClient

func (*Handler) RunInformer

func (h *Handler) RunInformer(
	addFunc func(obj interface{}),
	updateFunc func(oldObj, newObj interface{}),
	deleteFunc func(obj interface{}),
	stopCh chan struct{})

RunInformer

func (*Handler) SetForceDelete

func (h *Handler) SetForceDelete(force bool)

func (*Handler) SetLimit

func (h *Handler) SetLimit(limit int64)

func (*Handler) SetTimeout

func (h *Handler) SetTimeout(timeout int64)

func (*Handler) Update

func (h *Handler) Update(filename string) (*corev1.Namespace, error)

Update update namespace from yaml file, alias to "UpdateFromFile".

func (*Handler) UpdateFromBytes

func (h *Handler) UpdateFromBytes(data []byte) (*corev1.Namespace, error)

UpdateFromBytes update namespace from bytes.

func (*Handler) UpdateFromFile

func (h *Handler) UpdateFromFile(filename string) (*corev1.Namespace, error)

UpdateFromFile update namespace from yaml file.

func (*Handler) UpdateFromRaw

func (h *Handler) UpdateFromRaw(raw map[string]interface{}) (*corev1.Namespace, error)

UpdateFromRaw update namespace from map[string]interface{}.

func (*Handler) Watch

func (h *Handler) Watch(name string,
	addFunc, modifyFunc, deleteFunc func(x interface{}), x interface{}) (err error)

Watch watch namespace by name, alias to "WatchByName".

func (*Handler) WatchByLabel

func (h *Handler) WatchByLabel(labelSelector string,
	addFunc, modifyFunc, deleteFunc func(x interface{}), x interface{}) (err error)

WatchByLabel watch namespace by label.

func (*Handler) WatchByName

func (h *Handler) WatchByName(name string,
	addFunc, modifyFunc, deleteFunc func(x interface{}), x interface{}) (err error)

WatchByName watch namespace by name.

func (*Handler) WithDryRun

func (h *Handler) WithDryRun() *Handler

Jump to

Keyboard shortcuts

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