discovery

package
v0.54.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NSResourceLocation is the place under which namespaced API resources (pods, etc) are stored
	NSResourceLocation = "resources/ns"
	// ClusterResourceLocation is the place under which non-namespaced API resources (nodes, etc) are stored
	ClusterResourceLocation = "resources/cluster"
	// HostsLocation is the place under which host information (configz, healthz) is stored
	HostsLocation = "hosts"
	// MetaLocation is the place under which snapshot metadata (query times, config) is stored
	MetaLocation = "meta"
)
View Source
const (
	// PodLogsLocation is the location within the results tarball where pod
	// information is stored.
	PodLogsLocation = "podlogs"
)

Variables

This section is empty.

Functions

func FilterNamespaces

func FilterNamespaces(kubeClient kubernetes.Interface, filter string) ([]string, error)

FilterNamespaces filter the list of namespaces according to the filter string

func QueryHostData added in v0.14.2

func QueryHostData(kubeClient kubernetes.Interface, recorder *QueryRecorder, cfg *config.Config) error

QueryHostData gets the host data and records it.

func QueryPodLogs added in v0.14.2

func QueryPodLogs(kubeClient kubernetes.Interface, recorder *QueryRecorder, ns string, cfg *config.Config,
	visitedPods map[string]struct{}) error

QueryPodLogs gets the pod logs for each pod in the given namespace. If namespace is not provided, get pod logs using field selectors. VisitedPods will eliminate duplicate pods when execute overlapping queries, e.g. query by namespaces and query by fieldSelectors.

func QueryResources added in v0.14.2

func QueryResources(
	client *dynamic.APIHelper,
	recorder *QueryRecorder,
	resources []schema.GroupVersionResource,
	ns *string,
	cfg *config.Config) error

QueryResources will query all the intended resources. If given a non-nil namespace it queries only namespaced objects; non-namespaced otherwise. Writing them out to <resultsdir>/resources/ns/<ns>/*.json or <resultsdir>/resources/cluster/*.json.

func QueryServerData added in v0.14.2

func QueryServerData(kubeClient kubernetes.Interface, recorder *QueryRecorder, cfg *config.Config) error

QueryServerData gets the server version and server group data and records it.

func Run

func Run(restConf *rest.Config, cfg *config.Config) (errCount int)

Run is the main entrypoint for discovery.

func SerializeObj

func SerializeObj(obj interface{}, outpath string, file string) error

SerializeObj will write out an object

Types

type QueryData added in v0.11.0

type QueryData struct {
	QueryObj    string `json:"queryobj,omitempty"`
	Namespace   string `json:"namespace,omitempty"`
	ElapsedTime string `json:"time,omitempty"`
	Error       error  `json:"error,omitempty"`
}

QueryData captures the results of the run for post-processing

type QueryRecorder added in v0.9.0

type QueryRecorder struct {
	// contains filtered or unexported fields
}

QueryRecorder records a sequence of queries

func NewQueryRecorder added in v0.9.0

func NewQueryRecorder() *QueryRecorder

NewQueryRecorder returns a new empty QueryRecorder

func (*QueryRecorder) DumpQueryData added in v0.9.0

func (q *QueryRecorder) DumpQueryData(filepath string) error

DumpQueryData writes query information out to a file at the give filepath

func (*QueryRecorder) RecordQuery added in v0.9.0

func (q *QueryRecorder) RecordQuery(name string, namespace string, duration time.Duration, recerr error)

RecordQuery transcribes a query by name, namespace, duration and error

type RunInfo added in v0.16.1

type RunInfo struct {
	LoadedPlugins []string `json:"plugins,omitempty"`
}

Jump to

Keyboard shortcuts

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