Skip to content

Commit

Permalink
Revert change to getResource as we do not need generic_node
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirianni committed Sep 15, 2021
1 parent c325834 commit 1711afd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions operator/builtin/output/googlecloud/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import (
// https://cloud.google.com/logging/docs/api/v2/resource-list#resource-types

func getResource(e *entry.Entry) *mrpb.MonitoredResource {
switch detectResourceType(e) {
rt := detectResourceType(e)
if rt == "" {
return nil
}

switch rt {
case "k8s_pod":
return k8sPodResource(e)
case "k8s_container":
Expand All @@ -18,9 +23,11 @@ func getResource(e *entry.Entry) *mrpb.MonitoredResource {
return k8sNodeResource(e)
case "k8s_cluster":
return k8sClusterResource(e)
default:
case "generic_node":
return genericNodeResource(e)
}

return nil
}

func detectResourceType(e *entry.Entry) string {
Expand Down

0 comments on commit 1711afd

Please sign in to comment.