Open audunsolemdal opened 1 year ago
The context
field of the status is constructed from the involved object and the UID of the provider (.metadata.uid
of each Provider object) to make it unique across clusters but I reckon you might want something more easily trackable to the cluster the status came from.
The commit status API accepts the parameters state
, description
, context
and target_url
. The first three are already used by Flux but maybe we can make the context
configurable to include an additional field derived from Alert.spec.Summary
(which ends up in the event metadata).
I'll be happy with any solution that doesn't involve renaming my kustomizations per cluster. I also tried setting
eventMetadata:
context: ${cluster}
to no avail, my understanding is that certain fields as context cannot be overridden https://github.com/fluxcd/notification-controller/pull/529/files#diff-9c161f071659a6d134b4cfdd27ad66fc88d93b5dfb102d7bb5a768b9e9e483eaR81 as you mentioned they are used by flux already.
Looks like this PR described the same use case https://github.com/fluxcd/notification-controller/pull/340
Looks like this PR described the same use case #340
I don't think a new field is necessary here as we can rather fetch the needed information from the Alert object's .spec.summary
field as suggested here.
maybe we can make the context configurable to include an additional
@makkes maybe we should include it in the description
field instead?
maybe we can make the context configurable to include an additional
@makkes maybe we should include it in the
description
field instead?
Would be fine from my perspective.
@makkes : Please assign this issue to me. I can work on it.
is there any workaround to achieve this?
I see that ut uses uid of the provider in commit status like this:
kustomization/tf-controller/25c8a95e
is it possible to set or override generated uid 25c8a95e
?
I see that ut uses uid of the provider in commit status like this:
kustomization/tf-controller/25c8a95e is it possible to set or override generated uid
25c8a95e
?
No.
@makkes So basicalliy there is no way to have some additional data like cluster name in commit check except setting it in Kustomization(or another resource) name, right?
@makkes So basicalliy there is no way to have some additional data like cluster name in commit check except setting it in Kustomization(or another resource) name, right?
https://github.com/fluxcd/notification-controller/issues/589#issuecomment-1659806646
@makkes the summary field is human-readable text, not an identifier. For this issue, it would be preferable to to change the context value of the github status to make it predictable for each cluster so that other CI steps can wait on the status to be set.
So my goal is to run a github action step to check if fluxcd reconciliation for a kustomization towards a specificcluster was successful. There are three different kustomizations in three different clusters which may post
reconcilation successful
status to my commit on github. The kustomizations have the same exact name It does not seem like modifying theeventMetadata
orsummary
fields in the Alert resource adds any extra metadata to the github status.I guess a workaround is to name the kustomizations
tstsp1-github-info-${cluster}
rather than justtstsp1-github-info
, but I am wondering if there are other methods to inject this metadata into the Github status? Thedescription
orcontext
fields would be sufficient to modify in my use case.Say I have a repo with the following structure
orgX/wl-tstsp1:
Each folder is connected to the namespace called
tstsp1
in three different cluster (dev/test/prod) From each of the clusters there is a alert updating the github statusI end up with a status looking somewhat like the below: