Description
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 the eventMetadata
or summary
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 just tstsp1-github-info
, but I am wondering if there are other methods to inject this metadata into the Github status? The description
or context
fields would be sufficient to modify in my use case.
Say I have a repo with the following structure
orgX/wl-tstsp1:
fluxcd/
dev/
deployment.yaml
test/
deployment.yaml
prod/
deployment.yaml
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 status
---
apiVersion: notification.toolkit.fluxcd.io/v1beta2
kind: Provider
metadata:
name: tstsp1-github
namespace: flux-system
spec:
type: github
address: https://github.com/orgX/wl-tstsp1
secretRef:
name: gh-flux-pat
---
apiVersion: notification.toolkit.fluxcd.io/v1beta2
kind: Alert
metadata:
name: "tstsp1-github-info"
namespace: flux-system
spec:
providerRef:
name: tstsp1-github
eventSeverity: info
summary: "dev01"
eventMetadata:
cluster: dev01
eventSources:
- kind: Kustomization
name: '*'
namespace: tstsp1
I end up with a status looking somewhat like the below:
gh api /repos/orgX/wl-tstsp1/statuses/88efe1eeb3e2ad9724acc6ff7c06324f6e613a66
[
{
"url": "https://api.github.com/repos/orgX/wl-tstsp1/statuses/88efe1eeb3e2ad9724acc6ff7c06324f6e613a66",
"avatar_url": "https://avatars.githubusercontent.com/u/18458716?v=4",
"id": 24342874371,
"node_id": "SC_kwDOHpAnes8AAAAFqvLJAw",
"state": "success",
"description": "reconciliation succeeded",
"target_url": null,
"context": "kustomization/tstsp1/025ecd77",
"created_at": "2023-07-31T10:38:27Z",
"updated_at": "2023-07-31T10:38:27Z",
"creator": {
...
}
}
]