Documentation ¶
Index ¶
- Constants
- func GenerateSetterKVFromEnvVar(e string) (string, string, error)
- func GetKptVersion(t testing.TB, kptBinary string) string
- func MergeSetters(a, b map[string]string) map[string]string
- func ReadPkgResources(dir string) ([]*yaml.RNode, error)
- func UpsertSetters(nodes []*yaml.RNode, setters map[string]string) error
- func WithBinary(kptBinary string) cmdOption
- func WithDir(dir string) cmdOption
- func WithLogger(logger *logger.Logger) cmdOption
- func WritePkgResources(dir string, rs []*yaml.RNode) error
- type CmdCfg
- type GroupApplyStatus
- type ResourceApplyStatus
Constants ¶
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" )
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 ¶
Generates setters from environment variables. Setter names are generated from variable name by lowercasing and replacing "_" to "-".
func GetKptVersion ¶ added in v0.5.1
GetKptVersion gets the version of kptBinary
func MergeSetters ¶
MergeSetters merges two setter maps a and b. If duplicate key map b takes precedence.
func ReadPkgResources ¶
ReadPkgResources returns a slice of resources from a dir.
func UpsertSetters ¶
UpsertSetters inserts or updates setters if apply-setters fn config is discovered.
func WithBinary ¶
func WithBinary(kptBinary string) cmdOption
func WithLogger ¶
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.
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.