Documentation ¶
Index ¶
- Variables
- type KubeConfig
- type KubeConfigMetadata
- type TCPClient
- func (c *TCPClient) CreateTCP(ctx context.Context, opts *TCPOptions) error
- func (c *TCPClient) DeleteTCP(ctx context.Context, opts *TCPOptions) error
- func (c *TCPClient) GetKubeconfig(ctx context.Context, opts *TCPOptions) (*KubeConfig, error)
- func (c *TCPClient) GetTCP(ctx context.Context, opts *TCPOptions) (*kamajiv1alpha1.TenantControlPlane, error)
- func (c *TCPClient) ListKubeconfigs(ctx context.Context, opts *TCPOptions) ([]KubeConfig, error)
- func (c *TCPClient) ListTCPs(ctx context.Context, opts *TCPOptions) (*kamajiv1alpha1.TenantControlPlaneList, error)
- func (c *TCPClient) PurgeTCPs(ctx context.Context) error
- func (c *TCPClient) Set(opts ...TCPClientOption)
- func (c *TCPClient) Validate() error
- type TCPClientOption
- type TCPOption
- type TCPOptions
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
func (c *TCPClient) GetTCP(ctx context.Context, opts *TCPOptions) (*kamajiv1alpha1.TenantControlPlane, error)
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 ¶
func (c *TCPClient) ListTCPs(ctx context.Context, opts *TCPOptions) (*kamajiv1alpha1.TenantControlPlaneList, error)
ListTCPs get a TCPOptions resource using the provided context, and returns an error.
func (*TCPClient) PurgeTCPs ¶
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)
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 WithNamespace ¶
func WithServiceType ¶
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