client

package
v0.1.86 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 40

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamespaceFromContext added in v0.1.72

func NamespaceFromContext(ctx context.Context) (string, error)

func New

func New(ctx context.Context, schemes ...SchemeAdder) (client.Client, error)

New returns a new controller runtime caching client, initialized with core and unikorn resources for typed operation.

func NewContextWithCluster added in v0.1.64

func NewContextWithCluster(ctx context.Context, remote *ClusterContext) context.Context

func NewContextWithNamespace added in v0.1.72

func NewContextWithNamespace(ctx context.Context, namespace string) context.Context

func NewContextWithProvisionerClient added in v0.1.64

func NewContextWithProvisionerClient(ctx context.Context, client client.Client) context.Context

func NewScheme

func NewScheme(schemes ...SchemeAdder) (*runtime.Scheme, error)

NewScheme returns a scheme with all types that are required by unikorn. TODO: we'd really love to include ArgoCD here, but it's dependency hell. See https://github.com/argoproj/gitops-engine/issues/56 for a never ending commentary on the underlying problem.

func ProvisionerClientFromContext added in v0.1.64

func ProvisionerClientFromContext(ctx context.Context) (client.Client, error)

func TLSClientConfig added in v0.1.65

func TLSClientConfig(ctx context.Context, cli client.Client, options *HTTPOptions, clientOptions *HTTPClientOptions) (*tls.Config, error)

TLSClientConfig is a helper to create a TLS client configuration.

Types

type ClusterContext added in v0.1.64

type ClusterContext struct {
	// Client is a Kubernetes client that can access resources on the remote
	// cluster.  This is typically used to extract Kubenetes configuration to
	// chain to the next remote cluster.  It is also used when some combination
	// of Helm application/ArgoCD is broken and needs manual intervention.
	Client client.Client
	// ID is the unique remote cluster ID as cunsumed by the CD layer.
	// This is only set on invocation of a remote cluster provisioner.
	ID *cd.ResourceIdentifier
	// Host is the Kubernetes endpoint hostname. This is only set on
	// invocation of a remote cluster provisioner.
	Host string
	// Port is the Kubernetes endpoint port. This is only set on
	// invocation of a remote cluster provisioner.
	Port string
}

ClusterContext is available to all provisioners and is updated when invoked within the scope of a remote cluster provisioner. In general, you should avoid having to use this, because it implies hackery.

func ClusterFromContext added in v0.1.64

func ClusterFromContext(ctx context.Context) (*ClusterContext, error)

type HTTPClientOptions added in v0.1.65

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

HTTPClientOptions allows generic options to be passed to all HTTP clients.

func (*HTTPClientOptions) AddFlags added in v0.1.65

func (o *HTTPClientOptions) AddFlags(f *pflag.FlagSet)

AddFlags adds the options to the CLI flags.

func (*HTTPClientOptions) ApplyTLSClientConfig added in v0.1.65

func (o *HTTPClientOptions) ApplyTLSClientConfig(ctx context.Context, cli client.Client, config *tls.Config) error

ApplyTLSClientConfig loads op a client certificate if one is configured and applies it to the provided TLS configuration.

type HTTPOptions added in v0.1.65

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

HTTPOptions are generic options for HTTP clients.

func NewHTTPOptions added in v0.1.65

func NewHTTPOptions(service string) *HTTPOptions

func (*HTTPOptions) AddFlags added in v0.1.65

func (o *HTTPOptions) AddFlags(f *pflag.FlagSet)

AddFlags adds the options to the CLI flags.

func (*HTTPOptions) ApplyTLSConfig added in v0.1.65

func (o *HTTPOptions) ApplyTLSConfig(ctx context.Context, cli client.Client, config *tls.Config) error

ApplyTLSConfig adds CA certificates to the TLS configuration if one is specified.

func (*HTTPOptions) Host added in v0.1.65

func (o *HTTPOptions) Host() string

type SchemeAdder

type SchemeAdder func(*runtime.Scheme) error

SchemeAdder allows custom resources to be added to the scheme.

Jump to

Keyboard shortcuts

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