client

package
v0.0.0-...-b82b62a Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientProxy

func NewClientProxy(config *rest.Config, mapper meta.RESTMapper) (client.Client, error)

NewClientProxy returns a new instance of ProxyClient.

Types

type ProxyClient

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

ProxyClient holds information required to proxy Client requests to verify RESTMapper integrity. During the proxy, the underlying mapper verifies mapping for the calling resource. If not available and NoMatchesKind error occurs, the mappings are reset (if type meta.ResettableRESTMapper). After reset a follow-up call verifies if mappings are now available.

func (*ProxyClient) Create

func (p *ProxyClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

Create implements client.Client.

func (*ProxyClient) Delete

func (p *ProxyClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

Delete implements client.Client.

func (*ProxyClient) DeleteAllOf

func (p *ProxyClient) DeleteAllOf(
	ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption,
) error

DeleteAllOf implements client.Client.

func (*ProxyClient) Get

func (p *ProxyClient) Get(ctx context.Context,
	key client.ObjectKey,
	obj client.Object,
	opts ...client.GetOption,
) error

Get implements client.Client.

func (*ProxyClient) List

func (p *ProxyClient) List(ctx context.Context, obj client.ObjectList, opts ...client.ListOption) error

List implements client.Client.

func (*ProxyClient) Patch

func (p *ProxyClient) Patch(
	ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption,
) error

Patch implements client.Client.

func (*ProxyClient) RESTMapper

func (p *ProxyClient) RESTMapper() meta.RESTMapper

RESTMapper returns the rest mapper this client is using.

func (*ProxyClient) Scheme

func (p *ProxyClient) Scheme() *runtime.Scheme

Scheme returns the scheme this client is using.

func (*ProxyClient) Status

func (p *ProxyClient) Status() client.StatusWriter

Status implements client.StatusClient.

func (*ProxyClient) SubResource

func (p *ProxyClient) SubResource(subResource string) client.SubResourceClient

func (*ProxyClient) Update

func (p *ProxyClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

Update implements client.Client.

type SingletonClients

type SingletonClients struct {

	// controller runtime client
	client.Client
	// contains filtered or unexported fields
}

SingletonClients serves as a single-minded client interface that combines all kubernetes Client APIs (Helm, Kustomize, Kubernetes, Client-Go) under the hood. It offers a simple initialization lifecycle during creation, but delegates all heavy-duty work to deferred discovery logic and a single http client as well as a client cache to support GV-based clients.

func NewSingletonClients

func NewSingletonClients(info *types.ClusterInfo, logger logr.Logger) (*SingletonClients, error)

func (*SingletonClients) ClientForMapping

func (s *SingletonClients) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)

ClientForMapping returns a RESTClient for working with the specified RESTMapping or an error. This is intended for working with arbitrary resources and is not guaranteed to point to a Kubernetes APIServer.

func (*SingletonClients) DynamicClient

func (s *SingletonClients) DynamicClient() (dynamic.Interface, error)

DynamicClient returns a dynamic client ready for use.

func (*SingletonClients) DynamicResourceInterface

func (s *SingletonClients) DynamicResourceInterface(obj *unstructured.Unstructured) (dynamic.ResourceInterface, error)

func (*SingletonClients) Install

func (s *SingletonClients) Install() *action.Install

Install returns the helm action install interface.

func (*SingletonClients) KubeClient

func (s *SingletonClients) KubeClient() *kube.Client

func (*SingletonClients) KubernetesClientSet

func (s *SingletonClients) KubernetesClientSet() (*kubernetes.Clientset, error)

KubernetesClientSet gives you back an external clientset.

func (*SingletonClients) NewBuilder

func (s *SingletonClients) NewBuilder() *resource.Builder

NewBuilder returns a new resource builder for structured api objects.

func (*SingletonClients) OpenAPIGetter

OpenAPIGetter returns a getter for the openapi schema document.

func (*SingletonClients) OpenAPISchema

func (s *SingletonClients) OpenAPISchema() (openapi.Resources, error)

OpenAPISchema returns metadata and structural information about Kubernetes object definitions.

func (*SingletonClients) RESTClient

func (s *SingletonClients) RESTClient() (*rest.RESTClient, error)

RESTClient returns a RESTClient for accessing Kubernetes resources or an error.

func (*SingletonClients) ResourceInfo

func (s *SingletonClients) ResourceInfo(obj *unstructured.Unstructured, retryOnNoMatch bool) (*resource.Info, error)

func (*SingletonClients) ToDiscoveryClient

func (s *SingletonClients) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

func (*SingletonClients) ToRESTConfig

func (s *SingletonClients) ToRESTConfig() (*rest.Config, error)

func (*SingletonClients) ToRESTMapper

func (s *SingletonClients) ToRESTMapper() (meta.RESTMapper, error)

func (*SingletonClients) ToRawKubeConfigLoader

func (s *SingletonClients) ToRawKubeConfigLoader() clientcmd.ClientConfig

func (*SingletonClients) UnstructuredClientForMapping

func (s *SingletonClients) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)

UnstructuredClientForMapping returns a RESTClient for working with Unstructured objects.

func (*SingletonClients) Validator

func (s *SingletonClients) Validator(
	validationDirective string, verifier *resource.QueryParamVerifier,
) (validation.Schema, error)

Validator returns a schema that can validate objects stored on disk.

Jump to

Keyboard shortcuts

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