discovery

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 24 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 QueryClusterResources

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

QueryClusterResources queries non-namespace resources in the cluster, writing them out to <resultsdir>/resources/non-ns/*.json TODO: Eliminate dependencies from config.Config and pass in data

func QueryNSResources

func QueryNSResources(kubeClient kubernetes.Interface, recorder *QueryRecorder, ns string, cfg *config.Config) error

QueryNSResources will query namespace-specific resources in the cluster, writing them out to <resultsdir>/resources/ns/<ns>/*.json TODO: Eliminate dependencies from config.Config and pass in data

func Run

func Run(kubeClient kubernetes.Interface, cfg *config.Config) (errCount int)

Run is the main entrypoint for discovery

func SerializeArrayObj

func SerializeArrayObj(objs []interface{}, outpath string, file string) error

SerializeArrayObj will write out an array of object

func SerializeObj

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

SerializeObj will write out an object

func SerializeObjAppend

func SerializeObjAppend(f *os.File, obj interface{}) error

SerializeObjAppend will serialize an object and append to the end of file

Types

type ObjQuery

type ObjQuery func() (runtime.Object, error)

ObjQuery is a query function that returns a kubernetes object

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 UntypedListQuery

type UntypedListQuery func() ([]interface{}, error)

UntypedListQuery is a query function that return an untyped array of objs

type UntypedQuery

type UntypedQuery func() (interface{}, error)

UntypedQuery is a query function that return an untyped array of objs

Jump to

Keyboard shortcuts

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