cloudcmd

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package cloudcmd provides executable command for the CLI.

This package focuses on the interaction with the cloud provider. It separates the cloud provider specific code from the rest of the CLI, and provides a common interface for all cloud providers.

Exported functions must not be cloud provider specific, but rather take a cloudprovider.Provider as an argument.

User interaction happens in the cmd package, and should not happen or pass through this package.

The backend to this package is currently provided by the terraform package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSIAMConfig added in v2.3.0

type AWSIAMConfig struct {
	Region string
	Prefix string
}

AWSIAMConfig holds the necessary values for AWS IAM configuration.

type AzureIAMConfig added in v2.3.0

type AzureIAMConfig struct {
	Region           string
	ServicePrincipal string
	ResourceGroup    string
}

AzureIAMConfig holds the necessary values for Azure IAM configuration.

type Creator

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

Creator creates cloud resources.

func NewCreator

func NewCreator(out io.Writer) *Creator

NewCreator creates a new creator.

func (*Creator) Create

func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, config *config.Config, name, insType string, controlPlaneCount, workerCount int,
) (clusterid.File, error)

Create creates the handed amount of instances and all the needed resources.

type GCPIAMConfig added in v2.3.0

type GCPIAMConfig struct {
	Region           string
	Zone             string
	ProjectID        string
	ServiceAccountID string
}

GCPIAMConfig holds the necessary values for GCP IAM configuration.

type IAMConfig added in v2.3.0

type IAMConfig struct {
	GCP   GCPIAMConfig
	Azure AzureIAMConfig
	AWS   AWSIAMConfig
}

IAMConfig holds the necessary values for IAM configuration.

type IAMCreator added in v2.3.0

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

IAMCreator creates the IAM configuration on the cloud provider.

func NewIAMCreator added in v2.3.0

func NewIAMCreator(out io.Writer) *IAMCreator

NewIAMCreator creates a new IAM creator.

func (*IAMCreator) Create added in v2.3.0

func (c *IAMCreator) Create(ctx context.Context, provider cloudprovider.Provider, iamConfig *IAMConfig) (iamid.File, error)

Create prepares and hands over the corresponding providers IAM creator.

type Terminator

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

Terminator deletes cloud provider resources.

func NewTerminator

func NewTerminator() *Terminator

NewTerminator create a new cloud terminator.

func (*Terminator) Terminate

func (t *Terminator) Terminate(ctx context.Context) (retErr error)

Terminate deletes the could provider resources.

type Upgrader

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

Upgrader handles upgrading the cluster's components using the CLI.

func NewUpgrader

func NewUpgrader(outWriter io.Writer, log debugLog) (*Upgrader, error)

NewUpgrader returns a new Upgrader.

func (*Upgrader) GetCurrentImage

func (u *Upgrader) GetCurrentImage(ctx context.Context) (*unstructured.Unstructured, string, error)

GetCurrentImage returns the currently used image version of the cluster.

func (*Upgrader) KubernetesVersion added in v2.3.0

func (u *Upgrader) KubernetesVersion() (string, error)

KubernetesVersion returns the version of Kubernetes the Constellation is currently running on.

func (*Upgrader) Upgrade

func (u *Upgrader) Upgrade(ctx context.Context, imageReference, imageVersion string, measurements measurements.M) error

Upgrade upgrades the cluster to the given measurements and image.

func (*Upgrader) UpgradeHelmServices added in v2.4.0

func (u *Upgrader) UpgradeHelmServices(ctx context.Context, config *config.Config, timeout time.Duration, allowDestructive bool) error

UpgradeHelmServices upgrade helm services.

type Validator

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

Validator validates Platform Configuration Registers (PCRs).

func NewValidator

func NewValidator(provider cloudprovider.Provider, conf *config.Config) (*Validator, error)

NewValidator creates a new Validator.

func (*Validator) PCRS

func (v *Validator) PCRS() measurements.M

PCRS returns the validator's PCR map.

func (*Validator) UpdateInitPCRs

func (v *Validator) UpdateInitPCRs(ownerID, clusterID string) error

UpdateInitPCRs sets the owner and cluster PCR values.

func (*Validator) V

func (v *Validator) V(cmd *cobra.Command) atls.Validator

V returns the validator as atls.Validator.

Jump to

Keyboard shortcuts

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