config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterResources = []string{
	"CertificateSigningRequests",
	"ClusterRoleBindings",
	"ClusterRoles",
	"ComponentStatuses",
	"Nodes",
	"PersistentVolumes",
	"PodSecurityPolicies",
	"ServerVersion",
	"StorageClasses",
	"ThirdPartyResources",
}

ClusterResources is the list of API resources that are scoped to the entire cluster (ie. not to any particular namespace)

View Source
var NamespacedResources = []string{
	"ConfigMaps",

	"DaemonSets",
	"Deployments",
	"Endpoints",
	"Events",
	"HorizontalPodAutoscalers",
	"Ingresses",
	"Jobs",
	"LimitRanges",
	"PersistentVolumeClaims",
	"PodDisruptionBudgets",
	"PodLogs",
	"PodPresets",
	"PodTemplates",
	"Pods",
	"ReplicaSets",
	"ReplicationControllers",
	"ResourceQuotas",
	"RoleBindings",
	"Roles",
	"Secrets",
	"ServiceAccounts",
	"Services",
	"StatefulSets",
}

NamespacedResources is the list of API resources that are scoped to a kubernetes namespace.

Functions

func LoadClient

func LoadClient(cfg *Config) (kubernetes.Interface, error)

LoadClient creates a kube-clientset, using given sonobuoy configuration

Types

type Config

type Config struct {

	///////////////////////////////////////////////
	// Meta-Data collection options
	///////////////////////////////////////////////
	Description string `json:"Description" mapstructure:"Description"`
	UUID        string `json:"UUID" mapstructure:"UUID"`
	Version     string `json:"Version" mapstructure:"Version"`
	ResultsDir  string `json:"ResultsDir" mapstructure:"ResultsDir"`
	Kubeconfig  string `json:"Kubeconfig" mapstructure:"Kubeconfig"`

	///////////////////////////////////////////////
	// Data collection options
	///////////////////////////////////////////////
	Resources []string `json:"Resources" mapstructure:"Resources"`

	///////////////////////////////////////////////
	// Filtering options
	///////////////////////////////////////////////
	Filters FilterOptions `json:"Filters" mapstructure:"Filters"`

	///////////////////////////////////////////////
	// plugin configurations settings
	///////////////////////////////////////////////
	Aggregation      plugin.AggregationConfig `json:"Server" mapstructure:"Server"`
	PluginSelections []plugin.Selection       `json:"Plugins" mapstructure:"Plugins"`
	PluginSearchPath []string                 `json:"PluginSearchPath" mapstructure:"PluginSearchPath"`
	PluginNamespace  string                   `json:"PluginNamespace" mapstructure:"PluginNamespace"`
	LoadedPlugins    []plugin.Interface       // this is assigned when plugins are loaded.
}

Config is the input struct used to determine what data to collect.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig will load the current sonobuoy configuration using the filesystem and environment variables, and returns a config object

func NewWithDefaults

func NewWithDefaults() *Config

NewWithDefaults returns a newly-constructed Config object with default values.

func (*Config) FilterResources

func (cfg *Config) FilterResources(filter []string) map[string]bool

FilterResources is a utility function used to parse Resources

func (*Config) OutputDir

func (cfg *Config) OutputDir() string

OutputDir returns the directory under the ResultsDir containing the UUID for this run.

type FilterOptions

type FilterOptions struct {
	Namespaces    string `json:"Namespaces"`
	LabelSelector string `json:"LabelSelector"`
}

FilterOptions allow operators to select sets to include in a report

Jump to

Keyboard shortcuts

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