dynamic

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

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 is a dynamic.Interface wrapper

func NewClient

func NewClient(log logr.Logger, config *rest.Config) (*Client, error)

NewClient creates a new dynamic client

func (*Client) GetConstraintTemplate

func (c *Client) GetConstraintTemplate(ctx context.Context, constraintKind string) (*unstructured.Unstructured, error)

GetConstraintTemplate returns the constraint template for the provided constraint Kind

func (*Client) GetResourceByKind

func (c *Client) GetResourceByKind(ctx context.Context, kind, name, namespace string, kindToGVR map[string][]schema.GroupVersionResource) (*unstructured.Unstructured, error)

GetResourceByKind returns a resource by trying all the kind-to-GVR mappings See explanation in kind.go

func (*Client) GetViolatedConstraints

func (c *Client) GetViolatedConstraints(ctx context.Context, groupResources []schema.GroupResource) (map[types.UID]*unstructured.Unstructured, error)

GetViolatedConstraints find all constraints that have violations. To remove duplicates, it returns a map of constraint UID to constraint.

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration) error

SetTimeout for calls to the API server

Jump to

Keyboard shortcuts

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