resource

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrototyper

func AddPrototyper(kind string, p Prototyper)

AddPrototyper adds a prototyper for the given resource type to the list of supported resources of the engine

func List

func List() (ret []string)

List returns a list of the supported resource kinds

Types

type Changeable

type Changeable interface {

	// Name returns the name of this resource
	Name() string

	// Namespace returns the namespace of this resource
	Namespace() string

	// Kind returns the name of the resource type
	Kind() string

	// Changed indicates whether the resource has materially changed
	Changed(ctx context.Context, kc *k8s.Client) (bool, error)
}

A Changeable resource is a stateful kubernetes resource which tracks old and present states, making it able to indicate when a change occurs.

type Prototyper

type Prototyper interface {

	// Object returns a new empty object of this resource type
	Object() k8s.Resource

	// Changeable returns a Changeable for this resource type
	Changeable(ctx context.Context, kc *k8s.Client, namespace, name string) (Changeable, error)
}

Prototyper implements a kubernetes resource to be handled by this templating engine. It needs to be able to instantiate a kubernetes resource of its matching type, as well as create a stateful implementation of that resource which can indicate when a change of its salient details occurs.

func GetPrototyper

func GetPrototyper(kind string) (Prototyper, bool)

GetPrototyper returns a prototyper for the given resource

Jump to

Keyboard shortcuts

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