client

package
v0.11.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2018 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModes

func GetModes() []string

GetModes gets a list of all available modes.

func UntarAll

func UntarAll(reader io.Reader, destFile, prefix string) error

UntarAll expects a reader that contains tar'd data. It will untar the contents of the reader and write the output into destFile under the prefix, prefix.

Types

type DeleteConfig

type DeleteConfig struct {
	Namespace  string
	EnableRBAC bool
	DeleteAll  bool
}

DeleteConfig are the input options for cleaning up a Sonobuoy run.

type E2EConfig

type E2EConfig struct {
	Focus string
	Skip  string
}

E2EConfig is the configuration of the E2E test.

type GenConfig

type GenConfig struct {
	E2EConfig  *E2EConfig
	Config     *config.Config
	Image      string
	Namespace  string
	EnableRBAC bool
}

GenConfig are the input options for generating a Sonobuoy manifest.

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, restConfig *rest.Config) 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, restConfig *rest.Config) io.Reader
	// GetStatus determines the status of the sonobuoy run in order to assist the user.
	GetStatus(namespace string, client kubernetes.Interface) (*aggregation.Status, error)
	// GetLogs streams logs from the sonobuoy pod by default to stdout.
	GetLogs(cfg *LogConfig, client kubernetes.Interface) error
	// Delete removes a sonobuoy run, namespace, and all associated resources.
	Delete(cfg *DeleteConfig, client kubernetes.Interface) 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
}

LogConfig are the options passed to GetLogs.

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 (n *Mode) Get() *ModeConfig

Get returns the ModeConfig associated with a mode name, or nil if there's no associated mode

func (*Mode) Set

func (n *Mode) Set(str string) error

Set the name with a given string. Returns error on unknown mode

func (*Mode) String

func (n *Mode) String() string

String needed for pflag.Value

func (*Mode) Type

func (n *Mode) Type() string

Type needed for pflag.Value

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 RetrieveConfig

type RetrieveConfig struct {
	// CmdErr is the place to write errors to.
	CmdErr io.Writer
	// Errc reports errors from go routines that retrieve may spawn.
	Errc chan error
	// 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
	// SkipPreflight means don't run any checks before kicking off the Sonobuoy run.
	SkipPreflight bool
}

RunConfig are the input options for running Sonobuoy.

type SonobuoyClient

type SonobuoyClient struct{}

SonobuoyClient is a high-level interface to Sonobuoy operations.

func NewSonobuoyClient

func NewSonobuoyClient() *SonobuoyClient

NewSonobuoyClient creates a new SonobuoyClient

func (*SonobuoyClient) Delete

func (c *SonobuoyClient) Delete(cfg *DeleteConfig, client kubernetes.Interface) error

func (*SonobuoyClient) GenerateManifest

func (c *SonobuoyClient) GenerateManifest(cfg *GenConfig) ([]byte, error)

GenerateManifest fills in a template with a Sonobuoy config

func (*SonobuoyClient) GetLogs

func (c *SonobuoyClient) GetLogs(cfg *LogConfig, client kubernetes.Interface) error

func (*SonobuoyClient) GetStatus

func (c *SonobuoyClient) GetStatus(namespace string, client kubernetes.Interface) (*aggregation.Status, error)

func (*SonobuoyClient) RetrieveResults

func (c *SonobuoyClient) RetrieveResults(cfg *RetrieveConfig, restConfig *rest.Config) io.Reader

func (*SonobuoyClient) Run

func (c *SonobuoyClient) Run(cfg *RunConfig, restConfig *rest.Config) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL