Documentation
¶
Overview ¶
Package k8s provides datagatherers for different parts of the Kubernetes API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// KubeConfigPath is the path to the kubeconfig file. If empty, will assume it runs in-cluster.
KubeConfigPath string `yaml:"kubeconfig"`
// GroupVersionResource identifies the resource type to gather.
GroupVersionResource schema.GroupVersionResource
}
Config contains the configuration for the data-gatherer.
func (*Config) NewDataGatherer ¶
func (c *Config) NewDataGatherer(ctx context.Context) (datagatherer.DataGatherer, error)
NewDataGatherer constructs a new instance of the generic K8s data-gatherer for the provided GroupVersionResource.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML unmarshals the Config resolving GroupVersionResource.
type DataGatherer ¶
type DataGatherer struct {
// contains filtered or unexported fields
}
DataGatherer is a generic gatherer for Kubernetes. It knows how to request a list of generic resources from the Kubernetes apiserver. It does not deserialize the objects into structured data, instead utilising the Kubernetes `Unstructured` type for data handling. This is to allow us to support arbitrary CRDs and resources that Preflight does not have registered as part of its `runtime.Scheme`.
func (*DataGatherer) Fetch ¶
func (g *DataGatherer) Fetch() (interface{}, error)
Fetch will fetch the requested data from the apiserver, or return an error if fetching the data fails.