Documentation ¶
Index ¶
- Variables
- func AddCRISocketFlag(flagSet *pflag.FlagSet, criSocket *string)
- func DefaultInitConfiguration() *kubeadmapiv1.InitConfiguration
- func Examples(s string) string
- func GetClientSet(file string, dryRun bool) (clientset.Interface, error)
- func GetKubeConfigPath(file string) string
- func InteractivelyConfirmAction(action, question string, r io.Reader) error
- func LongDesc(s string) string
- func SubCmdRun() func(c *cobra.Command, args []string)
- func ValidateExactArgNumber(args []string, supportedArgs []string) error
Constants ¶
This section is empty.
Variables ¶
var ( // AlphaDisclaimer to be places at the end of description of commands in alpha release AlphaDisclaimer = ` Alpha Disclaimer: this command is currently alpha. ` // MacroCommandLongDescription provide a standard description for "macro" commands MacroCommandLongDescription = LongDesc(` This command is not meant to be run on its own. See list of available subcommands. `) )
Functions ¶
func AddCRISocketFlag ¶
AddCRISocketFlag adds the cri-socket flag to the supplied flagSet
func DefaultInitConfiguration ¶
func DefaultInitConfiguration() *kubeadmapiv1.InitConfiguration
DefaultInitConfiguration return default InitConfiguration. Avoid running the CRI auto-detection code as we don't need it.
func Examples ¶
Examples is designed to help with producing examples for command line usage. Its behavior is mimicking a similar kubectl function in the following ways: - Beginning and trailing space characters (including empty lines), are stripped from the output. - All lines of text are stripped of beginning and trailing spaces (thus loosing indentation) and are then double-space indented.
func GetClientSet ¶
GetClientSet gets a real or fake client depending on whether the user is dry-running or not
func GetKubeConfigPath ¶
GetKubeConfigPath can be used to search for a kubeconfig in standard locations if and empty string is passed to the function. If a non-empty string is passed the function returns the same string.
func InteractivelyConfirmAction ¶
InteractivelyConfirmAction asks the user whether they _really_ want to take the action.
func LongDesc ¶
LongDesc is designed to help with producing better long command line descriptions in code. Its behavior is somewhat inspired by the same function of kubectl, which uses Markdown for the input message. This one is not Markdown compliant, but it covers the needs of kubeadm. In particular: - Beginning and trailing space characters (including empty lines), are stripped from the output. - Consecutive non-empty lines of text are joined with spaces to form paragraphs. - Paragraphs are blocks of text divided by one or more empty lines or lines consisting only of "space" characters. - Paragraphs are spaced by precisely one empty line in the output. - A line break can be forced by adding a couple of empty spaces at the end of a text line. - All indentation is removed. The resulting output is not indented.
func SubCmdRun ¶
SubCmdRun returns a function that handles a case where a subcommand must be specified Without this callback, if a user runs just the command without a subcommand, or with an invalid subcommand, cobra will print usage information, but still exit cleanly.
func ValidateExactArgNumber ¶
ValidateExactArgNumber validates that the required top-level arguments are specified
Types ¶
This section is empty.