Documentation
¶
Overview ¶
Package crossplane contains interfaces and implementations for clients that talk to Kubernetes about Crossplane primitives, often by consuming clients from the kubernetes package.
Index ¶
- Constants
- func SchemaFromXRD(xrd *un.Unstructured) ucomposite.Schema
- func XRRevisionLabelSelector(xr *un.Unstructured) (labels.Selector, error)
- func XRRevisionSelectorMatch(xr *un.Unstructured, targetLabels, compLabels map[string]string) (matches bool, detail string, err error)
- func XRUpdatePolicy(obj map[string]any, apiVersion string) (string, error)
- type Clients
- type CompositionClient
- type CompositionRevisionClient
- type CredentialClient
- type DefaultCompositionClient
- func (c *DefaultCompositionClient) FindComposites(ctx context.Context, comp *un.Unstructured, opts dtypes.FindCompositesOptions) ([]*un.Unstructured, error)
- func (c *DefaultCompositionClient) FindMatchingComposition(ctx context.Context, res *un.Unstructured) (dtypes.ResolvedComposition, error)
- func (c *DefaultCompositionClient) GetComposition(ctx context.Context, name string) (*apiextensionsv1.Composition, error)
- func (c *DefaultCompositionClient) Initialize(ctx context.Context) error
- func (c *DefaultCompositionClient) ListCompositions(ctx context.Context) ([]*apiextensionsv1.Composition, error)
- type DefaultCompositionRevisionClient
- func (c *DefaultCompositionRevisionClient) GetCompositionFromRevision(revision *apiextensionsv1.CompositionRevision) *apiextensionsv1.Composition
- func (c *DefaultCompositionRevisionClient) GetCompositionRevision(ctx context.Context, name string) (*apiextensionsv1.CompositionRevision, error)
- func (c *DefaultCompositionRevisionClient) GetLatestRevisionForComposition(ctx context.Context, compositionName string, selector labels.Selector) (*apiextensionsv1.CompositionRevision, error)
- func (c *DefaultCompositionRevisionClient) Initialize(ctx context.Context) error
- func (c *DefaultCompositionRevisionClient) ListCompositionRevisions(ctx context.Context) ([]*apiextensionsv1.CompositionRevision, error)
- type DefaultCredentialClient
- type DefaultDefinitionClient
- func (c *DefaultDefinitionClient) GetCompositeSchema(ctx context.Context, gvk schema.GroupVersionKind) (ucomposite.Schema, error)
- func (c *DefaultDefinitionClient) GetXRDForClaim(ctx context.Context, gvk schema.GroupVersionKind) (*un.Unstructured, error)
- func (c *DefaultDefinitionClient) GetXRDForXR(ctx context.Context, gvk schema.GroupVersionKind) (*un.Unstructured, error)
- func (c *DefaultDefinitionClient) GetXRDs(ctx context.Context) ([]*un.Unstructured, error)
- func (c *DefaultDefinitionClient) Initialize(ctx context.Context) error
- func (c *DefaultDefinitionClient) IsClaimResource(ctx context.Context, resource *un.Unstructured) bool
- type DefaultEnvironmentClient
- type DefaultFunctionClient
- type DefaultResourceTreeClient
- type DefinitionClient
- type EnvironmentClient
- type FunctionClient
- type ResourceTreeClient
Constants ¶
const ( // CrossplaneAPIExtGroup is the Crossplane API extensions group. CrossplaneAPIExtGroup = "apiextensions.crossplane.io" // CrossplaneAPIExtGroupV1 is the v1 group/version for Crossplane API extensions. CrossplaneAPIExtGroupV1 = "apiextensions.crossplane.io/v1" // CrossplaneAPIExtGroupV2 is the v2 group/version for Crossplane API extensions. CrossplaneAPIExtGroupV2 = "apiextensions.crossplane.io/v2" // CrossplanePkgGroup is the Crossplane packages group. CrossplanePkgGroup = "pkg.crossplane.io" // CompositionKind is the kind for Compositions. CompositionKind = "Composition" // CompositionRevisionKind is the kind for CompositionRevisions. CompositionRevisionKind = "CompositionRevision" // FunctionKind is the kind for Crossplane Functions. FunctionKind = "Function" )
Crossplane API group and kind constants used across the client package.
const ( // LabelCompositionName is the label key for the composition name on CompositionRevisions. LabelCompositionName = apiextensionsv1.LabelCompositionName // LabelCompositionHash is the label key for the composition hash on CompositionRevisions. The // value is the composition hash truncated to 63 characters, Kubernetes' limit on a label value. LabelCompositionHash = apiextensionsv1.LabelCompositionHash )
Aliases rather than literals so these cannot drift from the values Crossplane's revision-creation controller actually stamps (NewCompositionRevision), which is the behaviour every use of them here is predicting or matching against.
const CompositeResourceDefinitionKind = "CompositeResourceDefinition"
CompositeResourceDefinitionKind is the kind for Composite Resource Definitions.
Variables ¶
This section is empty.
Functions ¶
func SchemaFromXRD ¶ added in v0.8.0
func SchemaFromXRD(xrd *un.Unstructured) ucomposite.Schema
SchemaFromXRD picks the composite.Schema (Legacy or Modern) for the given XRD by reading its spec.scope. Use this when you've already fetched the XRD for another reason (e.g. forwarding it to the render binary) and want to avoid the redundant cache lookup GetCompositeSchema would do.
The rule mirrors the render binary's own selectSchema (see crossplane/crossplane internal/render/composite/render.go): use spec.scope rather than the XRD's apiVersion. The apiserver round-trips XRDs through v1↔v2 conversion (a v1 XRD POSTed by the user can come back from a v2 list as kind v2), so apiVersion is unreliable. spec.scope is preserved verbatim: v1 XRDs default to "LegacyCluster" and stay there; v2 XRDs declare "Cluster" or "Namespaced" explicitly.
func XRRevisionLabelSelector ¶ added in v0.9.0
func XRRevisionLabelSelector(xr *un.Unstructured) (labels.Selector, error)
XRRevisionLabelSelector returns the effective label selector Crossplane would use to select a CompositionRevision for the given XR/Claim, as a labels.Selector ready to evaluate against a revision's (or composition's) labels.
Crossplane only consults compositionRevisionSelector under the Automatic update policy (see internal/controller/apiextensions/composite/api.go): under Manual policy the revision is pinned via compositionRevisionRef, so the selector does not restrict the match. Accordingly this returns labels.Everything() when the policy is non-Automatic, or when no compositionRevisionSelector is present. Otherwise it returns the parsed selector, honoring both matchLabels and matchExpressions.
Both the v2 path (spec.crossplane.compositionRevisionSelector) and the legacy v1 path (spec.compositionRevisionSelector) are read, v2 preferred.
func XRRevisionSelectorMatch ¶ added in v0.9.0
func XRRevisionSelectorMatch(xr *un.Unstructured, targetLabels, compLabels map[string]string) (matches bool, detail string, err error)
XRRevisionSelectorMatch reports whether the XR's compositionRevisionSelector matches the given set of labels (the labels of a Composition or CompositionRevision), and — on a mismatch — a human-readable detail explaining it, for surfacing in diff output so users can fine-tune their selector. The selector is parsed exactly once here, so any parse/read failure is returned as the single authoritative error (no best-effort duplicate parsing elsewhere).
See XRRevisionLabelSelector for the Automatic-only semantics; a non-Automatic policy or an absent selector always matches (and yields an empty detail).
The detail displays the composition's own labels (compLabels — the tunable menu a user can edit) plus any additional label the selector explicitly references (e.g. a Crossplane-stamped crossplane.io/composition-name the user chose to select on). Labels that are neither user-set nor selector-referenced (the implied composition-name/-hash in the common case) are omitted so the hint shows only load-bearing, actionable labels.
func XRUpdatePolicy ¶ added in v0.9.0
XRUpdatePolicy reads the compositionUpdatePolicy from an XR/Claim spec object, checking the v2 path (spec.crossplane.compositionUpdatePolicy) then the v1 path (spec.compositionUpdatePolicy), selected from apiVersion. Defaults to "Automatic" when unset, matching Crossplane's default behavior. A non-nil error means the field is present but malformed (not a string); callers that prioritize accuracy propagate it rather than silently defaulting.
This is the single shared reader for compositionUpdatePolicy across the codebase.
Types ¶
type Clients ¶
type Clients struct {
Composition CompositionClient
Credential CredentialClient
Definition DefinitionClient
Environment EnvironmentClient
Function FunctionClient
ResourceTree ResourceTreeClient
}
Clients is an aggregation of all of our Crossplane clients, used to pass them as a bundle, typically for initialization where the consumer can select which ones they need.
type CompositionClient ¶
type CompositionClient interface {
core.Initializable
// FindMatchingComposition finds the composition that matches the given XR or claim, and the
// CompositionRevision it comes from when one applies. See dtypes.ResolvedComposition.
FindMatchingComposition(ctx context.Context, res *un.Unstructured) (dtypes.ResolvedComposition, error)
// ListCompositions lists all compositions in the cluster
ListCompositions(ctx context.Context) ([]*apiextensionsv1.Composition, error)
// GetComposition gets a composition by name
GetComposition(ctx context.Context, name string) (*apiextensionsv1.Composition, error)
// FindComposites locates composites (XRs and Claims) that reference a composition.
// `comp` is taken as the user-supplied unstructured Composition (typically loaded from a YAML
// file); the client converts to a typed *apiextensionsv1.Composition internally only when
// needed (i.e. in refs-mode, which reads spec.compositeTypeRef). Default-discovery only needs
// comp.GetName() and avoids the conversion entirely so it isn't tripped by version skew or
// unknown fields in the input file.
//
// When opts.Refs is non-empty, it performs ref-based lookup: each ref is resolved against the
// composition's XR GVK (then claim GVK on 404 if the XRD defines a claim type). A ref is included
// in the result only when (a) the cluster lookup succeeds AND (b) the resource references this
// composition by name. Refs that don't satisfy both are silently omitted; callers derive
// "unmatched" from the diff between input refs and returned objects. NotFound on per-ref XR/Claim
// lookups is tolerated; non-NotFound transport errors propagate.
//
// When opts.Refs is empty, it performs default discovery scoped to opts.Namespace, listing all
// XRs (and Claims, if the XRD defines them) of the appropriate GVK and filtering by composition.
// XR/Claim list errors are tolerated (each list is best-effort and produces an empty bucket on
// failure). However, the composition itself must be in the cluster cache: when GetComposition
// returns NotFound (a net-new composition not yet applied), FindComposites returns that error to
// the caller. Callers handle that case by treating it as "no affected XRs" — see
// DiffComposition's default-discovery branch.
FindComposites(ctx context.Context, comp *un.Unstructured, opts dtypes.FindCompositesOptions) ([]*un.Unstructured, error)
}
CompositionClient handles operations related to Compositions.
func NewCompositionClient ¶
func NewCompositionClient(resourceClient kubernetes.ResourceClient, definitionClient DefinitionClient, logger logging.Logger) CompositionClient
NewCompositionClient creates a new DefaultCompositionClient.
type CompositionRevisionClient ¶ added in v0.3.0
type CompositionRevisionClient interface {
core.Initializable
// GetCompositionRevision gets a composition revision by name
GetCompositionRevision(ctx context.Context, name string) (*apiextensionsv1.CompositionRevision, error)
// ListCompositionRevisions lists all composition revisions in the cluster
ListCompositionRevisions(ctx context.Context) ([]*apiextensionsv1.CompositionRevision, error)
// GetLatestRevisionForComposition finds the latest (highest-numbered) revision for a given
// composition whose labels match the provided selector. This mirrors how Crossplane selects a
// revision for an XR with an Automatic compositionUpdatePolicy: with a compositionRevisionSelector
// it picks the newest matching revision, otherwise the newest overall. A nil selector means no
// restriction (latest overall).
GetLatestRevisionForComposition(ctx context.Context, compositionName string, selector labels.Selector) (*apiextensionsv1.CompositionRevision, error)
// GetCompositionFromRevision extracts a Composition from a CompositionRevision
GetCompositionFromRevision(revision *apiextensionsv1.CompositionRevision) *apiextensionsv1.Composition
}
CompositionRevisionClient handles operations related to CompositionRevisions.
func NewCompositionRevisionClient ¶ added in v0.3.0
func NewCompositionRevisionClient(resourceClient kubernetes.ResourceClient, logger logging.Logger) CompositionRevisionClient
NewCompositionRevisionClient creates a new DefaultCompositionRevisionClient.
type CredentialClient ¶ added in v0.6.0
type CredentialClient interface {
// FetchCompositionCredentials extracts credential refs from a composition's pipeline steps and
// fetches the referenced secrets from the cluster. Secrets that do not exist are reported in the
// result's Absent list rather than failing the fetch: they may be injected at runtime (e.g.
// workload identity) or supplied by the caller via --function-credentials. Any other failure to
// read a referenced secret is returned as an error.
FetchCompositionCredentials(ctx context.Context, comp *apiextensionsv1.Composition) (types.CredentialFetchResult, error)
}
CredentialClient handles fetching credentials referenced by composition pipelines.
func NewCredentialClient ¶ added in v0.6.0
func NewCredentialClient(resourceClient kubernetes.ResourceClient, logger logging.Logger) CredentialClient
NewCredentialClient creates a new DefaultCredentialClient.
type DefaultCompositionClient ¶
type DefaultCompositionClient struct {
// contains filtered or unexported fields
}
DefaultCompositionClient implements CompositionClient.
func (*DefaultCompositionClient) FindComposites ¶ added in v0.8.0
func (c *DefaultCompositionClient) FindComposites(ctx context.Context, comp *un.Unstructured, opts dtypes.FindCompositesOptions) ([]*un.Unstructured, error)
FindComposites dispatches to ref-based or listing-based discovery based on opts.Refs.
func (*DefaultCompositionClient) FindMatchingComposition ¶
func (c *DefaultCompositionClient) FindMatchingComposition(ctx context.Context, res *un.Unstructured) (dtypes.ResolvedComposition, error)
FindMatchingComposition finds a composition matching the given resource, and the revision it comes from. Only a resource naming its composition resolves a revision: one Crossplane has reconciled always does, because the composite reconciler writes compositionRef. One that selects its composition by label or by type resolves none, so its RevisionName is empty.
func (*DefaultCompositionClient) GetComposition ¶
func (c *DefaultCompositionClient) GetComposition(ctx context.Context, name string) (*apiextensionsv1.Composition, error)
GetComposition gets a composition by name.
func (*DefaultCompositionClient) Initialize ¶
func (c *DefaultCompositionClient) Initialize(ctx context.Context) error
Initialize loads compositions into the cache.
func (*DefaultCompositionClient) ListCompositions ¶
func (c *DefaultCompositionClient) ListCompositions(ctx context.Context) ([]*apiextensionsv1.Composition, error)
ListCompositions lists all compositions in the cluster.
type DefaultCompositionRevisionClient ¶ added in v0.3.0
type DefaultCompositionRevisionClient struct {
// contains filtered or unexported fields
}
DefaultCompositionRevisionClient implements CompositionRevisionClient.
func (*DefaultCompositionRevisionClient) GetCompositionFromRevision ¶ added in v0.3.0
func (c *DefaultCompositionRevisionClient) GetCompositionFromRevision(revision *apiextensionsv1.CompositionRevision) *apiextensionsv1.Composition
GetCompositionFromRevision extracts a Composition from a CompositionRevision. CompositionRevision contains the full Composition spec, so we construct a Composition object.
func (*DefaultCompositionRevisionClient) GetCompositionRevision ¶ added in v0.3.0
func (c *DefaultCompositionRevisionClient) GetCompositionRevision(ctx context.Context, name string) (*apiextensionsv1.CompositionRevision, error)
GetCompositionRevision gets a composition revision by name.
func (*DefaultCompositionRevisionClient) GetLatestRevisionForComposition ¶ added in v0.3.0
func (c *DefaultCompositionRevisionClient) GetLatestRevisionForComposition(ctx context.Context, compositionName string, selector labels.Selector) (*apiextensionsv1.CompositionRevision, error)
GetLatestRevisionForComposition finds the latest (highest-numbered) revision for a given composition whose labels match the provided selector. A nil selector means no restriction (latest revision overall).
func (*DefaultCompositionRevisionClient) Initialize ¶ added in v0.3.0
func (c *DefaultCompositionRevisionClient) Initialize(ctx context.Context) error
Initialize prepares the composition revision client for use.
func (*DefaultCompositionRevisionClient) ListCompositionRevisions ¶ added in v0.3.0
func (c *DefaultCompositionRevisionClient) ListCompositionRevisions(ctx context.Context) ([]*apiextensionsv1.CompositionRevision, error)
ListCompositionRevisions lists all composition revisions in the cluster.
type DefaultCredentialClient ¶ added in v0.6.0
type DefaultCredentialClient struct {
// contains filtered or unexported fields
}
DefaultCredentialClient implements CredentialClient.
func (*DefaultCredentialClient) FetchCompositionCredentials ¶ added in v0.6.0
func (c *DefaultCredentialClient) FetchCompositionCredentials(ctx context.Context, comp *apiextensionsv1.Composition) (types.CredentialFetchResult, error)
FetchCompositionCredentials extracts credential references from a composition's pipeline steps and fetches the referenced secrets from the cluster. This enables functions to receive credentials for authentication (e.g., Azure Workload Identity for function-msgraph).
A referenced secret that does not exist is recorded in the result's Absent list and the fetch continues, because an absent secret is a condition the caller may legitimately have handled: it may be injected at runtime by the cluster (e.g. workload identity) or supplied via the CLI's --function-credentials flag.
Every other failure is returned as an error. A Forbidden, a transport failure or an unconvertible payload means the secret may well exist and be relevant but could not be read, so rendering without it would produce a diff that silently does not reflect what the cluster would do. Per the project's accuracy-first stance that is a failure, not an advisory.
type DefaultDefinitionClient ¶
type DefaultDefinitionClient struct {
// contains filtered or unexported fields
}
DefaultDefinitionClient implements DefinitionClient.
func (*DefaultDefinitionClient) GetCompositeSchema ¶ added in v0.8.0
func (c *DefaultDefinitionClient) GetCompositeSchema(ctx context.Context, gvk schema.GroupVersionKind) (ucomposite.Schema, error)
GetCompositeSchema returns the composite.Schema (Legacy or Modern) for the given XR or claim GVK by looking up the XRD and reading its spec.scope. LegacyCluster → SchemaLegacy (canonical fields under spec.*); Cluster or Namespaced → SchemaModern (canonical fields under spec.crossplane.*). Tries the XR path first; falls back to the claim path so the helper works for both. See the interface doc for why scope, not apiVersion, drives the decision.
func (*DefaultDefinitionClient) GetXRDForClaim ¶
func (c *DefaultDefinitionClient) GetXRDForClaim(ctx context.Context, gvk schema.GroupVersionKind) (*un.Unstructured, error)
GetXRDForClaim finds the XRD that defines the given claim type.
func (*DefaultDefinitionClient) GetXRDForXR ¶
func (c *DefaultDefinitionClient) GetXRDForXR(ctx context.Context, gvk schema.GroupVersionKind) (*un.Unstructured, error)
GetXRDForXR finds the XRD that defines the given XR type.
func (*DefaultDefinitionClient) GetXRDs ¶
func (c *DefaultDefinitionClient) GetXRDs(ctx context.Context) ([]*un.Unstructured, error)
GetXRDs gets all XRDs in the cluster.
func (*DefaultDefinitionClient) Initialize ¶
func (c *DefaultDefinitionClient) Initialize(ctx context.Context) error
Initialize loads XRDs into the cache.
func (*DefaultDefinitionClient) IsClaimResource ¶ added in v0.2.0
func (c *DefaultDefinitionClient) IsClaimResource(ctx context.Context, resource *un.Unstructured) bool
IsClaimResource checks if the given resource is a claim type by attempting to find an XRD that defines it as a claim.
type DefaultEnvironmentClient ¶
type DefaultEnvironmentClient struct {
// contains filtered or unexported fields
}
DefaultEnvironmentClient implements EnvironmentClient.
func (*DefaultEnvironmentClient) GetEnvironmentConfig ¶
func (c *DefaultEnvironmentClient) GetEnvironmentConfig(ctx context.Context, name string) (*un.Unstructured, error)
GetEnvironmentConfig gets a specific environment config by name.
func (*DefaultEnvironmentClient) GetEnvironmentConfigs ¶
func (c *DefaultEnvironmentClient) GetEnvironmentConfigs(ctx context.Context) ([]*un.Unstructured, error)
GetEnvironmentConfigs gets all environment configurations.
func (*DefaultEnvironmentClient) Initialize ¶
func (c *DefaultEnvironmentClient) Initialize(ctx context.Context) error
Initialize loads environment configs into the cache.
type DefaultFunctionClient ¶
type DefaultFunctionClient struct {
// contains filtered or unexported fields
}
DefaultFunctionClient implements FunctionClient.
func (*DefaultFunctionClient) GetFunctionsFromPipeline ¶
func (c *DefaultFunctionClient) GetFunctionsFromPipeline(comp *apiextensionsv1.Composition) ([]pkgv1.Function, error)
GetFunctionsFromPipeline gets functions used in a composition pipeline.
func (*DefaultFunctionClient) Initialize ¶
func (c *DefaultFunctionClient) Initialize(ctx context.Context) error
Initialize loads functions into the cache.
func (*DefaultFunctionClient) ListFunctions ¶
ListFunctions lists all functions in the cluster.
type DefaultResourceTreeClient ¶
type DefaultResourceTreeClient struct {
// contains filtered or unexported fields
}
DefaultResourceTreeClient implements ResourceTreeClient.
func (*DefaultResourceTreeClient) GetResourceTree ¶
func (c *DefaultResourceTreeClient) GetResourceTree(ctx context.Context, root *un.Unstructured) (*resource.Resource, error)
GetResourceTree gets the resource tree for a root resource.
func (*DefaultResourceTreeClient) Initialize ¶
func (c *DefaultResourceTreeClient) Initialize(_ context.Context) error
Initialize initializes the resource tree client.
type DefinitionClient ¶
type DefinitionClient interface {
core.Initializable
// GetXRDs gets all XRDs in the cluster
GetXRDs(ctx context.Context) ([]*un.Unstructured, error)
// GetXRDForClaim finds the XRD that defines the given claim type
GetXRDForClaim(ctx context.Context, gvk schema.GroupVersionKind) (*un.Unstructured, error)
// GetXRDForXR finds the XRD that defines the given XR type
GetXRDForXR(ctx context.Context, gvk schema.GroupVersionKind) (*un.Unstructured, error)
// IsClaimResource checks if the given resource is a claim type
IsClaimResource(ctx context.Context, resource *un.Unstructured) bool
// GetCompositeSchema returns the composite.Schema (Legacy or Modern) that
// applies to the given XR or claim GVK. The scope is read from the XRD's
// spec.scope field (NOT the XRD's own apiVersion, which the apiserver may
// rewrite during v1↔v2 conversion). spec.scope == "LegacyCluster" maps to
// SchemaLegacy (canonical fields under spec.*); "Cluster"/"Namespaced" map
// to SchemaModern (canonical fields under spec.crossplane.*). Mirrors the
// rule the render binary uses (selectSchema in crossplane's
// internal/render/composite/render.go).
GetCompositeSchema(ctx context.Context, gvk schema.GroupVersionKind) (ucomposite.Schema, error)
}
DefinitionClient handles Crossplane definitions (XRDs).
func NewDefinitionClient ¶
func NewDefinitionClient(resourceClient kubernetes.ResourceClient, logger logging.Logger) DefinitionClient
NewDefinitionClient creates a new DefaultDefinitionClient.
type EnvironmentClient ¶
type EnvironmentClient interface {
core.Initializable
// GetEnvironmentConfigs gets all environment configurations
GetEnvironmentConfigs(ctx context.Context) ([]*un.Unstructured, error)
// GetEnvironmentConfig gets a specific environment config by name
GetEnvironmentConfig(ctx context.Context, name string) (*un.Unstructured, error)
}
EnvironmentClient handles environment configurations.
func NewEnvironmentClient ¶
func NewEnvironmentClient(resourceClient kubernetes.ResourceClient, logger logging.Logger) EnvironmentClient
NewEnvironmentClient creates a new DefaultEnvironmentClient.
type FunctionClient ¶
type FunctionClient interface {
core.Initializable
// GetFunctionsFromPipeline gets functions used in a composition pipeline
GetFunctionsFromPipeline(comp *apiextensionsv1.Composition) ([]pkgv1.Function, error)
// ListFunctions lists all functions in the cluster
ListFunctions(ctx context.Context) ([]pkgv1.Function, error)
}
FunctionClient handles operations related to Functions.
func NewFunctionClient ¶
func NewFunctionClient(resourceClient kubernetes.ResourceClient, logger logging.Logger) FunctionClient
NewFunctionClient creates a new DefaultFunctionClient.
type ResourceTreeClient ¶
type ResourceTreeClient interface {
core.Initializable
// GetResourceTree gets the resource tree for a root resource
GetResourceTree(ctx context.Context, root *un.Unstructured) (*resource.Resource, error)
}
ResourceTreeClient handles resource tree operations.
func NewResourceTreeClient ¶
func NewResourceTreeClient(treeClient *xrm.Client, logger logging.Logger) ResourceTreeClient
NewResourceTreeClient creates a new DefaultResourceTreeClient.