Skip to content

Commit

Permalink
automatically set service name
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Jan 9, 2025
1 parent 98b29ee commit 926ff32
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions processor/k8sattributesprocessor/internal/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,16 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
serviceNames[conventions.AttributeK8SReplicaSetName] = ref.Name
}
if c.Rules.DeploymentName {
tags[conventions.AttributeK8SDeploymentName] = c.deploymentName(ref)
name := c.deploymentName(ref)
if name != "" {
tags[conventions.AttributeK8SDeploymentName] = name
}
}
if c.Rules.OperatorRules.Enabled {
serviceNames[conventions.AttributeK8SDeploymentName] = c.deploymentName(ref)
name := c.deploymentName(ref)
if name != "" {
serviceNames[conventions.AttributeK8SDeploymentName] = name
}
}
if c.Rules.DeploymentUID {
if replicaset, ok := c.getReplicaSet(string(ref.UID)); ok {
Expand Down

0 comments on commit 926ff32

Please sign in to comment.