Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apis/event/v1beta1/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ func (in *Event) HasMetadata(key string, val string) bool {
return false
}

// GetRevision looks up for the MetaOriginRevisionKey and MetaRevisionKey
// keys in the Metadata and returns the first it finds.
// GetRevision looks up for the keys in Metadata that may contain
// the revision of the object that this event is about.
func (in *Event) GetRevision() (string, bool) {
if r, ok := in.Metadata[MetaCommitKey]; ok {
return r, true
}
if r, ok := in.Metadata[MetaOriginRevisionKey]; ok {
return r, true
}
Expand Down
2 changes: 2 additions & 0 deletions apis/event/v1beta1/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const (
// base64-encoded set of configurations. This is useful for example for
// rate limiting the events.
MetaTokenKey string = "token"
// MetaCommitKey is the key used to hold the Git commit hash.
MetaCommitKey string = "commit"
// MetaCommitStatusKey is the key used to signal a Git commit status event.
MetaCommitStatusKey string = "commit_status"
// MetaCommitStatusUpdateValue is the value of MetaCommitStatusKey
Expand Down
2 changes: 1 addition & 1 deletion runtime/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6
github.com/fluxcd/cli-utils v0.37.1-flux.1
github.com/fluxcd/pkg/apis/acl v0.9.0
github.com/fluxcd/pkg/apis/event v0.23.0
github.com/fluxcd/pkg/apis/event v0.24.0
github.com/fluxcd/pkg/apis/kustomize v1.15.0
github.com/fluxcd/pkg/apis/meta v1.25.0
github.com/go-logr/logr v1.4.3
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/fluxcd/pkg/auth v0.36.0
github.com/fluxcd/pkg/cache v0.13.0
github.com/fluxcd/pkg/git v0.42.0
github.com/fluxcd/pkg/runtime v0.98.0
github.com/fluxcd/pkg/runtime v0.99.0
github.com/fluxcd/test-infra/tftestenv v0.0.0-20250626232827-e0ca9c3f8d7b
github.com/go-git/go-git/v5 v5.16.4
github.com/google/go-containerregistry v0.20.7
Expand Down
Loading