remove occurrences of AbsMovable

This commit is contained in:
Katy Moe 2021-11-15 10:46:06 +00:00
parent 1dabdf0dcd
commit 4305271cff
No known key found for this signature in database
GPG Key ID: 8C3780F6DCDDA885
5 changed files with 12 additions and 12 deletions

View File

@ -19,7 +19,7 @@ import (
// prompt creating a different plan than Terraform would by default. // prompt creating a different plan than Terraform would by default.
// //
// To obtain a full address from a MoveEndpoint you must use // To obtain a full address from a MoveEndpoint you must use
// either the package function UnifyMoveEndpoints (to get an AbsMovable) or // either the package function UnifyMoveEndpoints (to get an AbsMoveable) or
// the method ConfigMoveable (to get a ConfigMoveable). // the method ConfigMoveable (to get a ConfigMoveable).
type MoveEndpoint struct { type MoveEndpoint struct {
// SourceRange is the location of the physical endpoint address // SourceRange is the location of the physical endpoint address
@ -27,15 +27,15 @@ type MoveEndpoint struct {
// configuration expresson. // configuration expresson.
SourceRange tfdiags.SourceRange SourceRange tfdiags.SourceRange
// Internally we (ab)use AbsMovable as the representation of our // Internally we (ab)use AbsMoveable as the representation of our
// relative address, even though everywhere else in Terraform // relative address, even though everywhere else in Terraform
// AbsMovable always represents a fully-absolute address. // AbsMoveable always represents a fully-absolute address.
// In practice, due to the implementation of ParseMoveEndpoint, // In practice, due to the implementation of ParseMoveEndpoint,
// this is always either a ModuleInstance or an AbsResourceInstance, // this is always either a ModuleInstance or an AbsResourceInstance,
// and we only consider the possibility of interpreting it as // and we only consider the possibility of interpreting it as
// a AbsModuleCall or an AbsResource in UnifyMoveEndpoints. // a AbsModuleCall or an AbsResource in UnifyMoveEndpoints.
// This is intentionally unexported to encapsulate this unusual // This is intentionally unexported to encapsulate this unusual
// meaning of AbsMovable. // meaning of AbsMoveable.
relSubject AbsMoveable relSubject AbsMoveable
} }
@ -44,7 +44,7 @@ func (e *MoveEndpoint) ObjectKind() MoveEndpointKind {
} }
func (e *MoveEndpoint) String() string { func (e *MoveEndpoint) String() string {
// Our internal pseudo-AbsMovable representing the relative // Our internal pseudo-AbsMoveable representing the relative
// address (either ModuleInstance or AbsResourceInstance) is // address (either ModuleInstance or AbsResourceInstance) is
// a good enough proxy for the relative move endpoint address // a good enough proxy for the relative move endpoint address
// serialization. // serialization.

View File

@ -131,7 +131,7 @@ func (e *MoveEndpointInModule) Module() Module {
return e.module return e.module
} }
// InModuleInstance returns an AbsMovable address which concatenates the // InModuleInstance returns an AbsMoveable address which concatenates the
// given module instance address with the receiver's relative object selection // given module instance address with the receiver's relative object selection
// to produce one example of an instance that might be affected by this // to produce one example of an instance that might be affected by this
// move statement. // move statement.

View File

@ -12,7 +12,7 @@ import (
func TestParseMoveEndpoint(t *testing.T) { func TestParseMoveEndpoint(t *testing.T) {
tests := []struct { tests := []struct {
Input string Input string
WantRel AbsMoveable // funny intermediate subset of AbsMovable WantRel AbsMoveable // funny intermediate subset of AbsMoveable
WantErr string WantErr string
}{ }{
{ {

View File

@ -5,7 +5,7 @@ package addrs
// with any other similar cross-module state refactoring statements we might // with any other similar cross-module state refactoring statements we might
// allow. // allow.
// //
// Note that AbsMovable represents an absolute address relative to the root // Note that AbsMoveable represents an absolute address relative to the root
// of the configuration, which is different than the direct representation // of the configuration, which is different than the direct representation
// of these in configuration where the author gives an address relative to // of these in configuration where the author gives an address relative to
// the current module where the address is defined. The type MoveEndpoint // the current module where the address is defined. The type MoveEndpoint
@ -16,7 +16,7 @@ type AbsMoveable interface {
String() string String() string
} }
// The following are all of the possible AbsMovable address types: // The following are all of the possible AbsMoveable address types:
var ( var (
_ AbsMoveable = AbsResource{} _ AbsMoveable = AbsResource{}
_ AbsMoveable = AbsResourceInstance{} _ AbsMoveable = AbsResourceInstance{}

View File

@ -110,7 +110,7 @@ func ValidateMoves(stmts []MoveStatement, rootCfg *configs.Config, declaredInsts
shortNoun = "resource" shortNoun = "resource"
default: default:
// The above cases should cover all of the AbsMoveable types // The above cases should cover all of the AbsMoveable types
panic("unsupported AbsMovable address type") panic("unsupported AbsMoveable address type")
} }
// It's invalid to have a move statement whose "from" address // It's invalid to have a move statement whose "from" address
@ -234,7 +234,7 @@ func moveableObjectExists(addr addrs.AbsMoveable, in instances.Set) bool {
return in.HasResource(addr) return in.HasResource(addr)
default: default:
// The above cases should cover all of the AbsMoveable types // The above cases should cover all of the AbsMoveable types
panic("unsupported AbsMovable address type") panic("unsupported AbsMoveable address type")
} }
} }
@ -309,7 +309,7 @@ func movableObjectDeclRange(addr addrs.AbsMoveable, cfg *configs.Config) (tfdiag
return tfdiags.SourceRangeFromHCL(rc.DeclRange), true return tfdiags.SourceRangeFromHCL(rc.DeclRange), true
default: default:
// The above cases should cover all of the AbsMoveable types // The above cases should cover all of the AbsMoveable types
panic("unsupported AbsMovable address type") panic("unsupported AbsMoveable address type")
} }
} }