Documentation ¶
Index ¶
- Constants
- func Extract(raw interface{}) (map[string]manifest.Manifest, error)
- func Filter(list manifest.List, exprs Matchers) manifest.List
- func Label(list manifest.List, cfg v1alpha1.Config) manifest.List
- func Namespace(list manifest.List, def string) manifest.List
- func Process(raw map[string]interface{}, cfg v1alpha1.Config, exprs Matchers) (manifest.List, error)
- func Sort(list manifest.List)
- func Unwrap(manifests map[string]manifest.Manifest) error
- type ErrBadExpr
- type ErrorPrimitiveReached
- type Matcher
- type Matchers
Constants ¶
const ( MetadataPrefix = "tanka.dev" LabelEnvironment = MetadataPrefix + "/environment" )
const ( // AnnotationNamespaced can be set on any resource to override the decision // whether 'metadata.namespace' is set by Tanka AnnotationNamespaced = MetadataPrefix + "/namespaced" )
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
Extract scans the raw Jsonnet evaluation result (JSON tree) for objects that look like Kubernetes objects and extracts those into a flat map, indexed by their path in the original JSON tree
func Namespace ¶
Namespace injects the default namespace of the environment into each resources, that does not already define one. AnnotationNamespaced can be used to disable this per resource
func Process ¶
func Process(raw map[string]interface{}, cfg v1alpha1.Config, exprs Matchers) (manifest.List, error)
Process converts the raw Jsonnet evaluation result (JSON tree) into a flat list of Kubernetes objects, also applying some transformations: - tanka.dev/** labels - filtering - best-effort sorting
Types ¶
type ErrBadExpr ¶
type ErrBadExpr struct {
// contains filtered or unexported fields
}
ErrBadExpr occurs when the regexp compiling fails
func (ErrBadExpr) Error ¶
func (e ErrBadExpr) Error() string
type ErrorPrimitiveReached ¶
type ErrorPrimitiveReached struct {
// contains filtered or unexported fields
}
ErrorPrimitiveReached occurs when walkJSON reaches the end of nested dicts without finding a valid Kubernetes manifest
func (ErrorPrimitiveReached) Error ¶
func (e ErrorPrimitiveReached) Error() string
type Matcher ¶
Matcher is a single filter expression. The passed argument of Matcher is of the form `kind/name` (manifest.KindName())
type Matchers ¶
type Matchers []Matcher
Matchers is a collection of multiple expressions.
func MustStrExps ¶
func (Matchers) MatchString ¶
MatchString returns whether at least one expression (OR) matches the string