Documentation ¶
Index ¶
- Constants
- type FlowContext
- type PersistentState
- func (s *PersistentState) HasValidVersion() (valid bool, err error)
- func (s *PersistentState) MigratedFromTerraform() bool
- func (s *PersistentState) SetMigratedFromTerraform()
- func (s *PersistentState) SetTerraformCleanedUp()
- func (s *PersistentState) TerraformCleanedUp() bool
- func (s *PersistentState) ToFlatMap() shared.FlatMap
- func (s *PersistentState) ToJSON() ([]byte, error)
Constants ¶
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" )
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 ¶
func NewFlowContext(log logr.Logger, credentials *alicloud.Credentials, infra *extensionsv1alpha1.Infrastructure, config *aliapi.InfrastructureConfig, oldState shared.FlatMap, persistor shared.FlowStatePersistor, cluster *extensioncontroller.Cluster) (*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 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
type PersistentState ¶
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