Documentation
¶
Index ¶
- Variables
- func CommandEditor(cmd *cobra.Command) yaml.Filter
- func CommandReaders(cmd *cobra.Command, args []string) []kio.Reader
- func CommandWriters(cmd *cobra.Command, overwriteFiles bool) []kio.Writer
- func Decode(values ...any) kio.Writer
- func DecodeJSON(values ...any) kio.Writer
- func Encode(values ...any) kio.Reader
- func EncodeJSON(values ...any) kio.Reader
- type ErrorReader
- type ExecReader
- type ExecWriter
- type FileReadWriterOption
- type FileReader
- type FileWriter
- type HelmValues
- func (r *HelmValues) Apply() yaml.Filter
- func (r *HelmValues) AsMap() (map[string]any, error)
- func (r *HelmValues) Empty() bool
- func (r *HelmValues) Flatten() kio.Filter
- func (r *HelmValues) Mask(keep bool) kio.Filter
- func (r *HelmValues) MergeMaps(a, b map[string]any) map[string]any
- func (r *HelmValues) Read() ([]*yaml.RNode, error)
- type Kubectl
- func (k *Kubectl) Apply(ctx context.Context, opts ...karg.ApplyOption) *ExecWriter
- func (k *Kubectl) Command(ctx context.Context, args ...string) *exec.Cmd
- func (k *Kubectl) Create(ctx context.Context, opts ...karg.CreateOption) *ExecWriter
- func (k *Kubectl) Delete(ctx context.Context, opts ...karg.DeleteOption) *ExecWriter
- func (k *Kubectl) Get(ctx context.Context, opts ...karg.GetOption) *ExecReader
- func (k *Kubectl) Patch(ctx context.Context, opts ...karg.PatchOption) *ExecWriter
- func (k *Kubectl) Reader(ctx context.Context, args ...string) *ExecReader
- func (k *Kubectl) Wait(ctx context.Context, opts ...karg.WaitOption) *exec.Cmd
- func (k *Kubectl) Writer(ctx context.Context, args ...string) *ExecWriter
- type ReadOneFunc
- type ReaderFunc
- type TemplateReader
Constants ¶
This section is empty.
Variables ¶
var CommandWriterFormatFlag = "output"
CommandWriterFormatFlag is a global that can be overwritten to change the name of the flag used to get the output format from the command.
Functions ¶
func CommandEditor ¶ added in v0.4.12
CommandEditor returns a filter which launches the node into an editor for interactive edits.
func CommandReaders ¶
CommandReaders returns KYAML readers for the supplied file name arguments.
func CommandWriters ¶
CommandWriters returns KYAML writers for the supplied command.
func Decode ¶ added in v0.3.13
Decode returns a writer over the YAML decoding (one per resource document).
func DecodeJSON ¶ added in v0.4.4
DecodeJSON returns a writer over the JSON decoding of the YAML (one per resource document).
func Encode ¶ added in v0.3.12
Encode returns a reader over the YAML encoding of the specified values.
func EncodeJSON ¶ added in v0.4.8
EncodeJSON returns a reader over the JSON encoding of the specified values.
Types ¶
type ErrorReader ¶ added in v0.3.11
type ErrorReader struct{ Err error }
ErrorReader is an adapter to allow the use of an error as a kio.Reader.
type ExecReader ¶
ExecReader is a KYAML reader that consumes YAML from another process via stdout.
type ExecWriter ¶
ExecWriter is a KYAML writer that sends YAML to another process via stdin.
type FileReadWriterOption ¶ added in v0.4.8
type FileReadWriterOption func(opts *fileReadWriterOptions) error
FileReadWriterOption represents a configuration option for the FileReader or FileWriter.
func FileWriterMkdirAll ¶ added in v0.4.8
func FileWriterMkdirAll(perm os.FileMode) FileReadWriterOption
FileWriterMkdirAll is an option that allows you to create all the parent directories on write.
type FileReader ¶ added in v0.4.5
type FileReader struct { // The file name to read. Name string // The file system to use for resolving file contents (defaults to the OS reader). FS fs.FS // Configuration options. Options []FileReadWriterOption }
FileReader is a KIO reader that lazily loads a file.
type FileWriter ¶ added in v0.4.5
type FileWriter struct { // The file name to write. Name string // Configuration options. Options []FileReadWriterOption }
FileWriter is a KIO writer that writes nodes to a file.
type HelmValues ¶ added in v0.3.12
type HelmValues struct { // User specified values files (via -f/--values). ValueFiles []string // User specified values (via --set). Values []string // User specified string values (via --set-string). StringValues []string // User specified file values (via --set-file). FileValues []string // The file system to use for resolving file contents (defaults to the OS reader). FS fs.FS }
HelmValues is a reader that emits resource nodes representing Helm values.
func (*HelmValues) Apply ¶ added in v0.4.12
func (r *HelmValues) Apply() yaml.Filter
Apply merges these Helm values into the filtered nodes without a schema.
func (*HelmValues) AsMap ¶ added in v0.4.5
func (r *HelmValues) AsMap() (map[string]any, error)
AsMap converts the configured user specified values into a map of values.
func (*HelmValues) Empty ¶ added in v0.3.17
func (r *HelmValues) Empty() bool
Empty returns true if there are no values configured on the this Helm values instance.
func (*HelmValues) Flatten ¶ added in v0.4.8
func (r *HelmValues) Flatten() kio.Filter
Flatten returns a filter that merges all the supplied nodes into a single node.
func (*HelmValues) Mask ¶ added in v0.4.5
func (r *HelmValues) Mask(keep bool) kio.Filter
Mask returns a filter that either keeps or strips data impacted by these values.
type Kubectl ¶
type Kubectl struct { // The path the kubectl binary, defaults to `kubectl`. Bin string // The path to the kubeconfig. KubeConfig string // The context name. Context string // The namespace name. Namespace string // The length of time to wait before giving up on a single request. RequestTimeout time.Duration }
Kubectl is used for executing `kubectl` as part of a KYAML pipeline.
func (*Kubectl) Apply ¶
func (k *Kubectl) Apply(ctx context.Context, opts ...karg.ApplyOption) *ExecWriter
Apply returns a sink for applying resources via kubectl.
func (*Kubectl) Command ¶
Command creates a new executable command with the configured global flags and the supplied arguments.
func (*Kubectl) Create ¶
func (k *Kubectl) Create(ctx context.Context, opts ...karg.CreateOption) *ExecWriter
Create returns a sink for creating resources via kubectl.
func (*Kubectl) Delete ¶ added in v0.3.12
func (k *Kubectl) Delete(ctx context.Context, opts ...karg.DeleteOption) *ExecWriter
Delete returns a sink for deleting resources via kubectl.
func (*Kubectl) Patch ¶ added in v0.3.17
func (k *Kubectl) Patch(ctx context.Context, opts ...karg.PatchOption) *ExecWriter
Patch returns a sink for patching resources via kubectl.
func (*Kubectl) Reader ¶ added in v0.3.13
func (k *Kubectl) Reader(ctx context.Context, args ...string) *ExecReader
Reader returns a kio.Reader for the specified kubectl arguments.
type ReadOneFunc ¶ added in v0.3.12
ReadOneFunc is an adapter to allow the use of single node returning functions as a kio.Reader.
type ReaderFunc ¶ added in v0.3.11
ReaderFunc is an adapter to allow the use of ordinary functions as a kio.Reader.
type TemplateReader ¶
type TemplateReader struct { // The template to execute. Template *template.Template // The data for the template. Data any }
TemplateReader is a KYAML reader that consumes YAML from a Go template.