Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
change variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen committed Jun 27, 2019
1 parent b433f80 commit 2408507
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions actuators/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ func (m *Machine) Exists(ctx context.Context, cluster *clusterv1.Cluster, machin
}

// patches the object and saves the status.
func (m *Machine) save(old, new *clusterv1.Machine, noderef *apicorev1.ObjectReference) error {
func (m *Machine) save(oldMachine, newMachine *clusterv1.Machine, noderef *apicorev1.ObjectReference) error {
fmt.Println("updating machine")
p, err := patch.NewJSONPatch(old, new)
p, err := patch.NewJSONPatch(oldMachine, newMachine)
if err != nil {
fmt.Printf("%+v\n", err)
return err
Expand All @@ -221,16 +221,16 @@ func (m *Machine) save(old, new *clusterv1.Machine, noderef *apicorev1.ObjectRef
fmt.Printf("%+v\n", err)
return err
}
new, err = m.ClusterAPI.Machines(old.Namespace).Patch(new.Name, types.JSONPatchType, pb)
newMachine, err = m.ClusterAPI.Machines(oldMachine.Namespace).Patch(newMachine.Name, types.JSONPatchType, pb)
if err != nil {
fmt.Printf("%+v\n", err)
return err
}
fmt.Println("updated machine")
}
// set the noderef after so we don't try and patch it in during the first update
new.Status.NodeRef = noderef
if _, err := m.ClusterAPI.Machines(old.Namespace).UpdateStatus(new); err != nil {
newMachine.Status.NodeRef = noderef
if _, err := m.ClusterAPI.Machines(oldMachine.Namespace).UpdateStatus(newMachine); err != nil {
fmt.Printf("%+v\n", err)
return err
}
Expand Down

0 comments on commit 2408507

Please sign in to comment.