Skip to content

Commit

Permalink
Add review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bjee19 committed Sep 27, 2023
1 parent c304fa2 commit 1149c6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
6 changes: 0 additions & 6 deletions internal/framework/status/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ func NewRetryUpdateFunc(
// apierrors.IsNotFound(err) can happen when the resource is deleted,
// so no need to retry or return an error.
if apierrors.IsNotFound(err) {
logger.V(1).Info(
"Resource was not found when trying to update status",
"error", err,
"namespace", nsname.Namespace,
"name", nsname.Name,
"kind", obj.GetObjectKind().GroupVersionKind().Kind)
return true, nil
}
logger.V(1).Info(
Expand Down
11 changes: 4 additions & 7 deletions internal/framework/status/updater_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ func TestNewRetryUpdateFunc(t *testing.T) {
expConditionPassed: true,
},
}

fakeStatusUpdater := &statusfakes.FakeK8sUpdater{}
fakeGetter := &controllerfakes.FakeGetter{}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
g := NewWithT(t)
fakeStatusUpdater := &statusfakes.FakeK8sUpdater{}
fakeGetter := &controllerfakes.FakeGetter{}
fakeStatusUpdater.UpdateReturns(test.updateReturns)
fakeGetter.GetReturns(test.getReturns)
f := status.NewRetryUpdateFunc(
Expand All @@ -68,11 +69,7 @@ func TestNewRetryUpdateFunc(t *testing.T) {

// For now, the function should always return nil
g.Expect(err).ToNot(HaveOccurred())
if test.expConditionPassed {
g.Expect(conditionPassed).To(BeTrue())
} else {
g.Expect(conditionPassed).To(BeFalse())
}
g.Expect(conditionPassed).To(Equal(test.expConditionPassed))
})
}
}

0 comments on commit 1149c6f

Please sign in to comment.