namespace

package
v0.0.0-...-6085a8f Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalOptions

type AdditionalOptions func(builder *Builder) (*Builder, error)

AdditionalOptions additional options for namespace object.

type Builder

type Builder struct {
	// Namespace definition. Used to create namespace object.
	Definition *corev1.Namespace
	// Created namespace object
	Object *corev1.Namespace
	// contains filtered or unexported fields
}

Builder provides struct for namespace object containing connection to the cluster and the namespace definitions.

func List

func List(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*Builder, error)

List returns namespace inventory.

func NewBuilder

func NewBuilder(apiClient *clients.Settings, name string) *Builder

NewBuilder creates new instance of Builder.

func Pull

func Pull(apiClient *clients.Settings, nsname string) (*Builder, error)

Pull loads existing namespace in to Builder struct.

func (*Builder) CleanObjects

func (builder *Builder) CleanObjects(cleanTimeout time.Duration, objects ...schema.GroupVersionResource) error

CleanObjects removes given objects from the namespace.

func (*Builder) Create

func (builder *Builder) Create() (*Builder, error)

Create makes a namespace in the cluster and stores the created object in struct.

func (*Builder) Delete

func (builder *Builder) Delete() error

Delete removes a namespace.

func (*Builder) DeleteAndWait

func (builder *Builder) DeleteAndWait(timeout time.Duration) error

DeleteAndWait deletes a namespace and waits until it is removed from the cluster.

func (*Builder) Exists

func (builder *Builder) Exists() bool

Exists checks whether the given namespace exists.

func (*Builder) RemoveLabels

func (builder *Builder) RemoveLabels(labels map[string]string) *Builder

RemoveLabels removes given label from Node metadata.

func (*Builder) Update

func (builder *Builder) Update() (*Builder, error)

Update renovates the existing namespace object with the namespace definition in builder.

func (*Builder) WithLabel

func (builder *Builder) WithLabel(key string, value string) *Builder

WithLabel redefines namespace definition with the given label.

func (*Builder) WithMultipleLabels

func (builder *Builder) WithMultipleLabels(labels map[string]string) *Builder

WithMultipleLabels redefines namespace definition with the given labels.

func (*Builder) WithOptions

func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder

WithOptions creates namespace with generic mutation options.

Jump to

Keyboard shortcuts

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