query

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName is provider name for install.
	ProviderName = "query"
	// HelmReleaseKind is the kind of HelmRelease
	HelmReleaseKind = "HelmRelease"
)

Variables

This section is empty.

Functions

func Install

func Install(p providers.Providers, cli client.Client, cfg *rest.Config)

Install register handlers to provider discover.

Types

type AppCollector

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

AppCollector collect resource created by application

func NewAppCollector

func NewAppCollector(cli client.Client, opt Option) *AppCollector

NewAppCollector create a app collector

func (*AppCollector) CollectResourceFromApp

func (c *AppCollector) CollectResourceFromApp() ([]Resource, error)

CollectResourceFromApp collect resources created by application

func (*AppCollector) FindResourceFromAppliedResourcesField

func (c *AppCollector) FindResourceFromAppliedResourcesField(app *v1beta1.Application) ([]Resource, error)

FindResourceFromAppliedResourcesField find resources from AppliedResources field

func (*AppCollector) FindResourceFromResourceTrackerSpec

func (c *AppCollector) FindResourceFromResourceTrackerSpec(app *v1beta1.Application) ([]Resource, error)

FindResourceFromResourceTrackerSpec find resources from ResourceTracker spec

func (*AppCollector) ListApplicationResources added in v1.3.0

func (c *AppCollector) ListApplicationResources(app *v1beta1.Application) ([]types.AppliedResource, error)

ListApplicationResources list application applied resources from tracker

type FilterOption

type FilterOption struct {
	Cluster          string   `json:"cluster,omitempty"`
	ClusterNamespace string   `json:"clusterNamespace,omitempty"`
	Components       []string `json:"components,omitempty"`
}

FilterOption filter resource created by component

type HelmReleaseCollector

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

HelmReleaseCollector HelmRelease resources collector

func NewHelmReleaseCollector

func NewHelmReleaseCollector(cli client.Client, hr *unstructured.Unstructured) *HelmReleaseCollector

NewHelmReleaseCollector create a HelmRelease collector

func (*HelmReleaseCollector) CollectIngress

func (c *HelmReleaseCollector) CollectIngress(ctx context.Context, cluster string) ([]unstructured.Unstructured, error)

CollectIngress collect ingress of HelmRelease

func (*HelmReleaseCollector) CollectServices

func (c *HelmReleaseCollector) CollectServices(ctx context.Context, cluster string) ([]corev1.Service, error)

CollectServices collect service of HelmRelease

func (*HelmReleaseCollector) CollectWorkloads

func (c *HelmReleaseCollector) CollectWorkloads(cluster string) ([]unstructured.Unstructured, error)

CollectWorkloads collect workloads of HelmRelease

type Option

type Option struct {
	Name      string       `json:"name"`
	Namespace string       `json:"namespace"`
	Filter    FilterOption `json:"filter,omitempty"`
}

Option is the query option

type PodCollector

type PodCollector func(cli client.Client, obj *unstructured.Unstructured, cluster string) ([]*unstructured.Unstructured, error)

PodCollector collector pod created by workload

func NewPodCollector

func NewPodCollector(gvk schema.GroupVersionKind) PodCollector

NewPodCollector create a PodCollector

type Resource

type Resource struct {
	Cluster   string                     `json:"cluster"`
	Component string                     `json:"component"`
	Revision  string                     `json:"revision"`
	Object    *unstructured.Unstructured `json:"object"`
}

Resource refer to an object with cluster info

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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