resource

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObjectFromGVK added in v0.2.0

func NewObjectFromGVK(gvk schema.GroupVersionKind, scheme *runtime.Scheme) (client.Object, error)

NewObjectFromGVK instanciates a new client.Object for the provided GVK. GVK should be known in the provided scheme.

Types

type Builder

type Builder interface {
	// Build returns the initial object.
	// Most of the time, it should only return object with its object metas
	Build() client.Object
	// Enabled returns whenever the builder is enabled in the current context.
	// It's a convenient method to know if the resource created by the builder should be created or deleted.
	Enabled() bool
	// Update updates the provided object to match builder's expected resource state.
	Update(client.Object) error
}

A Builder provides features to create a kubernetes resource.

type Comparer

type Comparer interface {
	Equal()
}

A Comparer provides a custom function to compare two resources returned by a Builder.

type Dependency

type Dependency struct {
	Object    client.Object
	Name      string
	Namespace string
}

A Dependency is a reference to an object using its name, namespace and its object kind.

type Status

type Status struct {
	GVK       schema.GroupVersionKind
	Name      string
	Namespace string
	Labels    map[string]string
	Ready     bool
}

func GetStatus added in v0.2.0

func GetStatus(res client.Object) (*Status, error)

GetStatus returns the provided object's status.

Jump to

Keyboard shortcuts

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