resource

package
v1.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resource contains the definition of the Resource used by all trace printers, and the client used to get a Resource and its children.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MappingFor added in v1.15.0

func MappingFor(rmapper meta.RESTMapper, resourceOrKindArg string) (*meta.RESTMapping, error)

MappingFor returns the RESTMapping for the given resource or kind argument. Copied over from cli-runtime pkg/resource Builder, https://github.com/kubernetes/cli-runtime/blob/9a91d944dd43186c52e0162e12b151b0e460354a/pkg/resource/builder.go#L768

Types

type Resource

type Resource struct {
	Unstructured unstructured.Unstructured `json:"object"`
	Error        error                     `json:"error,omitempty"`
	Children     []*Resource               `json:"children,omitempty"`
}

Resource struct represents a kubernetes resource.

func GetResource added in v1.15.0

func GetResource(ctx context.Context, client client.Client, ref *v1.ObjectReference) *Resource

GetResource returns the requested Resource, setting any error as Resource.Error.

func (*Resource) GetCondition

func (r *Resource) GetCondition(ct xpv1.ConditionType) xpv1.Condition

GetCondition of this resource.

type TreeClient added in v1.15.0

type TreeClient interface {
	GetResourceTree(ctx context.Context, root *Resource) (*Resource, error)
}

TreeClient is the interface to get a Resource with all its children.

Directories

Path Synopsis
Package xpkg contains the client to get a Crossplane package with all its dependencies as a tree of Resource.
Package xpkg contains the client to get a Crossplane package with all its dependencies as a tree of Resource.
Package xrm contains the client to get a Crossplane resource with all its children as a tree of Resource.
Package xrm contains the client to get a Crossplane resource with all its children as a tree of Resource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL