infraflow

package
v1.39.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// IdentifierRouter is the key for the router id
	IdentifierRouter = "Router"
	// IdentifierNetwork is the key for the network id
	IdentifierNetwork = "Network"
	// IdentifierSubnet is the key for the subnet id
	IdentifierSubnet = "Subnet"
	// IdentifierFloatingNetwork is the key for the floating network id
	IdentifierFloatingNetwork = "FloatingNetwork"
	// IdentifierSecGroup is the key for the security group id
	IdentifierSecGroup = "SecurityGroup"

	// NameFloatingNetwork is the key for the floating network name
	NameFloatingNetwork = "FloatingNetworkName"
	// NameFloatingPoolSubnet is the name/regex for the floating pool subnets
	NameFloatingPoolSubnet = "FloatingPoolSubnetName"
	// NameNetwork is the name of the network
	NameNetwork = "NetworkName"
	// NameKeyPair is the key for the name of the EC2 key pair resource
	NameKeyPair = "KeyPair"
	// NameSecGroup is the name of the security group
	NameSecGroup = "SecurityGroupName"

	// RouterIP is the key for the router IP address
	RouterIP = "RouterIP"

	// ObjectSecGroup is the key for the cached security group
	ObjectSecGroup = "SecurityGroup"

	// MarkerMigratedFromTerraform is the key for marking the state for successful state migration from Terraformer
	MarkerMigratedFromTerraform = "MigratedFromTerraform"
	// MarkerTerraformCleanedUp is the key for marking the state for successful cleanup of Terraformer resources.
	MarkerTerraformCleanedUp = "TerraformCleanedUp"
)
View Source
const (
	// PersistentStateVersion is the current version used for persisting the state.
	PersistentStateVersion = "v1alpha1"
	// PersistentStateAPIVersion is the APIVersion used for the persistent state
	PersistentStateAPIVersion = openstack.GroupName + "/" + PersistentStateVersion
	// PersistentStateKind is the kind name for the persistent state
	PersistentStateKind = "FlowState"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FlowContext

type FlowContext struct {
	shared.BasicFlowContext
	// contains filtered or unexported fields
}

FlowContext contains the logic to reconcile or delete the AWS infrastructure.

func NewFlowContext

func NewFlowContext(log logr.Logger, clientFactory osclient.Factory,
	infra *extensionsv1alpha1.Infrastructure, config *openstackapi.InfrastructureConfig,
	cloudProfileConfig *openstackapi.CloudProfileConfig,
	oldState shared.FlatMap, persistor shared.FlowStatePersistor) (*FlowContext, error)

NewFlowContext creates a new FlowContext object

func (*FlowContext) Delete

func (c *FlowContext) Delete(ctx context.Context) error

Delete creates and runs the flow to delete the AWS infrastructure.

func (*FlowContext) GetInfrastructureConfig

func (c *FlowContext) GetInfrastructureConfig() *openstackapi.InfrastructureConfig

GetInfrastructureConfig returns the InfrastructureConfig object

func (*FlowContext) Reconcile

func (c *FlowContext) Reconcile(ctx context.Context) error

Reconcile creates and runs the flow to reconcile the AWS infrastructure.

type PersistentState

type PersistentState struct {
	metav1.TypeMeta

	Data map[string]string `json:"data"`
}

PersistentState is the state which is persisted as part of the infrastructure status.

func NewPersistentState

func NewPersistentState() *PersistentState

NewPersistentState creates empty PersistentState

func NewPersistentStateFromFlatMap

func NewPersistentStateFromFlatMap(flatState shared.FlatMap) *PersistentState

NewPersistentStateFromFlatMap create new PersistentState and initialises data from input.

func NewPersistentStateFromJSON

func NewPersistentStateFromJSON(raw []byte) (*PersistentState, error)

NewPersistentStateFromJSON unmarshals PersistentState from JSON or YAML. Returns nil if input contains no kind field with value "FlowState".

func (*PersistentState) HasValidVersion

func (s *PersistentState) HasValidVersion() (valid bool, err error)

HasValidVersion checks if flow version is supported.

func (*PersistentState) MigratedFromTerraform

func (s *PersistentState) MigratedFromTerraform() bool

MigratedFromTerraform returns trus if marker MarkerMigratedFromTerraform is set.

func (*PersistentState) SetMigratedFromTerraform

func (s *PersistentState) SetMigratedFromTerraform()

SetMigratedFromTerraform sets the marker MarkerMigratedFromTerraform

func (*PersistentState) SetTerraformCleanedUp

func (s *PersistentState) SetTerraformCleanedUp()

SetTerraformCleanedUp sets the marker MarkerTerraformCleanedUp

func (*PersistentState) TerraformCleanedUp

func (s *PersistentState) TerraformCleanedUp() bool

TerraformCleanedUp returns trus if marker MarkerTerraformCleanedUp is set.

func (*PersistentState) ToFlatMap

func (s *PersistentState) ToFlatMap() shared.FlatMap

ToFlatMap returns a copy of state as FlatMap

func (*PersistentState) ToJSON

func (s *PersistentState) ToJSON() ([]byte, error)

ToJSON marshals state as JSON

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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