infraflow

package
v1.52.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TagKeyName is the name tag key
	TagKeyName = "Name"
	// TagKeyClusterTemplate is the template for the cluster tag key
	TagKeyClusterTemplate = "kubernetes.io/cluster/%s"
	// TagValueCluster is the tag value for the cluster tag
	TagValueCluster = "1"

	// ChildIdZones is the child key for the zones
	ChildIdZones = "Zones"

	// IdentifierVPC is the key for the VPC id
	IdentifierVPC = "VPC"
	// IdentifierNatGatewayVSwitch is the natgateway id for the vswitch
	IdentifierNatGatewayVSwitch = "NatGatewayVSwitch"
	// IdentifierZoneVSwitch is the key for the id of vswitch
	IdentifierZoneVSwitch = "VSwitch"
	// IdentifierNatGateway is the key for the id of natgateway
	IdentifierNatGateway = "NatGateway"
	// IdentifierZoneNATGWElasticIP is the key for the id of the elastic IP resource used for the NAT gateway
	IdentifierZoneNATGWElasticIP = "NATGatewayElasticIP"
	//ZoneNATGWElasticIPAddress is the ipaddress of the elastic IP resource used for the NAT gateway
	ZoneNATGWElasticIPAddress = "NATGatewayElasticIPAddress"
	// IdentifierNodesSecurityGroup is the key for the id of the nodes security group
	IdentifierNodesSecurityGroup = "NodesSecurityGroup"

	// IdentifierZoneSuffix is the key for the suffix used for a zone
	IdentifierZoneSuffix = "Suffix"

	// 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 = alicloud.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

NewFlowContext creates a new FlowContext object

func (*FlowContext) Delete

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

Delete creates and runs the flow to reconcile the Alicloud infrastructure.

func (*FlowContext) DeleteZoneByVSwitches

func (c *FlowContext) DeleteZoneByVSwitches(ctx context.Context, toBeDeleted []*aliclient.VSwitch) error

DeleteZoneByVSwitches is called to delete zone per vswitch

func (*FlowContext) ExportState

func (c *FlowContext) ExportState() shared.FlatMap

ExportState is used to export the flatMap data

func (*FlowContext) Reconcile

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

Reconcile creates and runs the flow to reconcile the Alicloud 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
mock
Package aliclient is a generated GoMock package.
Package aliclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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