Skip to content

Commit

Permalink
more code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ishustava committed Aug 9, 2022
1 parent 1ac9b0b commit 599ecf7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions control-plane/connect-inject/peering_acceptor_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ func shouldGenerateToken(acceptor *consulv1alpha1.PeeringAcceptor, existingSecre
func (r *PeeringAcceptorController) updateStatus(ctx context.Context, acceptorObjKey types.NamespacedName) error {
// Get the latest resource before we update it.
acceptor := &consulv1alpha1.PeeringAcceptor{}
err := r.Client.Get(ctx, acceptorObjKey, acceptor)
if err != nil {
if err := r.Client.Get(ctx, acceptorObjKey, acceptor); err != nil {
return fmt.Errorf("error fetching acceptor resource before status update: %w", err)
}
acceptor.Status.SecretRef = &consulv1alpha1.SecretRefStatus{
Expand All @@ -261,7 +260,7 @@ func (r *PeeringAcceptorController) updateStatus(ctx context.Context, acceptorOb
acceptor.Status.LatestPeeringVersion = pointerToUint64(peeringVersion)
}
}
err = r.Status().Update(ctx, acceptor)
err := r.Status().Update(ctx, acceptor)
if err != nil {
r.Log.Error(err, "failed to update PeeringAcceptor status", "name", acceptor.Name, "namespace", acceptor.Namespace)
}
Expand Down

0 comments on commit 599ecf7

Please sign in to comment.