Skip to content

Commit

Permalink
fix: git integration cm reporting (#374)
Browse files Browse the repository at this point in the history
* fix: git integration cm reporting

* Update changelog

---------

Co-authored-by: Oleksandr Saulyak <[email protected]>
  • Loading branch information
dmaizel and oleksandr-codefresh authored Jan 16, 2025
1 parent 715a1ad commit 39ce1d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
### Features
- feat(event-reporter): using sources-server for getting application version
- feat(event-reporter): allow git integration ConfigMap reporting
16 changes: 11 additions & 5 deletions event_reporter/reporter/resource_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ var allowedResourceTypes = map[ResourceTypeKey]bool{
}

const (
CODEFRESH_IO_ENTITY = "codefresh_io_entity"
CODEFRESH_CM_NAME = "codefresh-cm"
CODEFRESH_IO_ENTITY = "codefresh.io/entity"
CODEFRESH_IO_ENTITY_ALT = "codefresh_io_entity"
CODEFRESH_CM_NAME = "codefresh-cm"
)

func isAllowedResource(rs appv1.ResourceStatus) bool {
Expand All @@ -77,8 +78,13 @@ func isAllowedConfigMap(manifest string) bool {
return true
}

// Check for the codefresh_io_entity label
// Check for both possible Codefresh entity label formats
labels := u.GetLabels()
_, hasCodefreshEntityLabel := labels[CODEFRESH_IO_ENTITY]
return labels != nil && hasCodefreshEntityLabel
if labels == nil {
return false
}

_, hasUnderscoreLabel := labels[CODEFRESH_IO_ENTITY]
_, hasDotLabel := labels[CODEFRESH_IO_ENTITY_ALT]
return hasUnderscoreLabel || hasDotLabel
}

0 comments on commit 39ce1d3

Please sign in to comment.