cluster

package
v0.0.0-...-15bfe54 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigMapResolver

func NewConfigMapResolver(client dclient.Interface) (engineapi.ConfigmapResolver, error)

func NewPolicyExceptionSelector

func NewPolicyExceptionSelector(namespace string, client versioned.Interface, exceptions ...*v2.PolicyException) engineapi.PolicyExceptionSelector

func NewSecretLister

func NewSecretLister(client dclient.Interface, ns string) v1.SecretNamespaceLister

func NewWrapper

func NewWrapper(client dclient.Interface) dclient.Interface

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Overwrite write actions to dry run prevents performing actual operations

func (*Client) ApplyResource

func (c *Client) ApplyResource(ctx context.Context, apiVersion string, kind string, namespace string, name string, obj interface{}, dryRun bool, fieldManager string, subresources ...string) (*unstructured.Unstructured, error)

func (*Client) ApplyStatusResource

func (c *Client) ApplyStatusResource(ctx context.Context, apiVersion string, kind string, namespace string, name string, obj interface{}, dryRun bool, fieldManager string) (*unstructured.Unstructured, error)

func (*Client) CreateResource

func (c *Client) CreateResource(ctx context.Context, apiVersion string, kind string, namespace string, obj interface{}, dryRun bool) (*unstructured.Unstructured, error)

func (*Client) DeleteResource

func (c *Client) DeleteResource(ctx context.Context, apiVersion string, kind string, namespace string, name string, dryRun bool) error

func (*Client) Discovery

func (c *Client) Discovery() dclient.IDiscovery

func (*Client) GetDynamicInterface

func (c *Client) GetDynamicInterface() dynamic.Interface

func (*Client) GetEventsInterface

func (c *Client) GetEventsInterface() eventsv1.EventsV1Interface

func (*Client) GetKubeClient

func (c *Client) GetKubeClient() kubernetes.Interface

func (*Client) GetResource

func (c *Client) GetResource(ctx context.Context, apiVersion string, kind string, namespace string, name string, subresources ...string) (*unstructured.Unstructured, error)

func (*Client) ListResource

func (c *Client) ListResource(ctx context.Context, apiVersion string, kind string, namespace string, lselector *metav1.LabelSelector) (*unstructured.UnstructuredList, error)

func (*Client) PatchResource

func (c *Client) PatchResource(ctx context.Context, apiVersion string, kind string, namespace string, name string, patch []byte) (*unstructured.Unstructured, error)

func (*Client) RawAbsPath

func (c *Client) RawAbsPath(ctx context.Context, path string, method string, dataReader io.Reader) ([]byte, error)

func (*Client) SetDiscovery

func (c *Client) SetDiscovery(discoveryClient dclient.IDiscovery)

func (*Client) UpdateResource

func (c *Client) UpdateResource(ctx context.Context, apiVersion string, kind string, namespace string, obj interface{}, dryRun bool, subresources ...string) (*unstructured.Unstructured, error)

func (*Client) UpdateStatusResource

func (c *Client) UpdateStatusResource(ctx context.Context, apiVersion string, kind string, namespace string, obj interface{}, dryRun bool) (*unstructured.Unstructured, error)

type Cluster

type Cluster interface {
	Kinds(context.Context, ...string) ([]Resource, error)
	Namespaces(context.Context) ([]string, error)
	Search(context.Context, string, string, string, map[string]string) ([]SearchResult, error)
	Get(context.Context, string, string, string, string) (*unstructured.Unstructured, error)
	DClient([]runtime.Object, ...runtime.Object) (dclient.Interface, error)
	PolicyExceptionSelector(namespace string, exceptions ...*v2.PolicyException) engineapi.PolicyExceptionSelector
	IsFake() bool
}

func New

func New(restConfig *rest.Config) (Cluster, error)

func NewFake

func NewFake() Cluster

type Resource

type Resource struct {
	APIVersion    string `json:"apiVersion"`
	Kind          string `json:"kind"`
	ClusterScoped bool   `json:"clusterScoped"`
}

type SearchResult

type SearchResult struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
}

Jump to

Keyboard shortcuts

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