pkeservice

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster = cluster.Cluster

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock for the Service type.

func (*MockService) RegisterNodeStatus

func (_m *MockService) RegisterNodeStatus(ctx context.Context, clusterIdentifier cluster.Identifier, nodeStatus NodeStatus) (resp RegisterNodeStatusResponse, err error)

RegisterNodeStatus provides a mock function.

type NodeStatus

type NodeStatus struct {
	// name of node
	Name string

	// name of nodepool
	NodePool string

	// ip address of node (where the other nodes can reach it)
	Ip string

	// detailed description about the current bootstrapping status (including the cause of the failure)
	Message string

	// the current phase of the bootstrap process
	Phase string

	// if this is the final status report, that describes the conclusion of the whole process
	Final bool

	Status ProcessStatus

	// exact time of event
	Timestamp time.Time

	// ID of the process registered earlier (register new process if empty)
	ProcessID string
}

type Process

type Process = process.Process

type ProcessEvent

type ProcessEvent = process.ProcessEvent

type ProcessStatus

type ProcessStatus = process.ProcessStatus
const (
	Running  ProcessStatus = "running"
	Failed   ProcessStatus = "failed"
	Finished ProcessStatus = "finished"
	Canceled ProcessStatus = "canceled"
)

type RegisterNodeStatusResponse

type RegisterNodeStatusResponse struct {
	ProcessID string
}

type Service

type Service interface {
	// RegisterNodeStatus registers status reported by a node
	RegisterNodeStatus(ctx context.Context, clusterIdentifier cluster.Identifier, nodeStatus NodeStatus) (resp RegisterNodeStatusResponse, err error)
}

Service provides an interface to PKE specific operations (i.e. [currently some of] those called by the pke installer)

func NewService

func NewService(
	clusters cluster.Store,
	processes processService,
	logger logger,
	idGenerator idGenerator,
) Service

NewService returns a new Service instance

type Store

type Store interface {
	// GetCluster returns a generic Cluster.
	// Returns an error with the NotFound behavior when the cluster cannot be found.
	GetCluster(ctx context.Context, id uint) (Cluster, error)
}

Store allows looking up clusters form persistent storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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