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.
|
// altogether, or is now deposed.
|
||||||
Dependencies []addrs.AbsResource
|
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.
|
// DependsOn corresponds to the deprecated `depends_on` field in the state.
|
||||||
// This field contained the configuration `depends_on` values, and some of
|
// This field contained the configuration `depends_on` values, and some of
|
||||||
// the references from within a single module.
|
// 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
|
// These fields all correspond to the fields of the same name on
|
||||||
// ResourceInstanceObject.
|
// ResourceInstanceObject.
|
||||||
Private []byte
|
Private []byte
|
||||||
Status ObjectStatus
|
Status ObjectStatus
|
||||||
Dependencies []addrs.AbsResource
|
Dependencies []addrs.AbsResource
|
||||||
|
CreateBeforeDestroy bool
|
||||||
// deprecated
|
// deprecated
|
||||||
DependsOn []addrs.Referenceable
|
DependsOn []addrs.Referenceable
|
||||||
}
|
}
|
||||||
|
@ -85,11 +86,12 @@ func (os *ResourceInstanceObjectSrc) Decode(ty cty.Type) (*ResourceInstanceObjec
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ResourceInstanceObject{
|
return &ResourceInstanceObject{
|
||||||
Value: val,
|
Value: val,
|
||||||
Status: os.Status,
|
Status: os.Status,
|
||||||
Dependencies: os.Dependencies,
|
Dependencies: os.Dependencies,
|
||||||
DependsOn: os.DependsOn,
|
DependsOn: os.DependsOn,
|
||||||
Private: os.Private,
|
Private: os.Private,
|
||||||
|
CreateBeforeDestroy: os.CreateBeforeDestroy,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,13 +166,14 @@ func (obj *ResourceInstanceObjectSrc) DeepCopy() *ResourceInstanceObjectSrc {
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ResourceInstanceObjectSrc{
|
return &ResourceInstanceObjectSrc{
|
||||||
Status: obj.Status,
|
Status: obj.Status,
|
||||||
SchemaVersion: obj.SchemaVersion,
|
SchemaVersion: obj.SchemaVersion,
|
||||||
Private: private,
|
Private: private,
|
||||||
AttrsFlat: attrsFlat,
|
AttrsFlat: attrsFlat,
|
||||||
AttrsJSON: attrsJSON,
|
AttrsJSON: attrsJSON,
|
||||||
Dependencies: dependencies,
|
Dependencies: dependencies,
|
||||||
DependsOn: dependsOn,
|
DependsOn: dependsOn,
|
||||||
|
CreateBeforeDestroy: obj.CreateBeforeDestroy,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue