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.Environment) manifest.List
- func Namespace(list manifest.List, def string) manifest.List
- func Process(cfg v1alpha1.Environment, exprs Matchers) (manifest.List, error)
- func ResourceDefaults(list manifest.List, cfg v1alpha1.Environment) manifest.List
- func Sort(list manifest.List)
- func Unwrap(manifests map[string]manifest.Manifest) error
- type ErrBadExpr
- type ErrorPrimitiveReached
- type Ignorer
- type Matcher
- type Matchers
- type NegMatcher
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 Filter ¶
Filter returns all elements of the list that match at least one expression and are not ignored
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 ¶
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
func ResourceDefaults ¶ added in v0.12.0
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. A matcher may also implement Ignorer to explicitely ignore fields
func MustStrExps ¶
func (Matchers) IgnoreString ¶ added in v0.12.0
func (Matchers) MatchString ¶
MatchString returns whether at least one expression (OR) matches the string
type NegMatcher ¶ added in v0.12.0
type NegMatcher struct {
// contains filtered or unexported fields
}
NexMatcher is a matcher that inverts the original behaviour
func (NegMatcher) IgnoreString ¶ added in v0.12.0
func (n NegMatcher) IgnoreString(s string) bool
func (NegMatcher) MatchString ¶ added in v0.12.0
func (n NegMatcher) MatchString(s string) bool