Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EnvWriter ¶
EnvWriter is a writer which only emits name/value pairs found in the data of config maps and secrets.
type Filter ¶
type Filter struct { // The number of times to recursively filter the resource list. Depth int // The default reader to use, defaults to stdin. DefaultReader io.Reader // Filter to determine which resources are retained. filters.ResourceMetaFilter // Flag indicating that status fields should not be stripped. KeepStatus bool // Flag indicating that comments should not be stripped. KeepComments bool // Flag indicating that output should be formatted. Format bool // The explicit working directory used to resolve relative paths. WorkingDirectory string // Flag indicating we can process directories recursively. RecursiveDirectories bool // Override the default path to the kubeconfig file. Kubeconfig string // Override the default Kubectl executor. KubectlExecutor func(cmd *exec.Cmd) ([]byte, error) // Override the default Kustomize executor. KustomizeExecutor func(cmd *exec.Cmd) ([]byte, error) }
Filter replaces Konjure resources with the expanded resources they represent.
type GroupWriter ¶ added in v0.3.3
type GroupWriter struct { GroupNode func(node *yaml.RNode) (group string, ordinal string, err error) GroupWriter func(name string) (io.Writer, error) KeepReaderAnnotations bool ClearAnnotations []string Sort bool RestoreVerticalWhiteSpace bool }
GroupWriter writes nodes based on a functional grouping definition.
type JSONWriter ¶ added in v0.3.2
type JSONWriter struct { Writer io.Writer KeepReaderAnnotations bool ClearAnnotations []string WrappingKind string WrappingAPIVersion string Sort bool }
JSONWriter is a writer which emits JSON instead of YAML. This is useful if you like `jq`.
type Resource ¶
type Resource struct { Resource *konjurev1beta2.Resource `json:"resource,omitempty" yaml:"resource,omitempty"` Helm *konjurev1beta2.Helm `json:"helm,omitempty" yaml:"helm,omitempty"` Jsonnet *konjurev1beta2.Jsonnet `json:"jsonnet,omitempty" yaml:"jsonnet,omitempty"` Kubernetes *konjurev1beta2.Kubernetes `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"` Kustomize *konjurev1beta2.Kustomize `json:"kustomize,omitempty" yaml:"kustomize,omitempty"` Secret *konjurev1beta2.Secret `json:"secret,omitempty" yaml:"secret,omitempty"` Git *konjurev1beta2.Git `json:"git,omitempty" yaml:"git,omitempty"` HTTP *konjurev1beta2.HTTP `json:"http,omitempty" yaml:"http,omitempty"` File *konjurev1beta2.File `json:"file,omitempty" yaml:"file,omitempty"` // contains filtered or unexported fields }
Resource is a Konjure resource. This type may be used to collect Konjure resource specifications: either by URL-like string or by specifying the structured form of a resource. Only one of the pointers may be non-nil at a time.
func NewResource ¶
NewResource returns a resource for parsing the supplied resource specifications. This is a convenience function for abstracting away gratuitous use of the word "resource".
func (*Resource) DeepCopyInto ¶
DeepCopyInto is meant to allow Resource to be used with code generated by Kubernetes controller-gen. It is not a true deep copy, it will only copy the destination of the non-nil pointers.
func (*Resource) MarshalJSON ¶
MarshalJSON produces JSON for this Konjure resource. If it was initially read from a string, the string representation is used, however changes made to the object will not be reflected.
func (*Resource) Read ¶ added in v0.3.2
Read returns a KYAML resource nodes representing this Konjure resource.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON allows a Konjure resource to be represented by a plain URL-like string or a typed structure.
type Resources ¶
type Resources []Resource
Resources is a list of Konjure resources, it can be used as a KYAML Reader to obtain YAML representations of the Konjure resources.
type TemplateWriter ¶ added in v0.3.3
type TemplateWriter struct { Writer io.Writer Template string Functions template.FuncMap WrappingKind string WrappingAPIVersion string }
TemplateWriter is a writer which emits each resource evaluated using a configured Go template.
type Writer ¶
type Writer struct { // The desired format. Format string // The output stream to write to. Writer io.Writer // Flag to keep the intermediate annotations introduced during reading. KeepReaderAnnotations bool // List of additional annotations to clear. ClearAnnotations []string // Flag indicating nodes should be sorted before writing. Sort bool // Flag indicating we should attempt to restore vertical white space using // line numbers prior to writing. RestoreVerticalWhiteSpace bool }
Writer is a multi-format writer for emitting resource nodes.