Skip to content

Commit

Permalink
clarify errors/comments
Browse files Browse the repository at this point in the history
Signed-off-by: Chuck Ha <[email protected]>
  • Loading branch information
chuckha committed Apr 19, 2019
1 parent e9ecb28 commit 0e2907e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/cloud/aws/actuators/machine_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ func (m *MachineScope) Close() {
m.V(6).Info("Machine status before update", "machine-status", m.Machine.Status)
latest, err := m.MachineClient.Update(m.Machine)
if err != nil {
m.Error(err, "error updating machine")
m.V(3).Info("Machine resource version is out of date")
// Fetch and update the latest resource version
newestMachine, err2 := m.MachineClient.Get(m.Machine.Name, metav1.GetOptions{})
if err2 != nil {
m.Error(err2, "failed to fetch latest Machine")
return err2
}
// Error if anything but the machine resource version changes
m.Machine.ResourceVersion = newestMachine.ResourceVersion
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/aws/actuators/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ func (s *Scope) Close() {
s.V(6).Info("Cluster status before update", "cluster-status", s.Cluster.Status)
latest, err := s.ClusterClient.Update(s.Cluster)
if err != nil {
s.Error(err, "error updating cluster")
s.V(3).Info("Cluster resource version is out of date")
// Fetch and update the latest resource version
newestCluster, err2 := s.ClusterClient.Get(s.Cluster.Name, metav1.GetOptions{})
if err2 != nil {
s.Error(err2, "failed to fetch latest cluster")
return err2
}
// Error if anything but the cluster resource version changes
s.Cluster.ResourceVersion = newestCluster.ResourceVersion
return err
}
Expand Down

0 comments on commit 0e2907e

Please sign in to comment.