package sanity
import "k8s.io/kubectl/pkg/cmd/util/sanity"
Index ¶
- Variables
- func CheckExamples(cmd *cobra.Command) []error
- func CheckFlags(cmd *cobra.Command) []error
- func CheckGlobalVarFlags() []error
- func CheckLongDesc(cmd *cobra.Command) []error
- func RunCmdChecks(cmd *cobra.Command, cmdChecks []CmdCheck, skipCmd []string) []error
- func RunGlobalChecks(globalChecks []GlobalCheck) []error
- type CmdCheck
- type GlobalCheck
Variables ¶
var ( // AllCmdChecks is the list of CmdCheck type functions AllCmdChecks = []CmdCheck{ CheckLongDesc, CheckExamples, CheckFlags, } // AllGlobalChecks is the list of GlobalCheck type functions AllGlobalChecks = []GlobalCheck{ CheckGlobalVarFlags, } )
Functions ¶
func CheckExamples ¶
CheckExamples checks if the command examples are valid
func CheckFlags ¶
CheckFlags checks if the command-line flags are valid
func CheckGlobalVarFlags ¶
func CheckGlobalVarFlags() []error
CheckGlobalVarFlags checks if the global flags are valid
func CheckLongDesc ¶
CheckLongDesc checks if the long description is valid
func RunCmdChecks ¶
RunCmdChecks runs all the CmdCheck functions passed, skipping skippable commands and looks for error
func RunGlobalChecks ¶
func RunGlobalChecks(globalChecks []GlobalCheck) []error
RunGlobalChecks runs all the GlobalCheck functions passed and checks for error
Types ¶
type CmdCheck ¶
CmdCheck is the commom type of functions to check cobra commands
type GlobalCheck ¶
type GlobalCheck func() []error
GlobalCheck is the common type of functions to check global flags
Source Files ¶
cmd_sanity.go
- Version
- v0.32.3 (latest)
- Published
- Mar 12, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 5 days ago –
Tools for package owners.