terraform: InstanceState.DeepCopy is exported

This commit is contained in:
Mitchell Hashimoto 2016-04-26 12:22:09 -07:00
parent 1040cb7cdb
commit 45c3fd58d8
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 7 additions and 7 deletions

View File

@ -1068,7 +1068,7 @@ func (r *ResourceState) deepcopy() *ResourceState {
n := &ResourceState{
Type: r.Type,
Dependencies: nil,
Primary: r.Primary.deepcopy(),
Primary: r.Primary.DeepCopy(),
Tainted: nil,
Provider: r.Provider,
}
@ -1079,13 +1079,13 @@ func (r *ResourceState) deepcopy() *ResourceState {
if r.Tainted != nil {
n.Tainted = make([]*InstanceState, 0, len(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 {
n.Deposed = make([]*InstanceState, 0, len(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()
}
func (i *InstanceState) deepcopy() *InstanceState {
func (i *InstanceState) DeepCopy() *InstanceState {
if i == nil {
return nil
}
n := &InstanceState{
ID: i.ID,
Ephemeral: *i.Ephemeral.deepcopy(),
Ephemeral: *i.Ephemeral.DeepCopy(),
}
if i.Attributes != nil {
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
// computeID.
func (s *InstanceState) MergeDiff(d *InstanceDiff) *InstanceState {
result := s.deepcopy()
result := s.DeepCopy()
if result == nil {
result = new(InstanceState)
}
@ -1329,7 +1329,7 @@ func (e *EphemeralState) init() {
}
}
func (e *EphemeralState) deepcopy() *EphemeralState {
func (e *EphemeralState) DeepCopy() *EphemeralState {
if e == nil {
return nil
}