Skip to content

Commit

Permalink
Added safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
alok87 committed Mar 19, 2021
1 parent 44680f1 commit b06fa03
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions controllers/redshiftsink_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,17 @@ func (r *RedshiftSinkReconciler) reconcile(
status.info()
defer status.updateMaskStatus()

// Safety checks
if currentMaskVersion == desiredMaskVersion {
if len(status.reloading) > 0 && len(status.diffTopics) == 0 {
klog.Fatalf("rsk/%s unexpected status, no diff but reloading", rsk.Name)
}

if len(status.released) == 0 {
klog.Fatalf("rsk/%s unexpected status, released=0", rsk.Name)
}
}

// SinkGroup are of following types:
// 1. main: sink group which has desiredMaskVersion
// and has topics which have been released
Expand Down

0 comments on commit b06fa03

Please sign in to comment.