Documentation ¶
Index ¶
- Constants
- Variables
- func ExecGraphQLQuery(c client.Client, query string, vars map[string]interface{}) ([]unstructured.Unstructured, error)
- func ExecQuery(ctx context.Context, kc client.Client, src kmapi.OID, ...) (*kmapi.ResourceID, []unstructured.Unstructured, error)
- func ExecRawQuery(ctx context.Context, kc client.Client, src kmapi.OID, ...) (*kmapi.ResourceID, []kmapi.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 IsDiscoveryError(err error) bool
- func IsOwnedBy(obj metav1.Object, owner metav1.Object) bool
- func LocatePods(ctx context.Context, kc client.Client, req *kmapi.ObjectInfo) ([]unstructured.Unstructured, error)
- func Namespaces(kc client.Client, ref *unstructured.Unstructured, ns *rsapi.NamespaceRef) ([]string, error)
- func NewClient(ctx context.Context, kc client.Client, impersonate bool) (client.Client, error)
- func NewUserContext(in context.Context) context.Context
- func PollNewResourceTypes(cfg *restclient.Config, pqr *projectquotacontroller.ProjectQuotaReconciler) func(ctx context.Context) error
- func Render(src kmapi.OID) (*runtime.RawExtension, error)
- func RenderDashboard(ctx context.Context, kc client.Client, rd *uiapi.ResourceDashboard, ...) (*openvizauipi.DashboardGroup, error)
- func RenderExec(src, target *schema.GroupVersionResource) tableconvertor.ResourceExecFunc
- func RenderLayout(ctx context.Context, kc client.Client, src kmapi.ObjectInfo, layoutName string, ...) (*rsapi.ResourceView, error)
- func RenderPageBlock(ctx context.Context, kc client.Client, src kmapi.ObjectInfo, ...) (*rsapi.PageBlockView, error)
- func ResourceGraph(mapper meta.RESTMapper, src kmapi.ObjectID, ...) (*rsapi.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 *rsapi.ObjectRef) (*unstructured.Unstructured, error)
- func (finder ObjectFinder) List(src *unstructured.Unstructured, path []*Edge) ([]*unstructured.Unstructured, error)
- func (finder ObjectFinder) ListConnectedObjectIDs(src *unstructured.Unstructured, connections []rsapi.ResourceConnection) (map[kmapi.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 *rsapi.ObjectLocator, edgeList []rsapi.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 ( OPAInstalled atomic.Bool ScannerInstalled atomic.Bool )
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(ctx context.Context, kc client.Client, src kmapi.OID, target sharedapi.ResourceLocator) (*kmapi.ResourceID, []unstructured.Unstructured, error)
func ExecRawQuery ¶
func ExecRawQuery(ctx context.Context, kc client.Client, src kmapi.OID, target sharedapi.ResourceLocator) (*kmapi.ResourceID, []kmapi.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 IsDiscoveryError ¶ added in v0.0.46
func LocatePods ¶ added in v0.0.12
func LocatePods(ctx context.Context, kc client.Client, req *kmapi.ObjectInfo) ([]unstructured.Unstructured, error)
func Namespaces ¶
func Namespaces(kc client.Client, ref *unstructured.Unstructured, ns *rsapi.NamespaceRef) ([]string, error)
len([]string) == 0 && err == nil => all namespaces
func PollNewResourceTypes ¶
func PollNewResourceTypes(cfg *restclient.Config, pqr *projectquotacontroller.ProjectQuotaReconciler) func(ctx context.Context) error
func RenderDashboard ¶ added in v0.0.3
func RenderDashboard(ctx context.Context, kc client.Client, rd *uiapi.ResourceDashboard, src *unstructured.Unstructured, embeddedLink bool) (*openvizauipi.DashboardGroup, error)
func RenderExec ¶ added in v0.0.6
func RenderExec(src, target *schema.GroupVersionResource) tableconvertor.ResourceExecFunc
func RenderLayout ¶
func RenderPageBlock ¶
func RenderPageBlock(ctx context.Context, kc client.Client, src kmapi.ObjectInfo, block *rsapi.PageBlockLayout, convertToTable bool) (*rsapi.PageBlockView, error)
func ResourceGraph ¶
func ResourceGraph(mapper meta.RESTMapper, src kmapi.ObjectID, includeEdgesBesidesOffshoot []kmapi.EdgeLabel) (*rsapi.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 rsapi.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 *rsapi.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 []rsapi.ResourceConnection) (map[kmapi.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 *rsapi.ObjectLocator, edgeList []rsapi.NamedEdge) (*unstructured.Unstructured, error)
func (ObjectFinder) ResourcesFor ¶
func (finder ObjectFinder) ResourcesFor(src *unstructured.Unstructured, e *Edge) ([]*unstructured.Unstructured, error)
type ObjectGraph ¶
type ObjectGraph struct { // bool == true , self link Edges map[kmapi.OID]map[kmapi.EdgeLabel]map[kmapi.OID]bool `json:"edges,omitempty"` // oid -> label -> Edges IDs map[kmapi.OID]map[kmapi.EdgeLabel]ksets.OID `json:"ids,omitempty"` // oid -> label -> Edges // contains filtered or unexported fields }
func (*ObjectGraph) Delete ¶ added in v0.0.46
func (g *ObjectGraph) Delete(src kmapi.OID)
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.