Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaizel committed Jan 10, 2025
1 parent 41c98a9 commit 733d8db
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions event_reporter/reporter/resource_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ var allowedResourceTypes = map[ResourceTypeKey]bool{
{Group: "argoproj.io", Kind: "ClusterWorkflowTemplate"}: true,

// Argo Events resources
{Group: "argoproj.io", Kind: "Sensor"}: true,
{Group: "argoproj.io", Kind: "Sensor"}: true,
{Group: "argoproj.io", Kind: "EventSource"}: true,

// Codefresh resources
{Group: "codefresh.io", Kind: "Product"}: true,
{Group: "codefresh.io", Kind: "PromotionFlow"}: true,
{Group: "codefresh.io", Kind: "PromotionPolicy"}: true,
{Group: "codefresh.io", Kind: "PromotionTemplate"}: true,
{Group: "codefresh.io", Kind: "RestrictedGitSource"}: true,

// Bitnami resources
{Group: "bitnami.com", Kind: "SealedSecret"}: true,
}

const (
CODEFRESH_IO_ENTITY = "codefresh_io_entity"
GIT_PAT_OBTAINER_NAME = "git-pat-obtainer-name"
CODEFRESH_CM_NAME = "codefresh-cm"
CODEFRESH_IO_ENTITY = "codefresh_io_entity"
CODEFRESH_CM_NAME = "codefresh-cm"
)

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

// Check for the git-pat-obtainer label
// Check for the codefresh_io_entity label
labels := u.GetLabels()
return labels != nil && labels[CODEFRESH_IO_ENTITY] == GIT_PAT_OBTAINER_NAME
_, hasCodefreshEntityLabel := labels[CODEFRESH_IO_ENTITY]
return labels != nil && hasCodefreshEntityLabel
}

0 comments on commit 733d8db

Please sign in to comment.