cli

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Package cli sets up the CLI commands for the fleet apply binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App

func App() *cobra.Command

func NewApply

func NewApply() *cobra.Command

NewApply returns a subcommand to create bundles from directories

func NewCleanUp

func NewCleanUp() *cobra.Command

NewCleanup returns a subcommand to `cleanup` cluster registrations

func NewDeploy added in v0.10.0

func NewDeploy() *cobra.Command

NewDeploy returns a subcommand to deploy a bundledeployment/content resource to a cluster.

func NewTarget added in v0.10.0

func NewTarget() *cobra.Command

NewTarget returns a subcommand to print available targets for a bundle

func NewTest

func NewTest() *cobra.Command

NewTest returns a subcommand to test bundle matching, deprecated

Types

type Apply

type Apply struct {
	FleetClient
	BundleInputArgs
	OutputArgsNoDefault
	Label                       map[string]string `usage:"Labels to apply to created bundles" short:"l"`
	TargetsFile                 string            `usage:"Addition source of targets and restrictions to be append"`
	Compress                    bool              `usage:"Force all resources to be compress" short:"c"`
	ServiceAccount              string            `usage:"Service account to assign to bundle created" short:"a"`
	SyncGeneration              int               `usage:"Generation number used to force sync the deployment"`
	TargetNamespace             string            `usage:"Ensure this bundle goes to this target namespace"`
	Paused                      bool              `usage:"Create bundles in a paused state"`
	Commit                      string            `usage:"Commit to assign to the bundle" env:"COMMIT"`
	Username                    string            `usage:"Basic auth username for helm repo" env:"HELM_USERNAME"`
	PasswordFile                string            `usage:"Path of file containing basic auth password for helm repo"`
	CACertsFile                 string            `usage:"Path of custom cacerts for helm repo" name:"cacerts-file"`
	SSHPrivateKeyFile           string            `usage:"Path of ssh-private-key for helm repo" name:"ssh-privatekey-file"`
	HelmRepoURLRegex            string            `` /* 166-byte string literal not displayed */
	KeepResources               bool              `usage:"Keep resources created after the GitRepo or Bundle is deleted" name:"keep-resources"`
	DeleteNamespace             bool              `usage:"Delete GitRepo target namespace after the GitRepo or Bundle is deleted" name:"delete-namespace"`
	HelmCredentialsByPathFile   string            `usage:"Path of file containing helm credentials for paths" name:"helm-credentials-by-path-file"`
	CorrectDrift                bool              `usage:"Rollback any change made from outside of Fleet" name:"correct-drift"`
	CorrectDriftForce           bool              `usage:"Use --force when correcting drift. Resources can be deleted and recreated" name:"correct-drift-force"`
	CorrectDriftKeepFailHistory bool              `usage:"Keep helm history for failed rollbacks" name:"correct-drift-keep-fail-history"`
	OCIReference                string            `usage:"OCI registry reference" name:"oci-reference"`
	OCIUsername                 string            `usage:"Basic auth username for OCI registry" env:"OCI_USERNAME"`
	OCIPasswordFile             string            `usage:"Path of file containing basic auth password for OCI registry" name:"oci-password-file"`
	OCIBasicHTTP                bool              `usage:"Use HTTP to access the OCI regustry" name:"oci-basic-http"`
	OCIInsecure                 bool              `usage:"Allow connections to OCI registry without certs" name:"oci-insecure"`
}

func (*Apply) PersistentPre added in v0.10.0

func (r *Apply) PersistentPre(_ *cobra.Command, _ []string) error

func (*Apply) Run

func (a *Apply) Run(cmd *cobra.Command, args []string) error

type BundleInputArgs

type BundleInputArgs struct {
	File       string `usage:"Location of the fleet.yaml" short:"f"`
	BundleFile string `usage:"Location of the raw Bundle resource yaml" short:"b"`
}

type CleanUp

type CleanUp struct {
	FleetClient
	Min    string `usage:"Minimum delay between deletes (default: 10ms)" name:"min"`
	Max    string `usage:"Maximum delay between deletes (default: 5s)" name:"max"`
	Factor string `usage:"Factor to increase delay between deletes (default: 1.1)" name:"factor"`
}

func (*CleanUp) PersistentPre added in v0.10.0

func (r *CleanUp) PersistentPre(_ *cobra.Command, _ []string) error

func (*CleanUp) Run

func (a *CleanUp) Run(cmd *cobra.Command, args []string) error

type Deploy added in v0.10.0

type Deploy struct {
	InputFile   string `usage:"Location of the YAML file containing the content and the bundledeployment resource" short:"i"`
	DryRun      bool   `usage:"Print the resources that would be deployed, but do not actually deploy them" short:"d"`
	Namespace   string `usage:"Set the default namespace. Deploy helm chart into this namespace." short:"n"`
	KubeVersion string `usage:"For dry runs, sets the Kubernetes version to assume when validating Chart Kubernetes version constraints."`

	// AgentNamespace is set as an annotation on the chart.yaml in the helm release. Fleet-agent will manage charts with a matching label.
	AgentNamespace string `` /* 182-byte string literal not displayed */
}

func (*Deploy) Run added in v0.10.0

func (d *Deploy) Run(cmd *cobra.Command, args []string) error

type Fleet

type Fleet struct {
}

func (*Fleet) Run

func (r *Fleet) Run(cmd *cobra.Command, _ []string) error

type FleetClient added in v0.10.0

type FleetClient struct {
	command.DebugConfig
	Namespace  string `usage:"namespace" env:"NAMESPACE" default:"fleet-local" short:"n"`
	Kubeconfig string `usage:"kubeconfig for authentication" short:"k"`
	Context    string `usage:"kubeconfig context for authentication"`
}

type Getter

type Getter interface {
	Get() (*client.Client, error)
	GetNamespace() string
}
var (
	Client Getter
)

type OutputArgsNoDefault

type OutputArgsNoDefault struct {
	Output string `usage:"Output contents to file or - for stdout"  short:"o"`
}

type Target added in v0.10.0

type Target struct {
	BundleFile    string `usage:"Location of the Bundle resource yaml" short:"b"`
	DumpInputList bool   `usage:"Dump the live resources, which impact targeting, like clusters, as YAML" short:"l"`

	Namespace string `usage:"Override the namespace of the bundle. Targeting searches this namespace for clusters." short:"n"`
}

func (*Target) Run added in v0.10.0

func (t *Target) Run(cmd *cobra.Command, args []string) error

type Test

type Test struct {
	BundleInputArgs
	Quiet      bool              `usage:"Just print the match and don't print the resources" short:"q"`
	Group      string            `usage:"Cluster group to match against" short:"g"`
	Name       string            `usage:"Cluster name to match against" short:"N"`
	Label      map[string]string `usage:"Cluster labels to match against" short:"l"`
	GroupLabel map[string]string `usage:"Cluster group labels to match against" short:"L"`
	Target     string            `usage:"Explicit target to match" short:"t"`
}

func (*Test) Run

func (m *Test) Run(cmd *cobra.Command, args []string) error

Directories

Path Synopsis
Package apply creates bundle resources from gitrepo resources.
Package apply creates bundle resources from gitrepo resources.
Package match is used to test matching a bundles to a target on the command line.
Package match is used to test matching a bundles to a target on the command line.
Package writer provides a writer that can be used to write to a file or stdout.
Package writer provides a writer that can be used to write to a file or stdout.

Jump to

Keyboard shortcuts

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