runtime

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidObject is returned for invalid object
	ErrInvalidObject = errors.New("object interface not implemented")
)

Functions

func FromObject

func FromObject(ro runtime.Object) (*apiv2.StepObject, error)

FromObject creates step object from runtime object

func Patch

func Patch(input *apiv2.StepObject, with *apiv2.StepObject, opts ...PatchOption) error

Patch patches the step object with give step object

func SetNamespace

func SetNamespace(ro runtime.Object, namespace string) error

SetNamespace sets namespace for runtime object

func ToObject

func ToObject(so *apiv2.StepObject) (o runtime.Object, gvk *schema.GroupVersionKind, err error)

ToObject converts step object to runtime object

func ToStructuredObject

func ToStructuredObject(obj runtime.Object) runtime.Object

ToStructuredObject converts unstructured object to structured object

func ToUnstructuredObject

func ToUnstructuredObject(so *apiv2.StepObject) (*unstructured.Unstructured, *schema.GroupVersionKind, error)

ToUnstructuredObject converts step object to unstructured object, this is useful for preserving original json serialized input in step object. Note: while patching k8s resources, we should preserve the user input, as patching can remove fields; which are represented as null values in the patch

Types

type PatchMeta

type PatchMeta struct {
	Annotations map[string]string
}

PatchMeta is the metadata to be added while patching

type PatchOption

type PatchOption func(*PatchMeta)

PatchOption is the functional patch option

func AddAnnotations

func AddAnnotations(annotations map[string]string) PatchOption

AddAnnotations adds annotations to object

Jump to

Keyboard shortcuts

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