Documentation ¶
Index ¶
- Variables
- func AddDeleteAllFlag(flag *bool, cmd *cobra.Command)
- func AddE2EConfigFlags(cmd *cobra.Command)
- func AddGenFlags(gen *ops.GenConfig, cmd *cobra.Command)
- func AddKubeconfigFlag(cfg *Kubeconfig, cmd *cobra.Command)
- func AddModeFlag(mode *ops.Mode, cmd *cobra.Command)
- func AddNamespaceFlag(str *string, cmd *cobra.Command)
- func AddRBACModeFlags(mode *RBACMode, cmd *cobra.Command, defaultMode RBACMode)
- func AddSkipPreflightFlag(flag *bool, cmd *cobra.Command)
- func AddSonobuoyConfigFlag(cfg *SonobuoyConfig, cmd *cobra.Command)
- func AddSonobuoyImage(image *string, cmd *cobra.Command)
- func GetConfigWithMode(sonobuoyCfg *SonobuoyConfig, mode client.Mode) *config.Config
- func GetE2EConfig(mode ops.Mode, cmd *cobra.Command) (*ops.E2EConfig, error)
- type Kubeconfig
- type RBACMode
- type SonobuoyConfig
Constants ¶
This section is empty.
Variables ¶
var ( //ErrRBACNoClient is the error returned when we need a client but didn't get on ErrRBACNoClient = errors.New(`can't use nil client with "detect" RBAC mode`) )
var GenCommand = &cobra.Command{ Use: "gen", Short: "Generates a sonobuoy manifest for submission via kubectl", Run: genManifest, Args: cobra.ExactArgs(0), }
GenCommand is exported so it can be extended.
var RootCmd = &cobra.Command{
Use: "sonobuoy",
Short: "Generate reports on your kubernetes cluster",
Long: "Sonobuoy is an introspective kubernetes component that generates reports on cluster conformance, configuration, and more",
Run: rootCmd,
}
RootCmd is the root command that is executed when sonobuoy is run without any subcommands.
Functions ¶
func AddDeleteAllFlag ¶ added in v0.11.0
AddDeleteAllFlag adds a boolean flag for deleting everything (including E2E tests).
func AddE2EConfigFlags ¶ added in v0.11.0
AddE2EConfigFlags adds two arguments: --e2e-focus and --e2e-skip. These are not taken as pointers, as they are only used by GetE2EConfig.
func AddGenFlags ¶
AddGenFlags adds generation flags to a command.
func AddKubeconfigFlag ¶ added in v0.11.0
func AddKubeconfigFlag(cfg *Kubeconfig, cmd *cobra.Command)
AddKubeconfigFlag adds a kubeconfig flag to the provided command.
func AddModeFlag ¶ added in v0.11.0
AddModeFlag initialises a mode flag. The mode is a preset configuration of sonobuoy configuration and e2e configuration variables. Mode can be partially or fully overridden by specifying config, e2e-focus, and e2e-skip. The variables specified by those flags will overlay the defaults provided by the given mode.
func AddNamespaceFlag ¶ added in v0.11.0
AddNamespaceFlag initialises a namespace flag.
func AddRBACModeFlags ¶ added in v0.11.0
AddRBACModeFlags adds an E2E Argument with the provided default.
func AddSkipPreflightFlag ¶ added in v0.11.0
AddSkipPreflightFlag adds a boolean flag to skip preflight checks.
func AddSonobuoyConfigFlag ¶ added in v0.11.0
func AddSonobuoyConfigFlag(cfg *SonobuoyConfig, cmd *cobra.Command)
AddSonobuoyConfigFlag adds a SonobuoyConfig flag to the provided command.
func AddSonobuoyImage ¶ added in v0.11.0
AddSonobuoyImage initialises an image url flag.
func GetConfigWithMode ¶ added in v0.11.0
func GetConfigWithMode(sonobuoyCfg *SonobuoyConfig, mode client.Mode) *config.Config
GetConfigWithMode creates a config with the following algorithim: If the SonobuoyConfig isn't nil, use that If not, use the supplied Mode to modify a default config
func GetE2EConfig ¶ added in v0.11.0
GetE2EConfig gets the E2EConfig from the mode, then overrides them with e2e-focus and e2e-skip if they are provided. We can't rely on the zero value of the flags, as "" is a valid focus or skip value.
Types ¶
type Kubeconfig ¶ added in v0.11.0
type Kubeconfig struct {
*clientcmd.ClientConfigLoadingRules
}
Kubeconfig represents an explict or implict kubeconfig
func (*Kubeconfig) Get ¶ added in v0.11.0
func (c *Kubeconfig) Get() (*rest.Config, error)
Get returns a rest Config, possibly based on a provided config
func (*Kubeconfig) Set ¶ added in v0.11.0
func (c *Kubeconfig) Set(str string) error
Set sets the explicit path of the loader to the provided config file
func (*Kubeconfig) String ¶ added in v0.11.0
func (c *Kubeconfig) String() string
String needed for pflag.Value
func (*Kubeconfig) Type ¶ added in v0.11.0
func (c *Kubeconfig) Type() string
Type needed for pflag.Value
type RBACMode ¶ added in v0.11.0
type RBACMode string
RBACMode determines whether to enable or disable RBAC for a Sonobuoy run
func (*RBACMode) Enabled ¶ added in v0.11.0
func (r *RBACMode) Enabled(client *kubernetes.Clientset) (bool, error)
Enabled retrieves whether to enable or disable rbac. If the mode is disable or enabled, the client is unused. If the mode is "detect", the client will be used to query the server's API groups and detect whether an RBAC api group exists.
func (*RBACMode) Set ¶ added in v0.11.0
Set the RBACMode to the given string, or error if it's not a known RBAC mode.
type SonobuoyConfig ¶ added in v0.11.0
SonobuoyConfig is a config.Config that implements pflag.Value from a file path
func (*SonobuoyConfig) Get ¶ added in v0.11.0
func (c *SonobuoyConfig) Get() *config.Config
Get will return the config.Config if one is available, otherwise nil.
func (*SonobuoyConfig) Set ¶ added in v0.11.0
func (c *SonobuoyConfig) Set(str string) error
Set attempts to read a file, then deserialise the json into a config.Config struct.
func (*SonobuoyConfig) String ¶ added in v0.11.0
func (c *SonobuoyConfig) String() string
String is needed for pflag.Value.
func (*SonobuoyConfig) Type ¶ added in v0.11.0
func (c *SonobuoyConfig) Type() string
Type is needed for pflag.Value.