cmd

package
v0.12.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	XRD_GROUP_ENV_VAR   = "XRD_GROUP"
	XRD_VERSION_ENV_VAR = "XRD_VERSION"
	XRD_KIND_ENV_VAR    = "XRD_KIND"
)
View Source
const PluginPrefix = "kratix"

Variables

This section is empty.

Functions

func AddContainer

func AddContainer(cmd *cobra.Command, args []string) error

func BuildContainer added in v0.2.0

func BuildContainer(cmd *cobra.Command, args []string) error

func BuildPromise

func BuildPromise(cmd *cobra.Command, args []string) error

func Command added in v0.9.1

func Command(name string, arg ...string) *exec.Cmd

Command returns an exec.Cmd configured with the provided executable path and arguments. It mirrors the helper used by kubectl to retain behaviour on Windows where LookPath may resolve executable extensions.

func Execute

func Execute(version string)

func HandlePluginCommand added in v0.9.1

func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string, minArgs int) error

HandlePluginCommand receives a pluginHandler and command-line arguments and attempts to find a plugin executable on the PATH that satisfies the given arguments. If a matching plugin is found it is executed and this function does not return unless an error occurs.

func InitCrossplanePromise added in v0.5.0

func InitCrossplanePromise(cmd *cobra.Command, args []string) error

func InitFromTerraformModule added in v0.5.0

func InitFromTerraformModule(cmd *cobra.Command, args []string) error

func InitHelmPromise

func InitHelmPromise(cmd *cobra.Command, args []string) error

func InitPromise

func InitPromise(cmd *cobra.Command, args []string) error

func InitPromiseFromOperator

func InitPromiseFromOperator(cmd *cobra.Command, args []string) error

func RenderTree added in v0.9.0

func RenderTree(promiseName string, fetcher ...Fetcher) error

func UpdateAPI

func UpdateAPI(cmd *cobra.Command, args []string) error

func UpdateSelector

func UpdateSelector(cmd *cobra.Command, args []string) error

Types

type CommandOverrideVerifier added in v0.9.1

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

func (*CommandOverrideVerifier) Verify added in v0.9.1

func (v *CommandOverrideVerifier) Verify(path string) []error

type DefaultPluginHandler added in v0.9.1

type DefaultPluginHandler struct {
	ValidPrefixes []string
}

DefaultPluginHandler implements PluginHandler

func NewDefaultPluginHandler added in v0.9.1

func NewDefaultPluginHandler(validPrefixes []string) *DefaultPluginHandler

NewDefaultPluginHandler instantiates the DefaultPluginHandler with a list of given filename prefixes used to identify valid plugin filenames.

func (*DefaultPluginHandler) Execute added in v0.9.1

func (h *DefaultPluginHandler) Execute(executablePath string, cmdArgs, environment []string) error

Execute implements PluginHandler and executes the plugin binary with the provided arguments.

func (*DefaultPluginHandler) Lookup added in v0.9.1

func (h *DefaultPluginHandler) Lookup(filename string) (string, bool)

Lookup implements PluginHandler and attempts to locate an executable with the provided filename using the configured prefixes.

type Fetcher added in v0.9.0

type Fetcher interface {
	GVRForPromise(ctx context.Context, promiseName string) (gvr *schema.GroupVersionResource, err error)
	GetRequests(ctx context.Context, gvr *schema.GroupVersionResource, promiseName string, selector string) (request *unstructured.UnstructuredList, err error)
	GetKratixGVRs(ctx context.Context) ([]schema.GroupVersionResource, error)
}

type K8sQuerier added in v0.9.0

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

func (K8sQuerier) GVRForPromise added in v0.9.0

func (q K8sQuerier) GVRForPromise(ctx context.Context, promiseName string) (*schema.GroupVersionResource, error)

func (K8sQuerier) GetKratixGVRs added in v0.9.0

func (q K8sQuerier) GetKratixGVRs(ctx context.Context) ([]schema.GroupVersionResource, error)

func (K8sQuerier) GetRequests added in v0.9.0

func (q K8sQuerier) GetRequests(ctx context.Context, gvr *schema.GroupVersionResource, promiseName string, selector string) (*unstructured.UnstructuredList, error)

type PathVerifier added in v0.9.1

type PathVerifier interface {
	Verify(path string) []error
}

type PluginHandler added in v0.9.1

type PluginHandler interface {
	Lookup(filename string) (string, bool)
	Execute(executablePath string, cmdArgs, environment []string) error
}

PluginHandler is capable of parsing command line arguments and performing executable filename lookups to search for valid plugin files, and execute found plugins.

type PluginListOptions added in v0.9.1

type PluginListOptions struct {
	Verifier    PathVerifier
	PluginPaths []string

	Out    io.Writer
	ErrOut io.Writer
}

func (*PluginListOptions) Complete added in v0.9.1

func (o *PluginListOptions) Complete(cmd *cobra.Command) error

func (*PluginListOptions) ListPlugins added in v0.9.1

func (o *PluginListOptions) ListPlugins() ([]string, []error)

func (*PluginListOptions) Run added in v0.9.1

func (o *PluginListOptions) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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