upgrade

package
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package upgrade provides functionality to upgrade the cluster and it's resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TerraformUpgradeOptions

type TerraformUpgradeOptions struct {
	// LogLevel is the log level used for Terraform.
	LogLevel terraform.LogLevel
	// CSP is the cloud provider to perform the upgrade on.
	CSP cloudprovider.Provider
	// Vars are the Terraform variables used for the upgrade.
	Vars terraform.Variables
	// OutputFile is the file to write the Terraform output to.
	OutputFile string
}

TerraformUpgradeOptions are the options used for the Terraform upgrade.

type TerraformUpgrader

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

TerraformUpgrader is responsible for performing Terraform migrations on cluster upgrades.

func NewTerraformUpgrader

func NewTerraformUpgrader(tfClient tfClient, outWriter io.Writer) (*TerraformUpgrader, error)

NewTerraformUpgrader returns a new TerraformUpgrader.

func (*TerraformUpgrader) ApplyTerraformMigrations

func (u *TerraformUpgrader) ApplyTerraformMigrations(ctx context.Context, fileHandler file.Handler, opts TerraformUpgradeOptions, upgradeID string) error

ApplyTerraformMigrations applies the migerations planned by PlanTerraformMigrations. If PlanTerraformMigrations has not been executed before, it will return an error. In case of a successful upgrade, the output will be written to the specified file and the old Terraform directory is replaced By the new one.

func (*TerraformUpgrader) CheckTerraformMigrations

func (u *TerraformUpgrader) CheckTerraformMigrations(fileHandler file.Handler, upgradeID string) error

CheckTerraformMigrations checks whether Terraform migrations are possible in the current workspace. If the files that will be written during the upgrade already exist, it returns an error.

func (*TerraformUpgrader) CleanUpTerraformMigrations

func (u *TerraformUpgrader) CleanUpTerraformMigrations(fileHandler file.Handler, upgradeID string) error

CleanUpTerraformMigrations cleans up the Terraform migration workspace, for example when an upgrade is aborted by the user.

func (*TerraformUpgrader) PlanTerraformMigrations

func (u *TerraformUpgrader) PlanTerraformMigrations(ctx context.Context, opts TerraformUpgradeOptions, upgradeID string) (bool, error)

PlanTerraformMigrations prepares the upgrade workspace and plans the Terraform migrations for the Constellation upgrade. If a diff exists, it's being written to the upgrader's output writer. It also returns a bool indicating whether a diff exists.

Jump to

Keyboard shortcuts

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