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 ChildrenResourcesRule
- type FilterOption
- type GroupResourceType
- type HelmReleaseCollector
- func (c *HelmReleaseCollector) CollectIngress(ctx context.Context, cluster string) ([]unstructured.Unstructured, 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
- type ResourceType
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 ChildrenResourcesRule ¶ added in v1.4.0
type ChildrenResourcesRule struct {
// every subResourceType can have a specified genListOptionFunc.
CareResource map[ResourceType]genListOptionFunc
// if specified genListOptionFunc is nil will use use default genListOptionFunc to generate listOption.
DefaultGenListOptionFunc genListOptionFunc
}
ChildrenResourcesRule define the relationShip between parentObject and children resource
type FilterOption ¶
type FilterOption struct {
Cluster string `json:"cluster,omitempty"`
ClusterNamespace string `json:"clusterNamespace,omitempty"`
Components []string `json:"components,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
}
FilterOption filter resource created by component
type GroupResourceType ¶ added in v1.4.0
type GroupResourceType struct {
Group string `json:"group"`
Kind string `json:"kind"`
}
GroupResourceType define the parent resource type
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"`
// WithStatus means query the object from the cluster and get the latest status
// This field only suitable for ListResourcesInApp
WithStatus bool `json:"withStatus,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
type ResourceType ¶ added in v1.4.0
type ResourceType struct {
APIVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
}
ResourceType define the children resource type