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 ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to get a Resource with all its children.
func NewClient ¶
func NewClient(in client.Client, rmapper meta.RESTMapper, opts ...ClientOption) (*Client, error)
NewClient returns a new Client.
func (*Client) GetResourceTree ¶
func (kc *Client) GetResourceTree(ctx context.Context, rootRef *v1.ObjectReference) (*Resource, error)
GetResourceTree returns the requested Resource and all its children.
func (*Client) MappingFor ¶
func (kc *Client) MappingFor(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
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a functional option for a Client.
func WithConnectionSecrets ¶
func WithConnectionSecrets(v bool) ClientOption
WithConnectionSecrets is a functional option that sets the client to get secrets to the desired value.
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 (*Resource) GetCondition ¶
func (r *Resource) GetCondition(ct xpv1.ConditionType) xpv1.Condition
GetCondition of this resource.