webhook metada: allow any structure
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
an alternative to any struct would be I guess slice of pairs instead of a map to allow for duplicate keys
thoughts ?
its not possible to have map[string]interface{} since its not possible to use types that are json serializable
is it possible to send extra information from pod spec in the metadata in the webhook call, like spec.containers[0].image ?