kptops

package
v1.0.0-beta.64.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package kptops contains implementations of kpt operations

Index

Constants

View Source
const (
	Dry hydrationState = iota
	Hydrating
	Wet
)

constants for all the hydration states

Variables

View Source
var ErrAllowedExecNotSpecified = fmt.Errorf("must run with `--allow-exec` option to allow running function binaries")

ErrAllowedExecNotSpecified indicates user need to authorize to invoke exec binaries.

Functions

func NewRenderer

func NewRenderer(runnerOptions runneroptions.RunnerOptions) fn.Renderer

func PkgUpdate

func PkgUpdate(ctx context.Context, ref string, packageDir string, _ PkgUpdateOpts) error

PkgUpdate is a wrapper around `kpt pkg update`, running it against the package in packageDir

func UpdateKptfileName

func UpdateKptfileName(name string, contents map[string]string) error

func UpdateKptfileUpstream

func UpdateKptfileUpstream(name string, contents map[string]string, upstream kptfilev1.Upstream, lock kptfilev1.Locator) error

func UpdateName

func UpdateName(kptfileContents string, name string) (string, error)

func UpdateUpstream

func UpdateUpstream(kptfileContents string, name string, upstream kptfilev1.Upstream, lock kptfilev1.Locator) (string, error)

Types

type Executor

type Executor struct {
	PkgPath        string
	ResultsDirPath string
	Output         io.Writer

	RunnerOptions runneroptions.RunnerOptions

	FileSystem filesys.FileSystem

	// function runtime
	Runtime fn.FunctionRuntime
	// contains filtered or unexported fields
}

Executor executes a hook.

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, hook []kptfilev1.Function) error

Execute executes given hook.

type FunctionRuntime

type FunctionRuntime interface {
	fn.FunctionRuntime
	io.Closer
}

type PkgUpdateOpts

type PkgUpdateOpts struct {
	Strategy string
}

PkgUpdateOpts are options for invoking kpt PkgUpdate

type Renderer

type Renderer struct {
	// PkgPath is the absolute path to the root package
	PkgPath string

	// Runtime knows how to pick a function runner for a given function
	Runtime fn.FunctionRuntime

	// ResultsDirPath is absolute path to the directory to write results
	ResultsDirPath string

	// Output is the writer to which the output resources are written
	Output io.Writer

	// RunnerOptions contains options controlling function execution.
	RunnerOptions runneroptions.RunnerOptions

	// FileSystem is the input filesystem to operate on
	FileSystem filesys.FileSystem

	// DisplayName is an optional field to modify the package name displayed in logs
	DisplayName string
	// contains filtered or unexported fields
}

Renderer hydrates a given pkg by running the functions in the input pipeline

func (*Renderer) Execute

func (e *Renderer) Execute(ctx context.Context) (*fnresult.ResultList, error)

Execute runs a pipeline.

Jump to

Keyboard shortcuts

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