Documentation ¶
Index ¶
Constants ¶
const ( // DefaultNamespace is the namespace where the master and plugin workers will run (but not necessarily the pods created by the plugin workers). DefaultNamespace = "heptio-sonobuoy" // DefaultKubeConformanceImage is the URL of the docker image to run for the kube conformance tests DefaultKubeConformanceImage = "gcr.io/heptio-images/kube-conformance:latest" // MasterPodName is the name of the main pod that runs plugins and collects results. MasterPodName = "sonobuoy" // MasterContainerName is the name of the main container in the master pod. MasterContainerName = "kube-sonobuoy" // MasterResultsPath is the location in the main container of the master pod where results will be archived. MasterResultsPath = "/tmp/sonobuoy" )
Variables ¶
var ClusterResources = []string{
"CertificateSigningRequests",
"ClusterRoleBindings",
"ClusterRoles",
"ComponentStatuses",
"CustomResourceDefinitions",
"Nodes",
"PersistentVolumes",
"PodSecurityPolicies",
"ServerGroups",
"ServerVersion",
"StorageClasses",
"ThirdPartyResources",
}
ClusterResources is the list of API resources that are scoped to the entire cluster (ie. not to any particular namespace)
var DefaultImage = "gcr.io/heptio-images/sonobuoy:" + buildinfo.Version
DefaultImage is the URL of the docker image to run for the aggregator and workers
var NamespacedResources = []string{
"ConfigMaps",
"ControllerRevisions",
"CronJobs",
"DaemonSets",
"Deployments",
"Endpoints",
"Events",
"HorizontalPodAutoscalers",
"Ingresses",
"Jobs",
"LimitRanges",
"NetworkPolicies",
"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 ¶
This section is empty.
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"` /////////////////////////////////////////////// // Data collection options /////////////////////////////////////////////// Resources []string `json:"Resources" mapstructure:"Resources"` /////////////////////////////////////////////// // Filtering options /////////////////////////////////////////////// Filters FilterOptions `json:"Filters" mapstructure:"Filters"` /////////////////////////////////////////////// // Limit options /////////////////////////////////////////////// Limits LimitConfig `json:"Limits" mapstructure:"Limits"` /////////////////////////////////////////////// // plugin configurations settings /////////////////////////////////////////////// Aggregation plugin.AggregationConfig `json:"Server" mapstructure:"Server"` PluginSelections []plugin.Selection `json:"Plugins" mapstructure:"Plugins"` PluginSearchPath []string `json:"PluginSearchPath" mapstructure:"PluginSearchPath"` Namespace string `json:"Namespace" mapstructure:"Namespace"` LoadedPlugins []plugin.Interface // this is assigned when plugins are loaded. /////////////////////////////////////////////// // sonobuoy configuration /////////////////////////////////////////////// WorkerImage string `json:"WorkerImage" mapstructure:"WorkerImage"` ImagePullPolicy string `json:"ImagePullPolicy" mapstructure:"ImagePullPolicy"` }
Config is the input struct used to determine what data to collect.
func LoadConfig ¶
LoadConfig will load the current sonobuoy configuration using the filesystem and environment variables, and returns a config object
func New ¶ added in v0.11.0
func New() *Config
New returns a newly-constructed Config object with default values.
func (*Config) FilterResources ¶
FilterResources is a utility function used to parse Resources
type FilterOptions ¶
type FilterOptions struct { Namespaces string `json:"Namespaces"` LabelSelector string `json:"LabelSelector"` }
FilterOptions allow operators to select sets to include in a report
type LimitConfig ¶ added in v0.9.0
type LimitConfig struct {
PodLogs SizeOrTimeLimitConfig `json:"PodLogs" mapstructure:"PodLogs"`
}
LimitConfig is a configuration on the limits of sizes of various responses.
type SizeOrTimeLimitConfig ¶ added in v0.9.0
type SizeOrTimeLimitConfig struct { LimitSize string `json:"LimitSize" mapstructure:"LimitSize"` LimitTime string `json:"LimitTime" mapstructure:"LimitTime"` }
SizeOrTimeLimitConfig represents configuration that limits the size of something either by a total disk size, or by a length of time.
func (SizeOrTimeLimitConfig) SizeLimitBytes ¶ added in v0.9.0
func (c SizeOrTimeLimitConfig) SizeLimitBytes(defaultVal int64) int64
SizeLimitBytes returns how many bytes the configuration is set to limit, returning defaultVal if not set.
func (SizeOrTimeLimitConfig) TimeLimitDuration ¶ added in v0.9.0
func (c SizeOrTimeLimitConfig) TimeLimitDuration(defaultVal time.Duration) time.Duration
TimeLimitDuration returns the duration the configuration is set to limit, returning defaultVal if not set.