controlplane

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package controlplane contains all the GRPC clients that can be used to interact with the control plane

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterOperationClient

type ClusterOperationClient struct {
	Conn   *grpc.ClientConn
	Client controlplane.ClusterOperationsClient
}

ClusterOperationClient is the client for the ClusterOperationService containing the connection and gRPC client

func GetClusterOperationClient

func GetClusterOperationClient(info *service.ConnectionInfo) (*ClusterOperationClient, error)

GetClusterOperationClient returns client for the JoinClusterService

func (*ClusterOperationClient) GetKubeConfig

func (c *ClusterOperationClient) GetKubeConfig(ctx context.Context) ([]byte, error)

GetKubeConfig returns the kubeconfig file

func (*ClusterOperationClient) JoinCluster

func (c *ClusterOperationClient) JoinCluster(ctx context.Context, listenPort int, kubeConfigPath string) (*kubeconfig.KubeConfig, *scenario.NodeResources, int64, error)

JoinCluster joins the apate cluster, saves the received kube config and returns the node resources

func (*ClusterOperationClient) LeaveCluster

func (c *ClusterOperationClient) LeaveCluster(ctx context.Context, uuid string) error

LeaveCluster signals to the apate control panel that this node is leaving the cluster

type ScenarioClient

type ScenarioClient struct {
	Conn   *grpc.ClientConn
	Client controlplane.ScenarioClient
}

ScenarioClient is the client for the ScenarioService containing the connection and gRPC client

func GetScenarioClient

func GetScenarioClient(info *service.ConnectionInfo) (*ScenarioClient, error)

GetScenarioClient returns client for the ScenarioService

type StatusClient

type StatusClient struct {
	Conn   *grpc.ClientConn
	Client controlplane.StatusClient
}

StatusClient is the client for the StatusService containing the connection and gRPC client

func GetStatusClient

func GetStatusClient(info *service.ConnectionInfo) (*StatusClient, error)

GetStatusClient returns client for the StatusService

func (*StatusClient) WaitForControlPlane

func (c *StatusClient) WaitForControlPlane(ctx context.Context, timeout time.Duration) error

WaitForControlPlane waits for the control plane to be up and running

func (*StatusClient) WaitForTrigger

func (c *StatusClient) WaitForTrigger(ctx context.Context, trigger <-chan struct{}, update func(int)) error

WaitForTrigger polls the server every second to retrieve the latest amount of healthy nodes and calls the given update function after every poll until the trigger channel is written to

Jump to

Keyboard shortcuts

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