tcp

package
v0.0.0-...-ec1031e Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKubernetesVersionEmpty = errors.New("Kubernetes version cannot be empty")
	ErrNamespaceEmpty         = errors.New("control plane namespace cannot be empty")
	ErrNameEmpty              = errors.New("control plane name cannot be empty")
	ErrServiceTypeEmpty       = errors.New("control plane service type cannot be empty")
	ErrKubeClientNil          = errors.New("client kubernetes is nil")
	ErrLoggerNil              = errors.New("logger is nil")
)

Functions

This section is empty.

Types

type KubeConfig

type KubeConfig struct {
	Metadata KubeConfigMetadata
	Data     []byte
}

KubeConfig represents a kubeconfig for a specific TenantControlPlane.

func NewKubeConfig

func NewKubeConfig(name, namespace, tcpowner string, content []byte) *KubeConfig

func (*KubeConfig) MarshalJSON

func (m *KubeConfig) MarshalJSON() ([]byte, error)

type KubeConfigMetadata

type KubeConfigMetadata struct {
	Name      string
	Namespace string
	OwnerTCP  string
}

KubeConfigMetadata are KubeConfig metadata, including the reference to the TenantControlPlane that owns the kubeconfig that the metadata refers to.

type TCPClient

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

TCPClient represents the options of the command line for managing Tenant Control Plane resources.

func NewTCPClient

func NewTCPClient(opts ...TCPClientOption) (*TCPClient, error)

func (*TCPClient) CreateTCP

func (c *TCPClient) CreateTCP(ctx context.Context, opts *TCPOptions) error

CreateTCP creates TCPOptions resource using the provided context, and returns an error.

func (*TCPClient) DeleteTCP

func (c *TCPClient) DeleteTCP(ctx context.Context, opts *TCPOptions) error

DeleteTCP deletes a TCPOptions resource using the provided context, and returns an error.

func (*TCPClient) GetKubeconfig

func (c *TCPClient) GetKubeconfig(ctx context.Context, opts *TCPOptions) (*KubeConfig, error)

GetKubeconfig retrieves a kubeconfig for a specified TenantControlPlane using the provided context, and returns the kubeconfig as string and an error.

func (*TCPClient) GetTCP

GetTCP get a TCPOptions resource using the provided context, and returns an error.

func (*TCPClient) ListKubeconfigs

func (c *TCPClient) ListKubeconfigs(ctx context.Context, opts *TCPOptions) ([]KubeConfig, error)

ListKubeconfigs retrieves a kubeconfig for a specified TenantControlPlane using the provided context, and returns the kubeconfig as string and an error.

func (*TCPClient) ListTCPs

ListTCPs get a TCPOptions resource using the provided context, and returns an error.

func (*TCPClient) PurgeTCPs

func (c *TCPClient) PurgeTCPs(ctx context.Context) error

PurgeTCPs deletes all the TenantControlPlane at cluster-level. ATTENTION: it deletes all the resources across all the Namespaces.

func (*TCPClient) Set

func (c *TCPClient) Set(opts ...TCPClientOption)

func (*TCPClient) Validate

func (c *TCPClient) Validate() error

type TCPClientOption

type TCPClientOption func(opts *TCPClient)

func WithKubeClient

func WithKubeClient(kube client.Client) TCPClientOption

func WithLogger

func WithLogger(logger log.Logger) TCPClientOption

type TCPOption

type TCPOption func(opts *TCPOptions)

func WithKubernetesVersion

func WithKubernetesVersion(v string) TCPOption

func WithName

func WithName(name string) TCPOption

func WithNamespace

func WithNamespace(namespace string) TCPOption

func WithServiceType

func WithServiceType(t string) TCPOption

type TCPOptions

type TCPOptions struct {
	*kamajiv1alpha1.TenantControlPlane
}

TCPOptions represent generic options of TenantControlPlanes for all the operations (create, update, get, list, delete).

func NewTCPOptions

func NewTCPOptions(opts ...TCPOption) *TCPOptions

func (*TCPOptions) AddCreateFlags

func (o *TCPOptions) AddCreateFlags(flags *pflag.FlagSet)

func (*TCPOptions) Set

func (c *TCPOptions) Set(opts ...TCPOption)

func (*TCPOptions) Validate

func (o *TCPOptions) Validate() error

Jump to

Keyboard shortcuts

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