v1alpha2

package
v0.0.0-...-a88c85e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNestedString

func GetNestedString(obj map[string]interface{}, fields ...string) string

GetNestedString returns the string value of a nested field.

Types

type Builder

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

Builder enables building of an Unstructured instance

func BuilderForObject

func BuilderForObject(obj *unstructured.Unstructured) *Builder

BuilderForObject returns a new instance of Unstruct Builder by making use of the provided object

func BuilderForYaml

func BuilderForYaml(doc string) *Builder

BuilderForYaml returns a new instance of Unstruct Builder by making use of the provided YAML

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns a new instance of empty Builder

func (*Builder) Build

func (b *Builder) Build() (*Unstruct, error)

Build returns the Unstruct object created by the Builder

func (*Builder) BuildAPIUnstructured

func (b *Builder) BuildAPIUnstructured() (*unstructured.Unstructured, error)

BuildAPIUnstructured returns the Unstruct object created by the Builder

type CreateFn

CreateFn is a typed function that abstracts creating of unstructured object

type CreateOption

type CreateOption struct {
	*metav1.CreateOptions
	// contains filtered or unexported fields
}

CreateOption holds the kubernetes option to create a resource

func NewCreateOption

func NewCreateOption(cOpts ...CreateOptionFn) *CreateOption

NewCreateOption returns a new instance of CreateOption

type CreateOptionFn

type CreateOptionFn func(*CreateOption)

CreateOptionFn abstracts the construction of CreateOption

func WithCreateOption

func WithCreateOption(opt metav1.CreateOptions) CreateOptionFn

WithCreateOption is CreateOptionFn to provide kubernetes createOption for creating a resource

func WithCreateSubResources

func WithCreateSubResources(r ...string) CreateOptionFn

WithCreateSubResources is CreateOptionFn to kubernetes subresources during resource creation

type DeleteFn

type DeleteFn func(
	cli dynamic.Interface,
	obj *unstructured.Unstructured,
	opt *DeleteOption,
) error

DeleteFn is a typed function that abstract deletion of unstructured object

type DeleteOption

type DeleteOption struct {
	*metav1.DeleteOptions
	// contains filtered or unexported fields
}

DeleteOption holds kubernetes options to delete a resource

func NewDeleteOption

func NewDeleteOption(dOpts ...DeleteOptionFn) *DeleteOption

NewDeleteOption returns a new instance of DeleteOption

type DeleteOptionFn

type DeleteOptionFn func(*DeleteOption)

DeleteOptionFn abstracts the construvtion of delete option

func WithDeleteOption

func WithDeleteOption(deleteOpt *metav1.DeleteOptions) DeleteOptionFn

WithDeleteOption is a DeleteOptionFn to provide kubernetes delete option

func WithDeleteSubResources

func WithDeleteSubResources(r ...string) DeleteOptionFn

WithDeleteSubResources is a DeleteOptionFn to provide subresources during delete

type GetFn

type GetFn func(
	cli dynamic.Interface,
	name string,
	namespace string, opt *GetOption,
) (*unstructured.Unstructured, error)

GetFn is a typed function that abstracts fetching of unstructured object

type GetOption

type GetOption struct {
	*metav1.GetOptions
	// contains filtered or unexported fields
}

GetOption holds the kubernetes options to get a resource

func NewGetOption

func NewGetOption(gOpts ...GetOptionFn) *GetOption

NewGetOption returns a new instance of GetOption

type GetOptionFn

type GetOptionFn func(*GetOption)

GetOptionFn abstracts the construction of GetOption

func WithGetNamespace

func WithGetNamespace(namespace string) GetOptionFn

WithGetNamespace is a GetOptionFn to provide namespace

func WithGetOption

func WithGetOption(getOption metav1.GetOptions) GetOptionFn

WithGetOption is a GetOptionsFn to provide kubernetes getoption

func WithGetSubResources

func WithGetSubResources(r ...string) GetOptionFn

WithGetSubResources is a GetOptionFn to provide subresources

func WithGroupVersionResource

func WithGroupVersionResource(r schema.GroupVersionResource) GetOptionFn

WithGroupVersionResource is a GetOptionFn to provide GroupResourceVersion

type Kubeclient

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

Kubeclient enables kubernetes API operations on catalog instance

func NewKubeClient

func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeClient returns a new instance of Kubeclient meant for catalog operations

func (*Kubeclient) Create

func (k *Kubeclient) Create(u *unstructured.Unstructured, opts ...CreateOptionFn) error

Create creates an unstructured instance at kubernetes cluster

func (*Kubeclient) CreateAllOrNone

func (k *Kubeclient) CreateAllOrNone(u ...*unstructured.Unstructured) []error

CreateAllOrNone creates all the provided unstructured instances at kubernetes cluster or none in case of any error

func (*Kubeclient) Delete

func (k *Kubeclient) Delete(u *unstructured.Unstructured, opts ...DeleteOptionFn) error

Delete deletes the unstructured instance from kubernetes cluster

func (*Kubeclient) DeleteAll

func (k *Kubeclient) DeleteAll(u ...*unstructured.Unstructured) []error

DeleteAll deletes all the provided unstructured instances at kubernetes cluster

func (*Kubeclient) Get

func (k *Kubeclient) Get(name string, opts ...GetOptionFn) (*unstructured.Unstructured, error)

Get returns an unstructured instance from kubernetes cluster

type KubeclientBuildOption

type KubeclientBuildOption func(*Kubeclient)

KubeclientBuildOption defines the abstraction to build a Kubeclient instance

func WithClient

WithClient sets the kubernetes client against the Kubeclient instance

func WithKubeConfigPath

func WithKubeConfigPath(kubeConfigPath string) KubeclientBuildOption

WithKubeConfigPath sets kubeconfig path against this client instance

type ListBuilder

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

ListBuilder enables building a list of an Unstruct instance

func ListBuilderForObjects

func ListBuilderForObjects(objs ...*unstructured.Unstructured) *ListBuilder

ListBuilderForObjects returns a mew instance of list Unstruct Builder by making use of the provided Unstructured object

func ListBuilderForYamls

func ListBuilderForYamls(yamls ...string) *ListBuilder

ListBuilderForYamls returns a new instance of list Unstruct Builder by making use of the provided YAMLs

func (*ListBuilder) Build

func (l *ListBuilder) Build() ([]*Unstruct, error)

Build returns the list of Unstruct objects created by the Builder

type Unstruct

type Unstruct struct {
	Object *unstructured.Unstructured
}

Unstruct holds an object of Unstructured

func (*Unstruct) GetUnstructured

func (u *Unstruct) GetUnstructured() *unstructured.Unstructured

GetUnstructured converts Unstruct object to API's Unstructured

type UnstructList

type UnstructList struct {
	Items []*Unstruct
}

UnstructList contains a list of Unstructured items

func FromURL

func FromURL(url string) (UnstructList, error)

FromURL provides the unstructured objects from given url

Jump to

Keyboard shortcuts

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