cmds

package
v0.3.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client          *client.Getter
	SystemNamespace string
	Debug           command.DebugConfig
)

Functions

func App

func App() *cobra.Command

func NewAgent

func NewAgent() *cobra.Command

func NewApply

func NewApply() *cobra.Command

func NewCluster

func NewCluster() *cobra.Command

func NewClusterCreate

func NewClusterCreate() *cobra.Command

func NewClusterDelete

func NewClusterDelete() *cobra.Command

func NewClusterLS

func NewClusterLS() *cobra.Command

func NewGitRepo

func NewGitRepo() *cobra.Command

func NewGitRepoAdd

func NewGitRepoAdd() *cobra.Command
func NewGitRepoDelete() *cobra.Command {
	return command.Command(&GitRepoDelete{}, cobra.Command{
		Use:   "delete",
		Short: "Delete cluster registration gitRepo(s)",
		Args:  cobra.ArbitraryArgs,
	})
}

type GitRepoDelete struct { }

func (l *GitRepoDelete) Run(cmd *cobra.Command, args []string) error {
	c, err := Client.Get()
	if err != nil {
		return err
	}

	var errors []error
	for _, arg := range args {
		err := c.Fleet.ClusterRegistrationGitRepo().Delete(c.Namespace, arg, nil)
		if err == nil {
			fmt.Println(arg)
		} else {
			logrus.Errorf("failed to delete %s: %v", arg, err)
			errors = append(errors, err)
		}
	}

	return merr.NewErrors(errors...)
}

func NewGitRepoLS

func NewGitRepoLS() *cobra.Command

func NewInstall

func NewInstall() *cobra.Command

func NewManager

func NewManager() *cobra.Command

func NewSimulator added in v0.2.0

func NewSimulator() *cobra.Command

func NewTest

func NewTest() *cobra.Command

func NewToken

func NewToken() *cobra.Command

func NewTokenCreate

func NewTokenCreate() *cobra.Command

func NewTokenDelete

func NewTokenDelete() *cobra.Command

func NewTokenLS

func NewTokenLS() *cobra.Command

Types

type Agent

type Agent struct {
	ClientID       string            `usage:"Unique id used to identify the cluster, must match Spec.ClientID"`
	AgentNamespace string            `usage:"Namespace to run the agent in" default:"fleet-agent-system"`
	CAFile         string            `usage:"File containing optional CA cert for fleet controller cluster" name:"ca-file" short:"c"`
	NoCA           bool              `usage:"Use no custom CA for a fleet controller that is signed by a well known CA with a proper CN."`
	ServerURL      string            `usage:"The full URL to the fleet controller cluster"`
	Labels         map[string]string `usage:"Labels to apply to cluster upon registration"`
}

func (*Agent) Run

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

type Apply

type Apply struct {
	BundleInputArgs
	OutputArgsNoDefault
	BundleNamePrefix string `usage:"All bundle names will be prefixed with this string"`
	File             string `usage:"Read full bundle contents from file" short:"f"`
	Compress         bool   `usage:"Force all resources to be compress" short:"c"`
	ServiceAccount   string `usage:"Service account to assign to bundle created" short:"a"`
}

func (*Apply) Run

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

type BundleInputArgs

type BundleInputArgs struct {
	BundleFile string `usage:"Location of the bundle.yaml" short:"b"`
}

type ClusterCreate

type ClusterCreate struct {
	Name           string `usage:"cluster name (default: random)"`
	ValidateSecret bool   `usage:"Validate that the secret exists and is valid" default:"true"`
}

func (*ClusterCreate) Run

func (l *ClusterCreate) Run(cmd *cobra.Command, args []string) error

type ClusterDelete

type ClusterDelete struct {
}

func (*ClusterDelete) Run

func (l *ClusterDelete) Run(cmd *cobra.Command, args []string) error

type ClusterLS

type ClusterLS struct {
	table.Args
	AllNamespaces bool `usage:"all namespaces" short:"A"`
}

func (*ClusterLS) Run

func (l *ClusterLS) Run(cmd *cobra.Command, args []string) error

type Fleet added in v0.3.0

type Fleet struct {
	SystemNamespace string `usage:"System namespace of the controller" default:"fleet-system"`
	Namespace       string `usage:"namespace" env:"NAMESPACE" default:"default" short:"n" env:"NAMESPACE"`
	Kubeconfig      string `usage:"kubeconfig for authentication" short:"k"`
	Context         string `usage:"kubeconfig context for authentication"`
}

func (*Fleet) PersistentPre added in v0.3.0

func (r *Fleet) PersistentPre(cmd *cobra.Command, args []string) error

func (*Fleet) Run added in v0.3.0

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

type GitRepoAdd

type GitRepoAdd struct {
	Name     string   `usage:"The name to assign to the git repo"`
	Branch   string   `usage:"The branch to watch" short:"b"`
	Revision string   `usage:"A specific commit or tag to watch" short:"r"`
	Secret   string   `usage:"Secret name containing the credentials used to perform the git clone"`
	Dirs     []string `usage:"Directories in the git repo that contains bundles. Supports path globbing" short:"d"`
}

func (*GitRepoAdd) Run

func (l *GitRepoAdd) Run(cmd *cobra.Command, args []string) error

type GitRepoLS

type GitRepoLS struct {
	table.Args
	AllNamespaces bool `usage:"all namespaces" short:"A"`
}

func (*GitRepoLS) Run

func (l *GitRepoLS) Run(cmd *cobra.Command, args []string) error

type Manager

type Manager struct {
	SystemNamespace string `usage:"Namespace that will be use in controller" default:"fleet-system"`
	ManagerImage    string `usage:"Image to use for controller"`
	AgentImage      string `usage:"Image to use for all agents"`
	CRDsOnly        bool   `usage:"Output CustomResourceDefinitions only"`
	OutputArgs
}

func (*Manager) Run

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

type OutputArgs

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

type OutputArgsNoDefault

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

type Simulator added in v0.2.0

type Simulator struct {
	CAFile    string            `usage:"File containing optional CA cert for fleet controller cluster" name:"ca-file" short:"c"`
	NoCA      bool              `usage:"Use no custom CA for a fleet controller that is signed by a well known CA with a proper CN."`
	ServerURL string            `usage:"The full URL to the fleet controller cluster"`
	Clusters  int               `usage:"Number of clusters to simulate" default:"100"`
	Image     string            `usage:"Simulator image"`
	Labels    map[string]string `usage:"Labels to apply to the new cluster on register (example key=value,key2=value2)" short:"l"`
}

func (*Simulator) Run added in v0.2.0

func (s *Simulator) 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"`
	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"`
	PrintBundle bool              `usage:"Don't run match and just output the generated bundle"`
}

func (*Test) Run

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

type TokenCreate

type TokenCreate struct {
	Name string `usage:"token name (default: random)"`
	TTL  string `usage:"How long the generated registration token is valid, 0 means forever" default:"1440m" short:"t"`
}

func (*TokenCreate) Run

func (l *TokenCreate) Run(cmd *cobra.Command, args []string) error

type TokenDelete

type TokenDelete struct {
}

func (*TokenDelete) Run

func (l *TokenDelete) Run(cmd *cobra.Command, args []string) error

type TokenLS

type TokenLS struct {
	table.Args
	AllNamespaces bool `usage:"all namespaces" short:"A"`
}

func (*TokenLS) Run

func (l *TokenLS) Run(cmd *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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