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 ¶
const ( RecipeFile = "recipe.json" CLIBundle = "cli-bundle" )
Files a reproduction writes and renders into, relative to its directory.
const Usage = `` /* 1128-byte string literal not displayed */
Usage is the plugin's help text.
Variables ¶
var ErrUsage = errors.New("usage")
ErrUsage reports a command line the plugin cannot run.
Functions ¶
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.