Documentation ¶
Index ¶
- Constants
- Variables
- func ExecGraphQLQuery(c client.Client, query string, vars map[string]interface{}) ([]unstructured.Unstructured, error)
- func ExecQuery(kc client.Client, src apiv1.OID, target v1alpha1.ResourceLocator) (*apiv1.ResourceID, []unstructured.Unstructured, error)
- func ExecRawQuery(kc client.Client, src apiv1.OID, target v1alpha1.ResourceLocator) (*apiv1.ResourceID, []apiv1.ObjectReference, error)
- func Extract(u *unstructured.Unstructured, fieldPath string, v interface{}) (bool, error)
- func ExtractName(name, selector string) (string, bool)
- func ExtractSelector(u *unstructured.Unstructured, fieldPath string) (labels.Selector, error)
- func IsOwnedBy(obj metav1.Object, owner metav1.Object) bool
- func Namespaces(ref *unstructured.Unstructured, nsSelector string) ([]string, error)
- func PollNewResourceTypes(cfg *restclient.Config) func(ctx context.Context) error
- func RenderLayout(kc client.Client, src apiv1.ObjectInfo, layoutName string, pageName string, ...) (*v1alpha1.ResourceView, error)
- func RenderPageBlock(kc client.Client, src apiv1.ObjectInfo, block *v1alpha1.PageBlockLayout, ...) (*v1alpha1.PageBlockView, error)
- func ResourceGraph(mapper meta.RESTMapper, src apiv1.ObjectID) (*v1alpha1.ResourceGraphResponse, error)
- func SetupGraphReconciler(mgr manager.Manager) func(ctx context.Context) error
- type AdjacencyMap
- type Edge
- type NamespaceSelector
- type ObjectFinder
- func (finder ObjectFinder) Get(ref *v1alpha1.ObjectRef) (*unstructured.Unstructured, error)
- func (finder ObjectFinder) List(src *unstructured.Unstructured, path []*Edge) ([]*unstructured.Unstructured, error)
- func (finder ObjectFinder) ListConnectedObjectIDs(src *unstructured.Unstructured, connections []v1alpha1.ResourceConnection) (map[apiv1.EdgeLabel]ksets.OID, error)
- func (finder ObjectFinder) ListConnectedPartials(src *unstructured.Unstructured, edges AdjacencyMap) (map[schema.GroupVersionKind][]*metav1.PartialObjectMetadata, error)
- func (finder ObjectFinder) ListConnectedResources(src *unstructured.Unstructured, edges AdjacencyMap) (map[schema.GroupVersionKind][]*unstructured.Unstructured, error)
- func (finder ObjectFinder) Locate(locator *v1alpha1.ObjectLocator, edgeList []v1alpha1.NamedEdge) (*unstructured.Unstructured, error)
- func (finder ObjectFinder) ResourcesFor(src *unstructured.Unstructured, e *Edge) ([]*unstructured.Unstructured, error)
- type ObjectGraph
- type Reconciler
- type ResourceRef
Constants ¶
View Source
const ( // CostFactorOfInAppFiltering = 4 means, we assume that the cost of listing all resources and // filtering them in the app (instead of using kube-apiserver) is 5x of that via label based selection CostFactorOfInAppFiltering = 4 MetadataNamespace = "metadata.namespace" MetadataNamespaceQuery = "{." + MetadataNamespace + "}" MetadataLabels = "metadata.labels" MetadataNameQuery = "{.metadata.name}" )
Variables ¶
View Source
var Registry = hub.NewRegistryOfKnownResources()
View Source
var Schema = getGraphQLSchema()
Functions ¶
func ExecGraphQLQuery ¶
func ExecGraphQLQuery(c client.Client, query string, vars map[string]interface{}) ([]unstructured.Unstructured, error)
func ExecQuery ¶
func ExecQuery(kc client.Client, src apiv1.OID, target v1alpha1.ResourceLocator) (*apiv1.ResourceID, []unstructured.Unstructured, error)
func ExecRawQuery ¶
func ExecRawQuery(kc client.Client, src apiv1.OID, target v1alpha1.ResourceLocator) (*apiv1.ResourceID, []apiv1.ObjectReference, error)
func Extract ¶
func Extract(u *unstructured.Unstructured, fieldPath string, v interface{}) (bool, error)
func ExtractName ¶
func ExtractSelector ¶
func ExtractSelector(u *unstructured.Unstructured, fieldPath string) (labels.Selector, error)
func Namespaces ¶
func Namespaces(ref *unstructured.Unstructured, nsSelector string) ([]string, error)
len([]string) == 0 && err == nil => all namespaces
func PollNewResourceTypes ¶
func PollNewResourceTypes(cfg *restclient.Config) func(ctx context.Context) error
func RenderLayout ¶
func RenderPageBlock ¶
func RenderPageBlock(kc client.Client, src apiv1.ObjectInfo, block *v1alpha1.PageBlockLayout, convertToTable bool) (*v1alpha1.PageBlockView, error)
func ResourceGraph ¶
func ResourceGraph(mapper meta.RESTMapper, src apiv1.ObjectID) (*v1alpha1.ResourceGraphResponse, error)
Types ¶
type AdjacencyMap ¶
type AdjacencyMap map[schema.GroupVersionKind]*Edge
type Edge ¶
type Edge struct { Src schema.GroupVersionKind Dst schema.GroupVersionKind W uint64 Connection v1alpha1.ResourceConnectionSpec Forward bool }
type NamespaceSelector ¶
type NamespaceSelector struct { // Boolean describing whether all namespaces are selected in contrast to a // list restricting them. Any bool `json:"any,omitempty"` // List of namespace names. MatchNames []string `json:"matchNames,omitempty"` }
ref: https://github.com/coreos/prometheus-operator/blob/cc584ecfa08d2eb95ba9401f116e3a20bf71be8b/pkg/apis/monitoring/v1/types.go#L578 NamespaceSelector is a selector for selecting either all namespaces or a list of namespaces. +k8s:openapi-gen=true
type ObjectFinder ¶
func (ObjectFinder) Get ¶
func (finder ObjectFinder) Get(ref *v1alpha1.ObjectRef) (*unstructured.Unstructured, error)
func (ObjectFinder) List ¶
func (finder ObjectFinder) List(src *unstructured.Unstructured, path []*Edge) ([]*unstructured.Unstructured, error)
func (ObjectFinder) ListConnectedObjectIDs ¶
func (finder ObjectFinder) ListConnectedObjectIDs(src *unstructured.Unstructured, connections []v1alpha1.ResourceConnection) (map[apiv1.EdgeLabel]ksets.OID, error)
func (ObjectFinder) ListConnectedPartials ¶
func (finder ObjectFinder) ListConnectedPartials(src *unstructured.Unstructured, edges AdjacencyMap) (map[schema.GroupVersionKind][]*metav1.PartialObjectMetadata, error)
func (ObjectFinder) ListConnectedResources ¶
func (finder ObjectFinder) ListConnectedResources(src *unstructured.Unstructured, edges AdjacencyMap) (map[schema.GroupVersionKind][]*unstructured.Unstructured, error)
func (ObjectFinder) Locate ¶
func (finder ObjectFinder) Locate(locator *v1alpha1.ObjectLocator, edgeList []v1alpha1.NamedEdge) (*unstructured.Unstructured, error)
func (ObjectFinder) ResourcesFor ¶
func (finder ObjectFinder) ResourcesFor(src *unstructured.Unstructured, e *Edge) ([]*unstructured.Unstructured, error)
type ObjectGraph ¶
type ObjectGraph struct {
// contains filtered or unexported fields
}
type Reconciler ¶
Reconciler reconciles a Release object
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr manager.Manager) error
SetupWithManager sets up the controller with the Manager.
type ResourceRef ¶
type ResourceRef struct { // Name is the name of resource being referenced Name string `json:"name"` // Namespace is the namespace of resource being referenced Namespace string `json:"namespace,omitempty"` // Kind is the type of resource being referenced Kind string `json:"kind,omitempty"` // APIGroup is the group for the resource being referenced APIGroup string `json:"apiGroup,omitempty"` }
ResourceRef contains information that points to the resource being used
func ParseResourceRefs ¶
func ParseResourceRefs(records [][]string) ([]ResourceRef, error)
Click to show internal directories.
Click to hide internal directories.