-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch name missing from commit event #580
Comments
could you share the following:
|
Turns out the change isn't part of the commit, but of the notification about the commit. apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImageUpdateAutomation
metadata:
creationTimestamp: "2023-03-15T12:29:19Z"
finalizers:
- finalizers.fluxcd.io
generation: 2
labels:
app.kubernetes.io/name: cluster
app.kubernetes.io/part-of: flux-system
kustomize.toolkit.fluxcd.io/name: flux-system
kustomize.toolkit.fluxcd.io/namespace: flux-system
name: cluster
namespace: flux-system
resourceVersion: "1541837579"
uid: 91d20642-908a-4dad-833a-a014cd8adbdf
spec:
git:
checkout:
ref:
branch: master
commit:
author:
email: [email protected]
name: Flux
messageTemplate: |
Image Update Automation:{{ range $images := .Updated.Images }} {{ $images }}{{ end }}
---
automation: {{ .AutomationObject }}
files:
{{- range $file, $fileresult := .Updated.Files }}
-
filename: {{ $file }}
objects:
{{- range $object, $imagerefs := $fileresult.Objects }}
-
apiVersion: {{ $object.APIVersion }}
kind: {{ $object.Kind }}
name: {{ $object.Name }}
namespace: {{ $object.Namespace }}
images:
{{- range $imageref := $imagerefs }}
-
shortName: {{ $imageref }}
fullName: {{ $imageref.Name }}
registry: {{ $imageref.Registry }}
repository: {{ $imageref.Repository }}
identifier: {{ $imageref.Identifier }}
policy: {{ $imageref.Policy }}
{{- end -}}
{{- end -}}
{{- end }}
...
push:
branch: master
interval: 1h
sourceRef:
kind: GitRepository
name: rec-cluster
update:
path: ./flux/clusters/production
strategy: Setters
status:
conditions:
- lastTransitionTime: "2023-09-01T11:42:09Z"
message: no updates made; last commit e86ee0b at 2023-09-01T11:41:59Z
reason: ReconciliationSucceeded
status: "True"
type: Ready
lastAutomationRunTime: "2023-09-01T14:33:28Z"
lastPushCommit: e86ee0b5de5b59dafa4a2abf59bf91f5e51973ad
lastPushTime: "2023-09-01T11:41:59Z"
observedGeneration: 2 Old notification payload:
Current notification payload:
|
@tun0 where you using Flux 2.0 and this broken when upgrading to 2.1? |
Yeah. |
Ok we'll fix the missing branch name, thanks for reporting. |
@tun0 please open a new issue for adding branch/commit to the template args, we'll track this issue as a bug. |
We'll not be able to add the commit to the template, as the template is used for the commit message. |
Good point, hadn't thought of that. Perhaps an option would be decoupling the commit message template and the notification template? But, I'll create a separate ticket for those wishes👍 |
68ad71b broke our tooling in 2 ways:
Ideally commit hash and branch name (and possibly other information as well) would be available as variables to use in the template, so we have full control of their output and we always know where to find it.
The text was updated successfully, but these errors were encountered: