Documentation ¶
Index ¶
- func FieldPath(p string, data map[string]string) ([]string, error)
- func FilterAll(f yaml.Filter) kio.Filter
- func FilterOne(f kio.Filter) yaml.Filter
- func Flatten(schema *spec.Schema) kio.Filter
- func Has(functions ...yaml.Filter) yaml.Filter
- func InstallOrder() kio.Filter
- func SetNamespace(namespace string) yaml.Filter
- func SetPath(p string, v *yaml.RNode) yaml.Filter
- func SetValues(nameValue []string, forceString bool) yaml.Filter
- func SortByKind(priority []string) kio.Filter
- func UninstallOrder() kio.Filter
- func WithContext(ctx context.Context, f ContextFilterFunc) yaml.Filter
- type ApplicationFilter
- type ContextFilterFunc
- type PatchFilter
- type Pipeline
- type ResourceMetaFilter
- type UnsupportedPatchError
- type WorkloadFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldPath ¶ added in v0.3.8
FieldPath evaluates a path template using the supplied context and then splits it into individual path segments (honoring escaped delimiters).
func FilterAll ¶ added in v0.3.3
FilterAll is similar to `kio.FilterAll` except instead of evaluating for side effects, only the non-nil nodes returned by the filter are preserved.
func FilterOne ¶
FilterOne is the opposite of kio.FilterAll, useful if you have a filter that is optimized for filtering batches of nodes, but you just need to call `Pipe` on a single node.
func Flatten ¶ added in v0.3.12
Flatten never returns more than a single node, every other node is merged into that first node using the supplied schema
func Has ¶ added in v0.3.7
Has is similar to `yaml.Tee` except it only produces a result if the supplied functions evaluate to a non-nil result.
func InstallOrder ¶ added in v0.4.0
InstallOrder returns a filter that sorts nodes in the order in which they should be created in a cluster. This uses the Helm ordering which is more complete than the Kustomize ordering.
func SetNamespace ¶ added in v0.3.12
SetNamespace is like `SetK8sNamespace` except it skips cluster scoped resources.
func SetPath ¶ added in v0.3.17
SetPath returns a filter that sets the node value at the specified path. Note that this path uses "." separators rather then "/".
func SetValues ¶ added in v0.3.17
SetValues returns a filter that sets the supplied "path=value" specifications onto incoming nodes. Use forceString to bypass tagging the node values.
func SortByKind ¶ added in v0.4.0
SortByKind returns a filter that sorts nodes based on the supplied list of kinds.
func UninstallOrder ¶ added in v0.4.0
UninstallOrder returns a filter that sorts nodes in the order in which they should be deleted from a cluster. This is not directly the reverse of the installation order.
func WithContext ¶ added in v0.3.20
func WithContext(ctx context.Context, f ContextFilterFunc) yaml.Filter
WithContext binds a context to a context filter function.
Types ¶
type ApplicationFilter ¶ added in v0.3.8
type ApplicationFilter struct { // Flag indicating if this filter should act as a pass-through. Enabled bool // Flag indicating we should show resources which do not belong to an application. ShowUnownedResources bool // The ordered names of the labels that contains the application name, default is "app.kubernetes.io/name, k8s-app, app". ApplicationNameLabels []string // The name of the label that contains the application instance name, default is "app.kubernetes.io/instance". ApplicationInstanceLabel string }
ApplicationFilter produces applications based on the observed resources.
type ContextFilterFunc ¶ added in v0.3.20
ContextFilterFunc is a context-aware YAML filter function.
type PatchFilter ¶ added in v0.4.8
type PatchFilter struct { // The media type of the patch being applied. PatchType string // The actual raw patch. PatchData []byte }
PatchFilter is used to apply an arbitrary patch.
type Pipeline ¶ added in v0.3.3
type Pipeline struct { Inputs []kio.Reader Filters []kio.Filter Outputs []kio.Writer ContinueOnEmptyResult bool }
Pipeline is an alternate to the kio.Pipeline. This pipeline has the following differences: 1. The read/filter is separated so this pipeline can be used as a reader in another pipeline 2. This pipeline does not try to reconcile Kustomize annotations 3. This pipeline does not support callbacks 4. This pipeline implicitly clears empty annotations
type ResourceMetaFilter ¶
type ResourceMetaFilter struct { // Regular expression matching the group. Group string `json:"group,omitempty" yaml:"group,omitempty"` // Regular expression matching the version. Version string `json:"version,omitempty" yaml:"version,omitempty"` // Regular expression matching the kind. Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` // Regular expression matching the namespace. Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` // Regular expression matching the name. Name string `json:"name,omitempty" yaml:"name,omitempty"` // Kubernetes selector matching labels. LabelSelector string `json:"labelSelector,omitempty" yaml:"labelSelector,omitempty"` // Kubernetes selector matching annotations AnnotationSelector string `json:"annotationSelector,omitempty" yaml:"annotationSelector,omitempty"` // Invert the matching behavior (i.e. keep non-matching nodes). InvertMatch bool `json:"invertMatch,omitempty" yaml:"invertMatch,omitempty"` }
ResourceMetaFilter filters nodes based on their resource metadata using regular expressions or Kubernetes selectors.
type UnsupportedPatchError ¶ added in v0.4.8
type UnsupportedPatchError struct {
PatchType string
}
UnsupportedPatchError is raised when a patch format is not recognized.
func (*UnsupportedPatchError) Error ¶ added in v0.4.8
func (e *UnsupportedPatchError) Error() string
type WorkloadFilter ¶ added in v0.4.1
type WorkloadFilter struct { // Flag indicating if this filter should act as a pass-through. Enabled bool // Secondary filter which can be optionally used to accept non-workload resources. NonWorkloadFilter *ResourceMetaFilter }
WorkloadFilter keeps only workload resources, i.e. those that directly or indirectly own pods. For this filter to work, all intermediate resources must be present and must have owner metadata specified.