Documentation ¶
Index ¶
- Constants
- func Install(p providers.Providers, cli client.Client, cfg *rest.Config)
- type AppCollector
- func (c *AppCollector) CollectResourceFromApp() ([]Resource, error)
- func (c *AppCollector) FindResourceFromAppliedResourcesField(app *v1beta1.Application) ([]Resource, error)
- func (c *AppCollector) FindResourceFromResourceTrackerSpec(app *v1beta1.Application) ([]Resource, error)
- func (c *AppCollector) ListApplicationResources(app *v1beta1.Application) ([]types.AppliedResource, error)
- type FilterOption
- type HelmReleaseCollector
- func (c *HelmReleaseCollector) CollectIngress(ctx context.Context, cluster string) ([]networkv1beta1.Ingress, error)
- func (c *HelmReleaseCollector) CollectServices(ctx context.Context, cluster string) ([]corev1.Service, error)
- func (c *HelmReleaseCollector) CollectWorkloads(cluster string) ([]unstructured.Unstructured, error)
- type Option
- type PodCollector
- type Resource
Constants ¶
const ( // ProviderName is provider name for install. ProviderName = "query" // HelmReleaseKind is the kind of HelmRelease HelmReleaseKind = "HelmRelease" )
Variables ¶
This section is empty.
Functions ¶
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) ([]networkv1beta1.Ingress, 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