add CreateBeforeDestroy to state
Added to src and object, but still need serialization and tests.
This commit is contained in:
parent
ded207f3b8
commit
dd8ab5812e
|
@ -36,6 +36,13 @@ type ResourceInstanceObject struct {
|
|||
// altogether, or is now deposed.
|
||||
Dependencies []addrs.AbsResource
|
||||
|
||||
// CreateBeforeDestroy reflects the status of the lifecycle
|
||||
// create_before_destroy option when this instance was last updated.
|
||||
// Because create_before_destroy also effects the overall ordering of the
|
||||
// destroy operations, we need to record the status to ensure a resource
|
||||
// removed from the config will still be destroyed in the same manner.
|
||||
CreateBeforeDestroy bool
|
||||
|
||||
// DependsOn corresponds to the deprecated `depends_on` field in the state.
|
||||
// This field contained the configuration `depends_on` values, and some of
|
||||
// the references from within a single module.
|
||||
|
|
|
@ -51,9 +51,10 @@ type ResourceInstanceObjectSrc struct {
|
|||
|
||||
// These fields all correspond to the fields of the same name on
|
||||
// ResourceInstanceObject.
|
||||
Private []byte
|
||||
Status ObjectStatus
|
||||
Dependencies []addrs.AbsResource
|
||||
Private []byte
|
||||
Status ObjectStatus
|
||||
Dependencies []addrs.AbsResource
|
||||
CreateBeforeDestroy bool
|
||||
// deprecated
|
||||
DependsOn []addrs.Referenceable
|
||||
}
|
||||
|
@ -85,11 +86,12 @@ func (os *ResourceInstanceObjectSrc) Decode(ty cty.Type) (*ResourceInstanceObjec
|
|||
}
|
||||
|
||||
return &ResourceInstanceObject{
|
||||
Value: val,
|
||||
Status: os.Status,
|
||||
Dependencies: os.Dependencies,
|
||||
DependsOn: os.DependsOn,
|
||||
Private: os.Private,
|
||||
Value: val,
|
||||
Status: os.Status,
|
||||
Dependencies: os.Dependencies,
|
||||
DependsOn: os.DependsOn,
|
||||
Private: os.Private,
|
||||
CreateBeforeDestroy: os.CreateBeforeDestroy,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -166,13 +166,14 @@ func (obj *ResourceInstanceObjectSrc) DeepCopy() *ResourceInstanceObjectSrc {
|
|||
}
|
||||
|
||||
return &ResourceInstanceObjectSrc{
|
||||
Status: obj.Status,
|
||||
SchemaVersion: obj.SchemaVersion,
|
||||
Private: private,
|
||||
AttrsFlat: attrsFlat,
|
||||
AttrsJSON: attrsJSON,
|
||||
Dependencies: dependencies,
|
||||
DependsOn: dependsOn,
|
||||
Status: obj.Status,
|
||||
SchemaVersion: obj.SchemaVersion,
|
||||
Private: private,
|
||||
AttrsFlat: attrsFlat,
|
||||
AttrsJSON: attrsJSON,
|
||||
Dependencies: dependencies,
|
||||
DependsOn: dependsOn,
|
||||
CreateBeforeDestroy: obj.CreateBeforeDestroy,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue