kubernetes

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNothingLoaded = errors.New("LoadTemplate: failed load anything from manifests")

Functions

func ApplyOverlay

func ApplyOverlay(current, overlay runtime.Object) error

ApplyOverlay applies an overlay using JSON patch strategy over the current Object in place.

func GenerateManifests

func GenerateManifests(manifest string, values interface{}, funcMap template.FuncMap) ([]byte, error)

GenerateManifests generate manifests from templates, CR and values

func LoadTemplate

func LoadTemplate(manifest string, values interface{}, funcMap template.FuncMap, spec interface{}) error

LoadTemplate loads a YAML file to a component

Types

type Application

type Application struct {
	client.Client
	CR       client.Object
	FileRepo Repo
	GVK      schema.GroupVersionKind
	TmplFunc template.FuncMap
	Recorder record.EventRecorder
}

Application contains the resource of one single component which is applied to api server

func (*Application) Apply

func (a *Application) Apply(ctx context.Context, manifest string, log logr.Logger, needCompose bool) (bool, error)

Apply a template represents a component to api server

func (*Application) ApplyAll

func (a *Application) ApplyAll(ctx context.Context, manifestFiles []string, log logr.Logger) error

ApplyAll manifests dependent a single CR

func (*Application) ApplyFromObject

func (a *Application) ApplyFromObject(ctx context.Context, obj runtime.Object, log logr.Logger, needCompose bool) (bool, error)

ApplyFromObject apply an object to api server

type ErrorCollector

type ErrorCollector []error

func (*ErrorCollector) Collect

func (c *ErrorCollector) Collect(e error)

func (*ErrorCollector) Error

func (c *ErrorCollector) Error() error

type Repo

type Repo interface {
	ReadFile(path string) ([]byte, error)
	GetFilesRecursive(path string) ([]string, error)
}

Repo provides tools to access templates

Jump to

Keyboard shortcuts

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