terraform: InstanceState.DeepCopy is exported
This commit is contained in:
parent
1040cb7cdb
commit
45c3fd58d8
|
@ -1068,7 +1068,7 @@ func (r *ResourceState) deepcopy() *ResourceState {
|
||||||
n := &ResourceState{
|
n := &ResourceState{
|
||||||
Type: r.Type,
|
Type: r.Type,
|
||||||
Dependencies: nil,
|
Dependencies: nil,
|
||||||
Primary: r.Primary.deepcopy(),
|
Primary: r.Primary.DeepCopy(),
|
||||||
Tainted: nil,
|
Tainted: nil,
|
||||||
Provider: r.Provider,
|
Provider: r.Provider,
|
||||||
}
|
}
|
||||||
|
@ -1079,13 +1079,13 @@ func (r *ResourceState) deepcopy() *ResourceState {
|
||||||
if r.Tainted != nil {
|
if r.Tainted != nil {
|
||||||
n.Tainted = make([]*InstanceState, 0, len(r.Tainted))
|
n.Tainted = make([]*InstanceState, 0, len(r.Tainted))
|
||||||
for _, inst := range r.Tainted {
|
for _, inst := range r.Tainted {
|
||||||
n.Tainted = append(n.Tainted, inst.deepcopy())
|
n.Tainted = append(n.Tainted, inst.DeepCopy())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.Deposed != nil {
|
if r.Deposed != nil {
|
||||||
n.Deposed = make([]*InstanceState, 0, len(r.Deposed))
|
n.Deposed = make([]*InstanceState, 0, len(r.Deposed))
|
||||||
for _, inst := range r.Deposed {
|
for _, inst := range r.Deposed {
|
||||||
n.Deposed = append(n.Deposed, inst.deepcopy())
|
n.Deposed = append(n.Deposed, inst.DeepCopy())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1168,13 +1168,13 @@ func (i *InstanceState) init() {
|
||||||
i.Ephemeral.init()
|
i.Ephemeral.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *InstanceState) deepcopy() *InstanceState {
|
func (i *InstanceState) DeepCopy() *InstanceState {
|
||||||
if i == nil {
|
if i == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
n := &InstanceState{
|
n := &InstanceState{
|
||||||
ID: i.ID,
|
ID: i.ID,
|
||||||
Ephemeral: *i.Ephemeral.deepcopy(),
|
Ephemeral: *i.Ephemeral.DeepCopy(),
|
||||||
}
|
}
|
||||||
if i.Attributes != nil {
|
if i.Attributes != nil {
|
||||||
n.Attributes = make(map[string]string, len(i.Attributes))
|
n.Attributes = make(map[string]string, len(i.Attributes))
|
||||||
|
@ -1248,7 +1248,7 @@ func (s *InstanceState) Equal(other *InstanceState) bool {
|
||||||
// won't be available until apply, the value is replaced with the
|
// won't be available until apply, the value is replaced with the
|
||||||
// computeID.
|
// computeID.
|
||||||
func (s *InstanceState) MergeDiff(d *InstanceDiff) *InstanceState {
|
func (s *InstanceState) MergeDiff(d *InstanceDiff) *InstanceState {
|
||||||
result := s.deepcopy()
|
result := s.DeepCopy()
|
||||||
if result == nil {
|
if result == nil {
|
||||||
result = new(InstanceState)
|
result = new(InstanceState)
|
||||||
}
|
}
|
||||||
|
@ -1329,7 +1329,7 @@ func (e *EphemeralState) init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *EphemeralState) deepcopy() *EphemeralState {
|
func (e *EphemeralState) DeepCopy() *EphemeralState {
|
||||||
if e == nil {
|
if e == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue