Documentation ¶
Index ¶
- Constants
- func AddClusterFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)
- func AddCommonFlagsForFlux(fs *pflag.FlagSet, opts *InstallOpts)
- func AddCommonFlagsForGit(fs *pflag.FlagSet, opts *git.Options)
- func AddCommonFlagsForKubeconfig(fs *pflag.FlagSet, outputPath, authenticatorRoleARN *string, ...)
- func AddCommonFlagsForKubernetes(fs *pflag.FlagSet, opts *KubernetesOpts, defaultNamespace string)
- func AddCommonFlagsForProfile(fs *pflag.FlagSet, opts *profile.Options)
- func AddConfigFileFlag(fs *pflag.FlagSet, path *string)
- func AddLoadBalancerIPFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)
- func AddLoadBalancerResourceGroupFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)
- func AddLocationFlag(fs *pflag.FlagSet, p *api.ClusterConfig)
- func AddResourceCmd(flagGrouping *FlagGrouping, parentVerbCmd *cobra.Command, newCmd func(*Cmd))
- func AddVersionFlag(fs *pflag.FlagSet, meta *api.ClusterConfig, extraUsageInfo string)
- func AddWaitFlag(fs *pflag.FlagSet, wait *bool, description string)
- func AddWaitFlagWithFullDescription(fs *pflag.FlagSet, wait *bool, description string)
- func ClusterNameFlag(cmd *Cmd) string
- func ErrCannotUseWithConfigFile(what string) error
- func ErrClusterFlagAndArg(cmd *Cmd, nameFlag, nameArg string) error
- func ErrFlagAndArg(kind, flag, arg string) error
- func ErrMustBeSet(pathOrFlag string) error
- func ErrUnsupportedNameArg() error
- func GetNameArg(args []string) string
- func LoadConfigFromFile(configFile string) (*api.ClusterConfig, error)
- func ValidateGitOptions(opts *git.Options) error
- type ClusterConfigLoader
- type Cmd
- type FlagGrouping
- type InstallOpts
- type KubernetesOpts
- type NamedFlagSetGroup
Constants ¶
const IncompatibleFlags = "cannot be used at the same time"
IncompatibleFlags is a common substring of an error message
Variables ¶
This section is empty.
Functions ¶
func AddClusterFlag ¶
func AddClusterFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)
AddClusterFlag adds a common --cluster flag for cluster name. Use this for commands whose principal resource is *not* a cluster.
func AddCommonFlagsForFlux ¶
func AddCommonFlagsForFlux(fs *pflag.FlagSet, opts *InstallOpts)
AddCommonFlagsForFlux configures the flags required to install Flux on a cluster and have it point to the specified Git repository.
func AddCommonFlagsForGit ¶
AddCommonFlagsForGit configures the flags required to interact with a Git repository.
func AddCommonFlagsForKubeconfig ¶
func AddCommonFlagsForKubeconfig(fs *pflag.FlagSet, outputPath, authenticatorRoleARN *string, setContext, autoPath *bool, exampleName string)
AddCommonFlagsForKubeconfig adds common flags for controlling how output kubeconfig is written
func AddCommonFlagsForKubernetes ¶
func AddCommonFlagsForKubernetes(fs *pflag.FlagSet, opts *KubernetesOpts, defaultNamespace string)
AddCommonFlagsForKubernetes configures the flags required to interact with Kubernetes cluster
func AddCommonFlagsForProfile ¶
AddCommonFlagsForProfile configures the flags required to enable a profile.
func AddConfigFileFlag ¶
AddConfigFileFlag adds common --config-file flag
func AddLoadBalancerIPFlag ¶
func AddLoadBalancerIPFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)
AddLoadBalancerIPFlag adds a common --load-balancer-ip flag for load balancer ip.
func AddLoadBalancerResourceGroupFlag ¶
func AddLoadBalancerResourceGroupFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)
AddLoadBalancerResourceGroupFlag adds a common --load-balancer-ip-rg flag for load balancer ip resource group.
func AddLocationFlag ¶
func AddLocationFlag(fs *pflag.FlagSet, p *api.ClusterConfig)
AddLocationFlag adds common --location flag
func AddResourceCmd ¶
func AddResourceCmd(flagGrouping *FlagGrouping, parentVerbCmd *cobra.Command, newCmd func(*Cmd))
AddResourceCmd create a registers a new command under the given verb command
func AddVersionFlag ¶
func AddVersionFlag(fs *pflag.FlagSet, meta *api.ClusterConfig, extraUsageInfo string)
AddVersionFlag adds common --version flag
func AddWaitFlag ¶
AddWaitFlag adds common --wait flag
func AddWaitFlagWithFullDescription ¶
AddWaitFlagWithFullDescription adds common --wait flag
func ClusterNameFlag ¶
ClusterNameFlag returns the flag to use for the cluster name taking the principal resource into account.
func ErrCannotUseWithConfigFile ¶
ErrCannotUseWithConfigFile is a common error message
func ErrClusterFlagAndArg ¶
ErrClusterFlagAndArg wraps ErrFlagAndArg() by passing in the proper flag name.
func ErrFlagAndArg ¶
ErrFlagAndArg may be used to err for options that can be given as flags /and/ arg but only one is allowed to be used.
func ErrMustBeSet ¶
ErrMustBeSet is a common error message
func ErrUnsupportedNameArg ¶
func ErrUnsupportedNameArg() error
ErrUnsupportedNameArg reports unsupported usage of `name` argument
func GetNameArg ¶
GetNameArg tests to ensure there is only 1 name argument
func LoadConfigFromFile ¶
func LoadConfigFromFile(configFile string) (*api.ClusterConfig, error)
LoadConfigFromFile loads ClusterConfig from configFile
func ValidateGitOptions ¶
ValidateGitOptions validates the provided Git options.
Types ¶
type ClusterConfigLoader ¶
type ClusterConfigLoader interface {
Load() error
}
ClusterConfigLoader is an interface that loaders should implement
func NewGitOpsConfigLoader ¶
func NewGitOpsConfigLoader(cmd *Cmd) ClusterConfigLoader
NewGitOpsConfigLoader creates a new ClusterConfigLoader which handles loading of ClusterConfigFile v.s. using CLI flags for GitOps-related commands.
func NewMetadataLoader ¶
func NewMetadataLoader(cmd *Cmd) ClusterConfigLoader
NewMetadataLoader handles loading of clusterConfigFile vs using flags for all commands that require only metadata fields, e.g. `eksctl delete cluster` or `eksctl utils update-kube-proxy` and other similar commands that do simple operations against existing clusters
type Cmd ¶
type Cmd struct { CobraCommand *cobra.Command FlagSetGroup *NamedFlagSetGroup Validate bool NameArg string ClusterConfigFile string ClusterConfig *api.ClusterConfig }
Cmd hold common attributes between commands
type FlagGrouping ¶
type FlagGrouping struct {
// contains filtered or unexported fields
}
FlagGrouping holds a superset of all flagsets for all commands
func (*FlagGrouping) New ¶
func (g *FlagGrouping) New(cmd *cobra.Command) *NamedFlagSetGroup
New creates a new group of flagsets for use with a subcommand
type InstallOpts ¶
type InstallOpts struct { GitOptions git.Options GitPaths []string GitLabel string GitFluxPath string WithHelm bool HelmVersions []string ManifestGeneration bool GarbageCollection bool AcrRegistry bool OverrideValues bool FluxChartVersion string HelmOperatorChartVersion string SkipInstall bool KubernetesOpts KubernetesOpts }
InstallOpts are the installation options for Flux
type KubernetesOpts ¶
KubernetesOpts common kubernetes opts
type NamedFlagSetGroup ¶
type NamedFlagSetGroup struct {
// contains filtered or unexported fields
}
NamedFlagSetGroup holds a single group of flagsets
func (*NamedFlagSetGroup) AddTo ¶
func (n *NamedFlagSetGroup) AddTo(cmd *cobra.Command)
AddTo mixes all flagsets in the given group into another flagset