template

package
v0.8.0-beta.43 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateObjectsFromDirectory

func CreateObjectsFromDirectory(rootPath string) ([]client.Object, error)

func CreateTypedObjectFromYamlByte

func CreateTypedObjectFromYamlByte[T generics.Object, PT generics.PObject[T], L generics.ObjList[T], PL generics.PObjList[T, L]](yamlBytes []byte, _ func(T, PT, L, PL)) PT

func CustomizedObjFromYaml

func CustomizedObjFromYaml[T generics.Object, PT generics.PObject[T], L generics.ObjList[T], PL generics.PObjList[T, L]](filePath string, signature func(T, PT, L, PL)) (PT, error)

func CustomizedObjectListFromYaml

func CustomizedObjectListFromYaml[T generics.Object, PT generics.PObject[T], L generics.ObjList[T], PL generics.PObjList[T, L]](yamlfile string, signature func(T, PT, L, PL)) ([]PT, error)

func GetTypedResourceObjectBySignature

func GetTypedResourceObjectBySignature[T generics.Object, PT generics.PObject[T], L generics.ObjList[T], PL generics.PObjList[T, L]](objects []client.Object, _ func(T, PT, L, PL), matchers ...MatchResourceFunc) PT

func HelmTemplate

func HelmTemplate(helmPath string, helmOutput string) error

func NewComponentTemplateRenderCmd

func NewComponentTemplateRenderCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command

func NewWorkflowTemplateRender

func NewWorkflowTemplateRender(helmTemplateDir string, opts RenderedOptions, clusterDef, clusterVersion string) (*templateRenderWorkflow, error)

func RandomString

func RandomString(n int) string

func SetGetReturnedObject

func SetGetReturnedObject(out client.Object, expectedObj client.Object)

func SetListReturnedObjects

func SetListReturnedObjects(list client.ObjectList, objects []runtime.Object) error

Types

type Handler

type Handler = func(obj runtime.Object) error

type MatchResourceFunc

type MatchResourceFunc func(object client.Object) bool

func WithResourceName

func WithResourceName(name string) MatchResourceFunc

type RenderedOptions

type RenderedOptions struct {
	ConfigSpec string

	// mock cluster object
	Name      string
	Namespace string

	Replicas       int32
	DataVolumeName string
	ComponentName  string

	CPU    string
	Memory string
}

type ResourceHandler

type ResourceHandler struct {
	Matcher []ResourceMatcher
	Handler Handler
}

type ResourceMatcher

type ResourceMatcher = func(obj runtime.Object) bool

Jump to

Keyboard shortcuts

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