cmd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FieldOwner = client.FieldOwner("kubepkg")

Functions

func NewLogger

func NewLogger(lvl int) (l logr.Logger)

func Run

func Run(ctx context.Context) error

Types

type Agent

type Agent struct {
	cli.Name `desc:"registry"`
	AgentFlags
	VerboseFlags
}

func (*Agent) Run

func (s *Agent) Run(ctx context.Context) error

type AgentFlags

type AgentFlags struct {
	Storage

	AgentID    string   `flag:"agent-id" default:"dev" env:"KUBEPKG_AGENT_ID" desc:"output path for kubepkg.tgz"`
	Platforms  []string `flag:"platform" env:"KUBEPKG_PLATFORMS" default:"linux/amd64,linux/arm64" desc:"supported platforms"`
	Addr       string   `flag:"addr" env:"AGENT_ADDR" default:":36060" desc:"The address the server endpoint binds to"`
	KubeConfig string   `flag:"kubeconfig" env:"KUBECONFIG" desc:"Paths to a kubeconfig. Only required if out-of-cluster."`
}

type Apply

type Apply struct {
	cli.Name `args:"KUBEPKG_JSON" desc:"apply manifests to k8s directly"`
	ApplyFlags
	VerboseFlags
}

func (*Apply) Run

func (s *Apply) Run(ctx context.Context) error

type ApplyFlags

type ApplyFlags struct {
	KubeConfig      string `flag:"kubeconfig" env:"KUBECONFIG" desc:"Paths to a kubeconfig. Only required if out-of-cluster."`
	DryRun          bool   `flag:"dry-run" desc:"Enable dry run"`
	Force           bool   `flag:"force" desc:"Force overwrites ownership"`
	CreateNamespace bool   `flag:"create-namespace" desc:"Create namespace if not exists"`
}

type Export

type Export struct {
	cli.Name `args:"KUBEPKG_MANIFEST" desc:"Create kubepkg.tgz from kubepkg manifest"`
	ExportFlags
	VerboseFlags
}

func (*Export) Run

func (s *Export) Run(ctx context.Context) error

type ExportFlags

type ExportFlags struct {
	ForceResolve         bool     `flag:"force-resolve" desc:"ignore image locked sha256 digest"`
	Output               string   `flag:"output,o" desc:"output path for kubepkg.tgz"`
	ExtractManifestsYaml string   `flag:"extract-manifests-yaml" desc:"extract manifests as yaml"`
	Platforms            []string `flag:"platform" default:"linux/amd64,linux/arm64" desc:"supported platforms"`
	Storage
	RemoteRegistry
}

type Import

type Import struct {
	cli.Name `args:"KUBEPKG_TGZ|KUBEPKG_SPEC..." desc:"import kubepkg.tgz or kubepkg.{json,yaml}"`
	ImportFlags
	VerboseFlags
}

func (*Import) Run

func (s *Import) Run(ctx context.Context) error

type ImportFlags

type ImportFlags struct {
	ImportTo       string `flag:"import-to,i" desc:"Import to. REMOTE_AGENT (http://ip:port) or STORAGE_ROOT (dir path)"`
	Incremental    bool   `flag:"incremental" desc:"Only for importing to REMOTE_AGENT"`
	SkipBlobs      bool   `flag:"skip-blobs" desc:"Only for importing to REMOTE_AGENT without blobs, when --incremental set"`
	ManifestOutput string `flag:"manifest-output" desc:"Dir to output manifest. Only for importing to STORAGE_ROOT"`
}

type Manifests added in v0.1.0

type Manifests struct {
	cli.Name `args:"KUBEPKG_JSON" desc:"show manifests"`
}

func (*Manifests) Run added in v0.1.0

func (s *Manifests) Run(ctx context.Context) error

type ManifestsFlags added in v0.1.0

type ManifestsFlags struct {
}

type Operator

type Operator struct {
	cli.Name `desc:"registry"`
	OperatorFlags
	VerboseFlags
}

func (*Operator) Run

func (s *Operator) Run(ctx context.Context) error

type OperatorFlags

type OperatorFlags struct {
	WatchNamespace       string `flag:"watch-namespace" env:"WATCH_NAMESPACE" desc:"Watch namespace"`
	MetricsAddr          string `flag:"metrics-addr" default:":8080" desc:"The address the metric endpoint binds to"`
	EnableLeaderElection bool   `flag:"enable-leader-election" desc:"Enable leader election for controller manager."`
	KubeConfig           string `flag:"kubeconfig" env:"KUBECONFIG" desc:"Paths to a kubeconfig. Only required if out-of-cluster."`
	controller.Options
}

type Registry

type Registry struct {
	cli.Name `desc:"registry"`
	RegistryFlags
	VerboseFlags
}

func (*Registry) Run

func (s *Registry) Run(ctx context.Context) error

type RegistryFlags

type RegistryFlags struct {
	Storage
	RemoteRegistry
	Addr string `flag:"addr" env:"REGISTRY_ADDR" default:":5000" desc:"The address the server endpoint binds to"`
}

type RemoteRegistry

type RemoteRegistry struct {
	Endpoint string `flag:"remote-registry-endpoint" default:"" env:"KUBEPKG_REMOTE_REGISTRY_ENDPOINT" desc:"remote container registry endpoint"`
	Username string `flag:"remote-registry-username" default:"" env:"KUBEPKG_REMOTE_REGISTRY_USERNAME" desc:"remote container registry username"`
	Password string `flag:"remote-registry-password" default:"" env:"KUBEPKG_REMOTE_REGISTRY_PASSWORD" desc:"remote container registry password"`
}

type Serve

type Serve struct {
	cli.Name `desc:"serve"`
}

type Storage

type Storage struct {
	Root string `flag:"storage-root,w" default:".tmp/kubepkg" env:"KUBEPKG_STORAGE_ROOT" desc:"storage dir root"`
}

type VerboseFlags

type VerboseFlags struct {
	V int `flag:"verbose,v" desc:"verbose level"`
}

func (VerboseFlags) PreRun

func (v VerboseFlags) PreRun(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

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