Documentation ¶
Index ¶
- Constants
- func FilterNamespaces(kubeClient kubernetes.Interface, filter string) ([]string, error)
- func QueryClusterResources(kubeClient kubernetes.Interface, recorder *QueryRecorder, cfg *config.Config) error
- func QueryNSResources(kubeClient kubernetes.Interface, recorder *QueryRecorder, ns string, ...) error
- func Run(kubeClient kubernetes.Interface, cfg *config.Config) (errCount int)
- func SerializeArrayObj(objs []interface{}, outpath string, file string) error
- func SerializeObj(obj interface{}, outpath string, file string) error
- func SerializeObjAppend(f *os.File, obj interface{}) error
- type ObjQuery
- type QueryData
- type QueryRecorder
- type UntypedListQuery
- type UntypedQuery
Constants ¶
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" )
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 ¶
SerializeArrayObj will write out an array of object
func SerializeObj ¶
SerializeObj will write out an object
func SerializeObjAppend ¶
SerializeObjAppend will serialize an object and append to the end of file
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 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