diff --git a/artifacts/flagger/crd.yaml b/artifacts/flagger/crd.yaml index b0e148ad..404c2578 100644 --- a/artifacts/flagger/crd.yaml +++ b/artifacts/flagger/crd.yaml @@ -79,6 +79,9 @@ spec: - service - analysis properties: + summary: + description: Optional msg to add to each notification + type: string provider: description: Traffic managent provider type: string diff --git a/pkg/apis/flagger/v1beta1/canary.go b/pkg/apis/flagger/v1beta1/canary.go index 0e6c533c..ab268b67 100644 --- a/pkg/apis/flagger/v1beta1/canary.go +++ b/pkg/apis/flagger/v1beta1/canary.go @@ -103,6 +103,10 @@ type CanarySpec struct { // revert canary mutation on deletion of canary resource // +optional RevertOnDeletion bool `json:"revertOnDeletion,omitempty"` + + // Summary creates new notification message + // +optional + Summary string `json:"summary,omitempty"` } // CanaryService defines how ClusterIP services, service mesh or ingress routing objects are generated diff --git a/pkg/controller/events.go b/pkg/controller/events.go index c70123e6..8b49f3f7 100644 --- a/pkg/controller/events.go +++ b/pkg/controller/events.go @@ -175,6 +175,16 @@ func (c *Controller) alert(canary *flaggerv1.Canary, message string, metadata bo func alertMetadata(canary *flaggerv1.Canary) []notifier.Field { var fields []notifier.Field + + if canary.Spec.Summary != "" { + fields = append(fields, + notifier.Field{ + Name: "Summary", + Value: canary.Spec.Summary, + }, + ) + } + fields = append(fields, notifier.Field{ Name: "Target",