template

package
v0.6.40 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRepo

func AddRepo(repoName, repoUrl string, settings *cli.EnvSettings) error

func FieldPath

func FieldPath(fieldPath []interface{}) string

FieldPath formats a list of KRM field keys as a JSONPath expression. The only valid field keys in KRM are strings (map keys) and ints (list keys). Simple strings (see isSimpleString) will be delimited with a period. Complex strings will be wrapped with square brackets and double quotes. Integers will be wrapped with square brackets. All other types will be formatted best-effort within square brackets.

func GetActionConfig

func GetActionConfig(namespace string, settings *cli.EnvSettings) (*action.Configuration, error)

GetActionConfig now receives EnvSettings instead of using a global

func HelmSettings

func HelmSettings() (*cli.EnvSettings, error)

func Invalid

func Invalid(fieldPath []interface{}, value interface{}, detail string) *field.Error

Invalid returns a *Error indicating "invalid value". This is used to report malformed values (e.g. failed regex match, too long, out of bounds).

func InvalidType

func InvalidType(fieldPath []interface{}, value interface{}, validTypes string) *field.Error

InvalidType returns a *Error indicating "invalid value type". This is used to report malformed values (e.g. found int, expected string).

func IsCRD

func IsCRD(u *unstructured.Unstructured) bool

IsCRD returns true if the passed Unstructured object has GroupKind == Extensions/CustomResourceDefinition; false otherwise.

func KyamlNodeToUnstructured

func KyamlNodeToUnstructured(n *yaml.RNode) (*unstructured.Unstructured, error)

KyamlNodeToUnstructured take a resource represented as a kyaml RNode and turns it into an Unstructured object.

func LookupResourceScope

func LookupResourceScope(u *unstructured.Unstructured, crds []*unstructured.Unstructured, mapper meta.RESTMapper) (meta.RESTScope, error)

LookupResourceScope tries to look up the scope of the type of the provided resource, looking at both the types known to the cluster (through the RESTMapper) and the provided CRDs. If no information about the type can be found, an UnknownTypeError wil be returned.

func NestedField

func NestedField(obj map[string]interface{}, fields ...interface{}) (interface{}, bool, error)

NestedField gets a value from a KRM map, if it exists, otherwise nil. Fields can be string (map key) or int (array index).

func NewKustomizePostrenderer

func NewKustomizePostrenderer(dir string) *kustomizePostrenderer

func NewRaw

func NewRaw(dir string) *raw

func NotFound

func NotFound(fieldPath []interface{}, value interface{}) *field.Error

NotFound returns a *Error indicating "value not found". This is used to report failure to find a requested value (e.g. looking up an ID).

func RemoveAnnotations

func RemoveAnnotations(n *yaml.RNode, annotations ...kioutil.AnnotationKey) error

RemoveAnnotations removes the specified kioutil annotations from the resource.

func UpdateRepos

func UpdateRepos(settings *cli.EnvSettings) error

UpdateRepos now receives EnvSettings

Types

type NamespaceMismatchError

type NamespaceMismatchError struct {
	RequiredNamespace string
	Namespace         string
}

NamespaceMismatchError is returned if all resources must be in a specific namespace, and resources are found using other namespaces.

func (*NamespaceMismatchError) Error

func (e *NamespaceMismatchError) Error() string

type ReaderOptions

type ReaderOptions struct {
	Mapper           meta.RESTMapper
	Validate         bool
	Namespace        string
	EnforceNamespace bool
}

ReaderOptions defines the shared inputs for the different implementations of the ManifestReader interface.

type Renderer

type Renderer string
const (
	RendererHelm      Renderer = "helm"
	RendererRaw       Renderer = "raw"
	RendererKustomize Renderer = "kustomize"

	ChartFileName = "Chart.yaml"
)

type StreamManifestReader

type StreamManifestReader struct {
	ReaderName string
	Reader     io.Reader

	ReaderOptions
}

StreamManifestReader reads manifest from the provided io.Reader and returns them as Info objects. The returned Infos will not have client or mapping set.

func (*StreamManifestReader) Read

Read reads the manifests and returns them as Info objects.

type Template

type Template interface {
	Render(svc *console.ServiceDeploymentForAgent, mapper meta.RESTMapper) ([]unstructured.Unstructured, error)
}

func NewHelm

func NewHelm(dir string) Template

func NewKustomize

func NewKustomize(dir string) Template

type UnknownTypeError

type UnknownTypeError struct {
	GroupVersionKind schema.GroupVersionKind
}

UnknownTypeError captures information about a type for which no information could be found in the cluster or among the known CRDs.

func (*UnknownTypeError) Error

func (e *UnknownTypeError) Error() string

type UnknownTypesError

type UnknownTypesError struct {
	GroupVersionKinds []schema.GroupVersionKind
}

UnknownTypesError captures information about unknown types encountered.

func (*UnknownTypesError) Error

func (e *UnknownTypesError) Error() string

Jump to

Keyboard shortcuts

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