Documentation ¶
Index ¶
- func AddFlagBoolP(cmd *cobra.Command, flagDetails []byte) *bool
- func AddFlagStringP(cmd *cobra.Command, flagDetails []byte) *string
- func CmdErrorHandling(err error)
- func GetNamespace(flags *genericclioptions.ConfigFlags) (string, error)
- func InVersionRangeInclusive(start, v string) bool
- func Indicator(shutdownCh <-chan struct{})
- func ParseVersionString(v string) (int, int, int, error)
- func PodInDeployment(pod apiv1.Pod, deployment string) bool
- func PrintError(e error)
- type CmdFlag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFlagBoolP ¶
AddFlag for Boolean. Receives cobra references and Json byte array This function returns the command line arguments of bool type
func AddFlagStringP ¶
AddFlag for String. Receives cobra references and Json byte array This function returns the command line arguments of string type
func CmdErrorHandling ¶
func CmdErrorHandling(err error)
CmdErrorHandling receives an error value and gracefully exits in case of exitError
func GetNamespace ¶
func GetNamespace(flags *genericclioptions.ConfigFlags) (string, error)
GetNamespace takes a set of kubectl flag values and returns the namespace we should be operating in
func InVersionRangeInclusive ¶
InVersionRangeInclusive checks that the middle version is between the other two versions
func Indicator ¶
func Indicator(shutdownCh <-chan struct{})
Indicator function receives a channel and keeps printing dots every second to notify background process
func ParseVersionString ¶
ParseVersionString returns the major, minor, and patch numbers of a version string
func PodInDeployment ¶
PodInDeployment returns whether a pod is part of a deployment with the given name a pod is considered to be in {deployment} if it is owned by a replicaset with a name of format {deployment}-otherchars
func PrintError ¶
func PrintError(e error)
PrintError receives an error value and prints it if it exists
Types ¶
type CmdFlag ¶
type CmdFlag struct { /*************************WARNING************************* * Please make sure to maintain the same name for json * * elements in this struct and constant/constant.go file * ********************************************************/ CmdLName string `json:"CmdLName,omitempty"` CmdSName string `json:"CmdSName,omitempty"` DefValueStr string `json:"DefValueStr,omitempty"` DefValueB bool `json:"DefValueB,omitempty"` CmdDesc string `json:"CmdDesc,omitempty"` }
Struct CmdFlag for templating cobra command types