pipes

package
v0.3.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandReaders

func CommandReaders(cmd *cobra.Command, args []string) []kio.Reader

CommandReaders returns KYAML readers for the supplied file name arguments.

func CommandWriters

func CommandWriters(cmd *cobra.Command, overwrite bool) []kio.Writer

CommandWriters returns KYAML writers for the supplied command.

Types

type ExecReader

type ExecReader struct {
	// The YAML producing command.
	*exec.Cmd
}

ExecReader is a KYAML reader that consumes YAML from another process via stdout.

func (*ExecReader) Read

func (c *ExecReader) Read() ([]*yaml.RNode, error)

Read executes the supplied command and parses the output as a YAML document stream.

type ExecWriter

type ExecWriter struct {
	// The YAML consuming command.
	*exec.Cmd
}

ExecWriter is a KYAML writer that sends YAML to another process via stdin.

func (*ExecWriter) Write

func (c *ExecWriter) Write(nodes []*yaml.RNode) error

Write executes the supplied command, piping the generated YAML to stdin.

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
}

Kubectl is used for executing `kubectl` as part of a KYAML pipeline.

func (*Kubectl) AddFlags

func (k *Kubectl) AddFlags(cmd *cobra.Command)

AddFlags adds binding for configuring the `kubectl` fields.

func (*Kubectl) Apply

func (k *Kubectl) Apply(ctx context.Context, dryRun string) kio.Writer

Apply returns a sink for applying resources via kubectl.

func (*Kubectl) Command

func (k *Kubectl) Command(ctx context.Context, args ...string) *exec.Cmd

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, dryRun string) kio.Writer

Create returns a sink for creating resources via kubectl.

func (*Kubectl) Get

func (k *Kubectl) Get(ctx context.Context, objs ...string) kio.Reader

Get returns a source for getting resources via kubectl.

type TemplateReader

type TemplateReader struct {
	// The template to execute.
	Template *template.Template
	// The data for the template.
	Data interface{}
}

TemplateReader is a KYAML reader that consumes YAML from a Go template.

func (*TemplateReader) Read

func (c *TemplateReader) Read() ([]*yaml.RNode, error)

Read executes the supplied template and parses the output as a YAML document stream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL