kpt

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Resource event of type apply has apply type
	ResourceApplyType = "apply"
	// Status of successful resource event
	ResourceOperationSuccessful = "Successful"
	// Group event of type apply has summary type
	CompletedEventType = "summary"
)
View Source
const MIN_KPT_VERSION = "v1.0.0-beta.16"

MIN_KPT_VERSION format: vMAJOR[.MINOR[.PATCH[-PRERELEASE]]]

Variables

This section is empty.

Functions

func GenerateSetterKVFromEnvVar

func GenerateSetterKVFromEnvVar(e string) (string, string, error)

Generates setters from environment variables. Setter names are generated from variable name by lowercasing and replacing "_" to "-".

func GetKptVersion added in v0.5.1

func GetKptVersion(t testing.TB, kptBinary string) string

GetKptVersion gets the version of kptBinary

func MergeSetters

func MergeSetters(a, b map[string]string) map[string]string

MergeSetters merges two setter maps a and b. If duplicate key map b takes precedence.

func ReadPkgResources

func ReadPkgResources(dir string) ([]*yaml.RNode, error)

ReadPkgResources returns a slice of resources from a dir.

func UpsertSetters

func UpsertSetters(nodes []*yaml.RNode, setters map[string]string) error

UpsertSetters inserts or updates setters if apply-setters fn config is discovered.

func WithBinary

func WithBinary(kptBinary string) cmdOption

func WithDir

func WithDir(dir string) cmdOption

func WithLogger

func WithLogger(logger *logger.Logger) cmdOption

func WritePkgResources

func WritePkgResources(dir string, rs []*yaml.RNode) error

WritePkgResources writes a slice of resources to a dir.

Types

type CmdCfg

type CmdCfg struct {
	// contains filtered or unexported fields
}

func NewCmdConfig

func NewCmdConfig(t testing.TB, opts ...cmdOption) *CmdCfg

NewCmdConfig sets defaults and validates values for kpt Options.

func (*CmdCfg) RunCmd

func (k *CmdCfg) RunCmd(args ...string) string

type GroupApplyStatus

type GroupApplyStatus struct {
	Action     string `json:"action"`
	Count      int    `json:"count"`
	Failed     int    `json:"failed"`
	Skipped    int    `json:"skipped"`
	Status     string `json:"status"`
	Successful int    `json:"successful"`
	Timestamp  string `json:"timestamp"`
	Type       string `json:"type"`
}

func GetPkgApplyGroupStatus

func GetPkgApplyGroupStatus(jsonStatus string) (GroupApplyStatus, error)

GetPkgApplyGroupStatus finds the first group kpt apply status from newline separated string of apply statuses and converts it into a GroupApplyStatus.

type ResourceApplyStatus

type ResourceApplyStatus struct {
	Group     string `json:"group,omitempty"`
	Kind      string `json:"kind,omitempty"`
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	Status    string `json:"status"`
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`
}

func GetPkgApplyResourcesStatus

func GetPkgApplyResourcesStatus(jsonStatus string) ([]ResourceApplyStatus, error)

GetPkgApplyResourcesStatus finds individual kpt apply statuses from newline separated string of apply statuses and converts them into a slice of ResourceApplyStatus.

Jump to

Keyboard shortcuts

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