Documentation
¶
Index ¶
- Constants
- func AddCertFlags(cmd *cobra.Command)
- func GetCertFlags(cmd *cobra.Command) (tls.KeyPairs, error)
- func GetCredentials(platform string, cmd *cobra.Command) map[string]string
- func GetFilters(cmd *cobra.Command) (filter map[string]string, warns []string, err error)
- func GetGenericCredentials(cmd *cobra.Command) map[string]string
- func GetMultipleClustersName(cmd *cobra.Command, args []string) ([]string, error)
- func GetOneClusterName(cmd *cobra.Command, args []string, validate bool) (clusterName string, err error)
- func GetVariables(varsStr string) (variables map[string]string, warns []string, err error)
- func HardConfirmation(question, answer string) bool
- func StringToArray(val string) ([]string, error)
- func StringToMap(str string) (map[string]string, []string, error)
- type ApplyOpts
- type ClusterNodeInfo
- func (cni ClusterNodeInfo) IPs() string
- func (cni ClusterNodeInfo) JSON(pp bool) (string, error)
- func (cni ClusterNodeInfo) Sprintf(format string, pp bool) (string, error)
- func (cni ClusterNodeInfo) TOML() (string, error)
- func (cni ClusterNodeInfo) Table(wide bool) error
- func (cni ClusterNodeInfo) YAML() (string, error)
- type DeleteOpts
- type GetEnvOpts
- type GetNodesOpts
- type InitOpts
- type UpdateOpts
Constants ¶
const DefaultShell = "bash"
DefaultShell is the default shell used to print the export and unset commands
const EnvConfigPrefix = "KUBEKIT_VAR_"
EnvConfigPrefix is the prefix for the variables to pass to KubeKit through environment variables
Variables ¶
This section is empty.
Functions ¶
func AddCertFlags ¶
AddCertFlags adds the flags to the given command to receive certificate files: private key and certificate.
func GetCertFlags ¶
GetCertFlags creates the list of CA certificates with the original file name and CN. The original filename will be replaced when the certificate is saved in the certificates directory.
func GetCredentials ¶
GetCredentials get the credentials from cobra CLI flags and insert them into the list of variables. Returns, as a warning, the list of variables ignored or replaced
func GetFilters ¶
GetFilters returns the cluster filters to from commands such as `get clusters`. It returns warning or errors if the filters are not use correctly
func GetGenericCredentials ¶
GetGenericCredentials get the credentials from cobra CLI flags for any given platform and insert them into the list of variables. Returns, as a warning, the list of variables ignored or replaced
func GetMultipleClustersName ¶
GetMultipleClustersName retrive from the CLI (cobra) arguments one or more clusters name
func GetOneClusterName ¶
func GetOneClusterName(cmd *cobra.Command, args []string, validate bool) (clusterName string, err error)
GetOneClusterName retrive from the CLI (cobra) arguments one cluster name which could be valid or not
func GetVariables ¶
GetVariables return a map for variable name and its value from the CLI parmeters and environment variables
func HardConfirmation ¶
HardConfirmation ask to the user a question, the answer has to be typed, it's not defaulted. If the received answer is same as the expected one, the confirmation succeed
func StringToArray ¶
StringToArray convert the cobra flag of type StringArray to an array of strings
Types ¶
type ApplyOpts ¶
type ApplyOpts struct { ClusterName string Action string PackageURL string ForcePackage bool UserCACerts tls.KeyPairs }
ApplyOpts encapsulate all the CLI parameters received from the `apply` command
type ClusterNodeInfo ¶
type ClusterNodeInfo map[string]configurator.Hosts
ClusterNodeInfo is an list of hosts with their important information
func (ClusterNodeInfo) IPs ¶
func (cni ClusterNodeInfo) IPs() string
IPs returns only the IP address of the nodes
func (ClusterNodeInfo) JSON ¶
func (cni ClusterNodeInfo) JSON(pp bool) (string, error)
JSON returns the nodes information in JSON format
func (ClusterNodeInfo) Sprintf ¶
func (cni ClusterNodeInfo) Sprintf(format string, pp bool) (string, error)
Sprintf returns a string to print in the given format. Pretty Print (`pp`) applies only for JSON
func (ClusterNodeInfo) TOML ¶
func (cni ClusterNodeInfo) TOML() (string, error)
TOML returns the nodes information in TOML format
func (ClusterNodeInfo) Table ¶
func (cni ClusterNodeInfo) Table(wide bool) error
Table returns the nodes information as a table
func (ClusterNodeInfo) YAML ¶
func (cni ClusterNodeInfo) YAML() (string, error)
YAML returns the nodes information in YAML format
type DeleteOpts ¶
DeleteOpts encapsulate all the CLI parameters received from the `delete` command
func DeleteGetOpts ¶
DeleteGetOpts get the `delete` command parameters from the cobra commands and arguments
func (*DeleteOpts) Confirm ¶
func (opts *DeleteOpts) Confirm() bool
Confirm ask to the user to confirm to delete the cluster
type GetEnvOpts ¶
GetEnvOpts encapsulate all the CLI parameters received from the `get env` command
func GetEnvGetOpts ¶
GetEnvGetOpts get the `get env` command parameters from the cobra commands and arguments
type GetNodesOpts ¶
type GetNodesOpts struct { ClustersName []string Output string Pp bool Nodes []string Pools []string }
GetNodesOpts encapsulate all the CLI parameters received from the `get nodes` command
func GetNodesGetOpts ¶
func GetNodesGetOpts(cmd *cobra.Command, args []string) (opts *GetNodesOpts, warns []string, err error)
GetNodesGetOpts get the `get env` command parameters from the cobra commands and arguments
type InitOpts ¶
type InitOpts struct { ClusterName string Platform string Path string Format string Variables map[string]string Credentials map[string]string TemplateName string // --template flags is not functional yet Update bool // Deprecate --update flag when `update` command exists }
InitOpts encapsulate all the CLI parameters received from the `init` command
type UpdateOpts ¶
type UpdateOpts struct { ClusterName string Variables map[string]string Credentials map[string]string TemplateName string // --template flags is not functional yet }
UpdateOpts encapsulate all the CLI parameters received from the `update` command
func UpdateGetOpts ¶
UpdateGetOpts get the `update` command parameters from the cobra commands and arguments