plugin

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package plugin implements the kubectl aicr plugin: describe, approve, acknowledge and revoke rollouts (api.md#approval), and reproduce a plan's bundle with the AICR CLI. The approver's username comes from the API server, as `kubectl auth whoami` reports it, never from a flag.

Index

Constants

View Source
const (
	RecipeFile = "recipe.json"
	CLIBundle  = "cli-bundle"
)

Files a reproduction writes and renders into, relative to its directory.

View Source
const Usage = `` /* 1128-byte string literal not displayed */

Usage is the plugin's help text.

Variables

View Source
var ErrUsage = errors.New("usage")

ErrUsage reports a command line the plugin cannot run.

Functions

func Run

func Run(ctx context.Context, args []string, out io.Writer) error

Run executes one plugin command and writes its result to out.

Types

type Reproduction

type Reproduction struct {
	Plan   string
	Digest string
	Image  string
	Bundle string
	Recipe []byte
	Flags  []string
}

Reproduction is what the AICR CLI needs to render a plan's bundle again: the recipe the operator's render read, the flags it ran with and the AICR image that ran it, with the bundle the operator pushed to compare against.

func LoadReproduction

func LoadReproduction(ctx context.Context, c client.Reader, namespace, ref string) (*Reproduction, error)

LoadReproduction reads a plan and its recipe. ref is a plan ConfigMap name or desiredStateDigest; empty is the runtime's active plan, or its candidate before any rollout.

func (*Reproduction) BundleRef

func (r *Reproduction) BundleRef() string

BundleRef is the operator's bundle as a registry reference, without the oci:// scheme.

func (*Reproduction) ContainerArgs

func (r *Reproduction) ContainerArgs(dir string) []string

ContainerArgs are the `docker run` arguments, after the user, that render the bundle with the plan's AICR image from dir/recipe.json into dir/cli-bundle.

Jump to

Keyboard shortcuts

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