Skip to content

Commit aeac492

Browse files
committed
Swallow stale API saved status not found errors
1 parent 411bac6 commit aeac492

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

pkg/lib/aws/errors.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,20 @@ func (t ErrorKind) MarshalBinary() ([]byte, error) {
7878
return []byte(t.String()), nil
7979
}
8080

81+
func IsNotFoundErr(err error) bool {
82+
return CheckErrCode(err, "NotFound")
83+
}
84+
8185
func IsNoSuchKeyErr(err error) bool {
8286
return CheckErrCode(err, "NoSuchKey")
8387
}
8488

85-
func IsNotFoundErr(err error) bool {
86-
return CheckErrCode(err, "NotFound")
89+
func IsNoSuchBucketErr(err error) bool {
90+
return CheckErrCode(err, "NoSuchBucket")
91+
}
92+
93+
func IsGenericNotFoundErr(err error) bool {
94+
return IsNotFoundErr(err) || IsNoSuchKeyErr(err) || IsNoSuchBucketErr(err)
8795
}
8896

8997
func CheckErrCode(err error, errorCode string) bool {

pkg/operator/workloads/api_saved_status.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ func updateFinishedAPISavedStatuses(allSavedStatuses []*resource.APISavedStatus)
171171

172172
err := uploadAPISavedStatuses(staleSavedStatuses)
173173
if err != nil {
174-
return err
174+
if !aws.IsGenericNotFoundErr(err) {
175+
return err
176+
}
175177
}
176178

177179
uncacheFinishedAPISavedStatuses(allSavedStatuses)

0 commit comments

Comments
 (0)