flagger icon indicating copy to clipboard operation
flagger copied to clipboard

webhook metada: allow any structure

Open ldemailly opened this issue 3 years ago • 4 comments

Describe the feature

We have a webhook for flagger that needs to send multiple headers, the target system accepts these through metadata

e.g.

metadata:
   url:  services-canary.ns...
   headers:
      - H1:V1
      - H2:V2
      - ...
   qps: 50

but we get

Canary.flagger.app "svcname" is invalid: spec.analysis.webhooks.metadata.headers: 
Invalid value: "array": spec.analysis.webhooks.metadata.headers in body must be of type string: "array"

Proposed solution

change map[string]string to map[string]interface{}

Any alternatives you've considered?

We could I suppose use header_1, header_2 ... but that's... not great

ldemailly avatar Mar 03 '23 19:03 ldemailly

an alternative to any struct would be I guess slice of pairs instead of a map to allow for duplicate keys

ldemailly avatar Mar 04 '23 16:03 ldemailly

thoughts ?

ldemailly avatar May 03 '23 04:05 ldemailly

its not possible to have map[string]interface{} since its not possible to use types that are json serializable

aryan9600 avatar May 03 '23 06:05 aryan9600

is it possible to send extra information from pod spec in the metadata in the webhook call, like spec.containers[0].image ?

ffoysal avatar Nov 14 '23 21:11 ffoysal