Skip to content

Commit

Permalink
Add noop for stream and consumer (#112)
Browse files Browse the repository at this point in the history
Signed-off-by: Jarema <[email protected]>
  • Loading branch information
Jarema authored Feb 21, 2023
1 parent 5f28a9d commit f9408bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion controllers/jetstream/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ func (c *Controller) processConsumerObject(cns *apis.Consumer, jsmc jsmClient) (
return err
}
default:
c.warningEvent(cns, "Noop", fmt.Sprintf("Nothing done for consumer %q", spec.DurableName))
c.normalEvent(cns, "Noop", fmt.Sprintf("Nothing done for consumer %q (prevent-delete=%v, prevent-update=%v)",
spec.DurableName, spec.PreventDelete, spec.PreventUpdate,
))
if _, err := setConsumerOK(c.ctx, cns, ifc); err != nil {
return err
}
}

return nil
Expand Down
8 changes: 7 additions & 1 deletion controllers/jetstream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,13 @@ func (c *Controller) processStreamObject(str *apis.Stream, jsmc jsmClient) (err
return err
}
default:
c.warningEvent(str, "Noop", fmt.Sprintf("Nothing done for stream %q", spec.Name))
c.normalEvent(str, "Noop", fmt.Sprintf("Nothing done for stream %q (prevent-delete=%v, prevent-update=%v)",
spec.Name, spec.PreventDelete, spec.PreventUpdate,
))
// Noop events only update the status of the CRD.
if _, err := setStreamOK(c.ctx, str, ifc); err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit f9408bd

Please sign in to comment.