Documentation ¶
Index ¶
- func Focus(testCases []reporters.JUnitTestCase) string
- func GetModes() []string
- func UntarAll(reader io.Reader, destFile, prefix string) error
- type DeleteConfig
- type E2EConfig
- type GenConfig
- type Interface
- type LogConfig
- type Mode
- type ModeConfig
- type PreflightConfig
- type PrintableTestCases
- type Reader
- type RetrieveConfig
- type RunConfig
- type SonobuoyClient
- func (s *SonobuoyClient) Client() (kubernetes.Interface, error)
- func (c *SonobuoyClient) Delete(cfg *DeleteConfig) error
- func (s *SonobuoyClient) DynamicClientPool() dynamic.ClientPool
- func (c *SonobuoyClient) GenerateManifest(cfg *GenConfig) ([]byte, error)
- func (c *SonobuoyClient) GetStatus(namespace string) (*aggregation.Status, error)
- func (c *SonobuoyClient) GetTests(reader io.Reader, show string) ([]reporters.JUnitTestCase, error)
- func (s *SonobuoyClient) LogReader(cfg *LogConfig) (*Reader, error)
- func (c *SonobuoyClient) PreflightChecks(cfg *PreflightConfig) []error
- func (c *SonobuoyClient) RetrieveResults(cfg *RetrieveConfig) (io.Reader, error)
- func (c *SonobuoyClient) Run(cfg *RunConfig) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Focus ¶
func Focus(testCases []reporters.JUnitTestCase) string
Focus returns a value to be used in the E2E_FOCUS variable that is representative of the test cases in the struct.
Types ¶
type DeleteConfig ¶
DeleteConfig are the input options for cleaning up a Sonobuoy run.
func NewDeleteConfig ¶
func NewDeleteConfig() *DeleteConfig
NewDeleteConfig is a DeleteConfig using default images, RBAC enabled, and DeleteAll enabled.
type GenConfig ¶
type GenConfig struct { E2EConfig *E2EConfig Config *config.Config Image string Namespace string EnableRBAC bool ImagePullPolicy string }
GenConfig are the input options for generating a Sonobuoy manifest.
func NewGenConfig ¶
func NewGenConfig() *GenConfig
NewGenConfig is a GenConfig using the default config and Conformance mode
type Interface ¶
type Interface interface { // Run generates the manifest, then tries to apply it to the cluster. // returns created resources or an error Run(cfg *RunConfig) error // GenerateManifest fills in a template with a Sonobuoy config GenerateManifest(cfg *GenConfig) ([]byte, error) // RetrieveResults copies results from a sonobuoy run into a Reader in tar format. RetrieveResults(cfg *RetrieveConfig) (io.Reader, error) // GetStatus determines the status of the sonobuoy run in order to assist the user. GetStatus(namespace string) (*aggregation.Status, error) // LogReader returns a reader that contains a merged stream of sonobuoy logs. LogReader(cfg *LogConfig) (*Reader, error) // Delete removes a sonobuoy run, namespace, and all associated resources. Delete(cfg *DeleteConfig) error // PreflightChecks runs a number of preflight checks to confirm the environment is good for Sonobuoy PreflightChecks(cfg *PreflightConfig) []error }
Interface is the main contract that we will give to external consumers of this library This will provide a consistent look/feel to upstream and allow us to expose sonobuoy behavior to other automation systems.
type LogConfig ¶
type LogConfig struct { // Follow determines if the logs should be followed or not (tail -f). Follow bool // Namespace is the namespace the sonobuoy aggregator is running in. Namespace string // Out is the writer to write to. Out io.Writer }
LogConfig are the options passed to GetLogs.
func NewLogConfig ¶
func NewLogConfig() *LogConfig
NewLogConfig is a LogConfig with follow disabled and default images.
type Mode ¶
type Mode string
Mode identifies a specific mode of running Sonobuoy. A mode is a defined configuration of plugins and E2E Focus and Config. Modes form the base level defaults, which can then be overriden by the e2e flags and the config flag.
const ( // Quick runs a single E2E test and the systemd log tests. Quick Mode = "Quick" // Conformance runs all of the E2E tests and the systemd log tests. Conformance Mode = "Conformance" // Extended run all of the E2E tests, the systemd log tests, and // Heptio's E2E Tests. Extended Mode = "Extended" )
func (*Mode) Get ¶
func (m *Mode) Get() *ModeConfig
Get returns the ModeConfig associated with a mode name, or nil if there's no associated mode
type ModeConfig ¶
type ModeConfig struct { // E2EConfig is the focus and skip vars for the conformance tests. E2EConfig E2EConfig // Selectors are the plugins selected by this mode. Selectors []plugin.Selection }
ModeConfig represents the sonobuoy configuration for a given mode.
type PreflightConfig ¶
type PreflightConfig struct {
Namespace string
}
PreflightConfig are the options passed to PreflightChecks.
type PrintableTestCases ¶
type PrintableTestCases []reporters.JUnitTestCase
PrintableTestCases nicely strings a []reporters.JunitTestCase
func (PrintableTestCases) String ¶
func (p PrintableTestCases) String() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader provides an io.Reader interface to a channel of bytes. The first error received on the error channel will be returned by Read and all subsequent calls to Read.
type RetrieveConfig ¶
type RetrieveConfig struct { // Namespace is the namespace the sonobuoy aggregator is running in. Namespace string }
RetrieveConfig are the options passed to RetrieveResults.
type RunConfig ¶
type RunConfig struct {
GenConfig
}
RunConfig are the input options for running Sonobuoy.
func NewRunConfig ¶
func NewRunConfig() *RunConfig
NewRunConfig is a RunConfig with DefaultGenConfig and and preflight checks enabled.
type SonobuoyClient ¶
SonobuoyClient is a high-level interface to Sonobuoy operations.
func NewSonobuoyClient ¶
func NewSonobuoyClient(restConfig *rest.Config) (*SonobuoyClient, error)
NewSonobuoyClient creates a new SonobuoyClient
func (*SonobuoyClient) Client ¶
func (s *SonobuoyClient) Client() (kubernetes.Interface, error)
Client creates or retrieves an existing kubernetes client from the SonobuoyClient's RESTConfig.
func (*SonobuoyClient) Delete ¶
func (c *SonobuoyClient) Delete(cfg *DeleteConfig) error
func (*SonobuoyClient) DynamicClientPool ¶
func (s *SonobuoyClient) DynamicClientPool() dynamic.ClientPool
DynamicClientPool creates or retrieves an existing dynamic client from the SonobuoyClient's RESTConfig.
func (*SonobuoyClient) GenerateManifest ¶
func (c *SonobuoyClient) GenerateManifest(cfg *GenConfig) ([]byte, error)
GenerateManifest fills in a template with a Sonobuoy config
func (*SonobuoyClient) GetStatus ¶
func (c *SonobuoyClient) GetStatus(namespace string) (*aggregation.Status, error)
func (*SonobuoyClient) GetTests ¶
func (c *SonobuoyClient) GetTests(reader io.Reader, show string) ([]reporters.JUnitTestCase, error)
GetTests extracts the junit results from a sonobuoy archive and returns the requested tests.
func (*SonobuoyClient) LogReader ¶
func (s *SonobuoyClient) LogReader(cfg *LogConfig) (*Reader, error)
LogReader configures a Reader that provides an io.Reader interface to a merged stream of logs from various containers.
func (*SonobuoyClient) PreflightChecks ¶
func (c *SonobuoyClient) PreflightChecks(cfg *PreflightConfig) []error
PreflightChecks runs all preflight checks in order, returning the first error encountered.
func (*SonobuoyClient) RetrieveResults ¶
func (c *SonobuoyClient) RetrieveResults(cfg *RetrieveConfig) (io.Reader, error)
func (*SonobuoyClient) Run ¶
func (c *SonobuoyClient) Run(cfg *RunConfig) error