Skip to content

Commit

Permalink
feat: emit rollout delete event (#1893)
Browse files Browse the repository at this point in the history
Signed-off-by: Hui Kang <[email protected]>

Co-authored-by: Hui Kang <[email protected]>
  • Loading branch information
huikang and Hui Kang authored Jul 27, 2022
1 parent 9c87d0d commit 0b022ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions rollout/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func NewController(cfg ControllerConfig) *Controller {
for _, key := range istioutil.GetRolloutDesinationRuleKeys(ro) {
controller.IstioController.EnqueueDestinationRule(key)
}
controller.recorder.Eventf(ro, record.EventOptions{EventReason: conditions.RolloutDeletedReason}, conditions.RolloutDeletedMessage, ro.Name, ro.Namespace)
}
},
})
Expand Down
3 changes: 3 additions & 0 deletions utils/conditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ const (
// within the given deadline (progressDeadlineSeconds).
RolloutTimeOutMessage = "Rollout %q has timed out progressing."

RolloutDeletedReason = "RolloutDeleted"
RolloutDeletedMessage = "Rollout %s/%s is deleted."

ScalingReplicaSetReason = "ScalingReplicaSet"
ScalingReplicaSetMessage = "Scaled %s ReplicaSet %s (revision %d) from %d to %d"

Expand Down

0 comments on commit 0b022ee

Please sign in to comment.