provision

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ProvisionPluginName = "provision"

ProvisionPluginName is the name that should be used in the plugin map.

Variables

This section is empty.

Functions

func StatusDone added in v0.5.0

func StatusDone(stage, message string) *provisionpb.Status

StatusOk returns a Status message with Done set to true and no Error.

func StatusError added in v0.5.0

func StatusError(stage, message string, err error) *provisionpb.Status

StatusOk returns a Status message with Done set to true and an Error.

func StatusOk added in v0.5.0

func StatusOk(stage, message string) *provisionpb.Status

StatusOk returns a Status message with Done set to false and no Error.

Types

type GRPCServer added in v0.5.0

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

GRPCServer implements provisionpb.ProvisionPluginServiceServer, translating gRPC calls to impl, the Provision implementation.

func (*GRPCServer) Deploy added in v0.5.0

func (*GRPCServer) TearDown added in v0.5.0

func (*GRPCServer) Validate added in v0.5.0

type Provision

type Provision interface {
	validator.Validator

	// Deploy deploys the workload identity configuration to the clusters in the system.
	// The method is asynchronous, returning a channel over which Status messages are sent
	// describing the various stages of deployment and their outcomes.
	Deploy(ctx context.Context, ds datasource.DataSource, kubeCfgFile string) (<-chan *provisionpb.Status, error)

	// TearDown tears down the workload identity configuration from the clusters in the system.
	// The method is asynchronous, returning a channel over which Status messages are sent
	// describing the various stages of tear down and their outcomes.
	TearDown(ctx context.Context, ds datasource.DataSource, kubeCfgFile string) (<-chan *provisionpb.Status, error)
}

Provision is the interface that provision plugins have to implement.

type ProvisionPlugin added in v0.5.0

type ProvisionPlugin struct {
	go_plugin.Plugin
	Impl Provision
}

ProvisionPlugin implements the plugin.Plugin interface to provide the GRPC server or client back to the plugin machinery. The server side should provide the Impl field with a concrete implementation of the ProvisionPlugin interface.

func (*ProvisionPlugin) GRPCClient added in v0.5.0

func (pp *ProvisionPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*ProvisionPlugin) GRPCServer added in v0.5.0

func (pp *ProvisionPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error

type ProvisionPluginClientGRPC added in v0.5.0

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

ProvisionPluginClientGRPC is used by clients (main application) to translate the Provision interface of plugins to GRPC calls.

func (*ProvisionPluginClientGRPC) Deploy added in v0.5.0

func (c *ProvisionPluginClientGRPC) Deploy(ctx context.Context, source datasource.DataSource, kubeCfgFile string) (<-chan *provisionpb.Status, error)

func (*ProvisionPluginClientGRPC) TearDown added in v0.5.0

func (c *ProvisionPluginClientGRPC) TearDown(ctx context.Context, source datasource.DataSource, kubeCfgFile string) (<-chan *provisionpb.Status, error)

func (*ProvisionPluginClientGRPC) Validate added in v0.5.0

type StatusBuilder added in v0.5.0

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

StatusBuilder makes it easier to construct Status messages with context about the trust zone and cluster.

func NewStatusBuilder added in v0.5.0

func NewStatusBuilder(trustZone, cluster string) *StatusBuilder

func (*StatusBuilder) Done added in v0.5.0

func (sb *StatusBuilder) Done(stage, message string) *provisionpb.Status

Done returns a Status message with Done set to true and no Error

func (*StatusBuilder) Error added in v0.5.0

func (sb *StatusBuilder) Error(stage, message string, err error) *provisionpb.Status

Error returns a Status message with Done set to true and an Error

func (*StatusBuilder) Ok added in v0.5.0

func (sb *StatusBuilder) Ok(stage, message string) *provisionpb.Status

Ok returns a Status message with Done set to false and no Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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