Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterOptions ¶
type FilterOptions struct {
// Default input (i.e. stdin).
DefaultReader io.Reader
// An alternate executor for kubectl commands.
KubectlExecutor func(cmd *exec.Cmd) ([]byte, error)
// Options for the default kubectl executor (ignored when `KubectlExecutor` is non-nil).
KubectlOptions []KubectlOption
// An alternate executor for kustomize commands.
KustomizeExecutor func(cmd *exec.Cmd) ([]byte, error)
}
FilterOptions allow the behavior of the Konjure filter to be customized.
type GenericSelector ¶
type GenericSelector filters.ResourceMetaFilter
GenericSelector can be used to implement the "Select" part of the Selector interface. The "*Selector" fields are treated as Kubernetes selectors, all other fields are regular expressions for matching metadata.
type KubectlOption ¶
type KubectlOption func(interface{}) error
KubectlOption is used to control the behavior of the default kubectl executor.
func WithKubectlRESTConfig ¶
func WithKubectlRESTConfig(restConfig *rest.Config) KubectlOption
WithKubectlRESTConfig prefers the supplied REST configuration over the default.
type Scanner ¶
type Scanner struct {
// The list of selectors that produce intermediate representations.
Selectors []Selector
// The mapper that produces resource nodes from the intermediate representations.
Transformer Transformer
}
Scanner is used to map resource nodes to an intermediate type and back to (a likely different collection of) resource nodes. For example, a scanner could be used to "select" all the "name" labels from a slice of resource nodes, the "transform" those names back into a ConfigMap resource node that contains all of the discovered values.
type Selector ¶
type Selector interface {
Select([]*yaml.RNode) ([]*yaml.RNode, error)
Map(node *yaml.RNode, meta yaml.ResourceMeta) ([]interface{}, error)
}
Selector is used to filter (reduce) a list of resource nodes and then map them into something that can be consumed by a transformer.
type Transformer ¶
type Transformer interface {
Transform(nodes []*yaml.RNode, selected []interface{}) ([]*yaml.RNode, error)
}
Transformer consumes the aggregated outputs from the selectors and turns them back into resource nodes. The original resource nodes used to generate the inputs are also made available.