Skip to content

Commit 4ed5ca4

Browse files
committed
address review comments
Signed-off-by: ChrsMark <[email protected]>
1 parent f2b33f7 commit 4ed5ca4

File tree

12 files changed

+15
-14
lines changed

12 files changed

+15
-14
lines changed

.chloggen/add_k8s_pod_ip.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ change_type: enhancement
77
component: k8sattributesprocessor
88

99
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10-
note: "[processor/k8sattributes] Add support for exposing k8s.pod.ip metadata"
10+
note: "Add support for exposing k8s.pod.ip metadata"
1111

1212
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
1313
issues: [32960]

processor/k8sattributesprocessor/e2e_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ func TestE2E_MixRBAC(t *testing.T) {
727727
// While `k8s.pod.ip` is not set in `k8sattributes:extract:metadata` and the `pod_association` is not `connection`
728728
// we expect that the `k8s.pod.ip` metadata is not added.
729729
func TestE2E_NamespacedRBACNoPodIP(t *testing.T) {
730-
testDir := filepath.Join("testdata", "e2e", "namespacedrbacnopodip")
730+
testDir := filepath.Join("testdata", "e2e", "namespaced_rbac_no_pod_ip")
731731

732732
k8sClient, err := k8stest.NewK8sClient(testKubeConfig)
733733
require.NoError(t, err)
@@ -932,6 +932,7 @@ func resourceHasAttributes(resource pcommon.Resource, kvs map[string]*expectedVa
932932
for k, v := range kvs {
933933
if v.mode != shouldnotexist {
934934
foundAttrs[k] = false
935+
continue
935936
}
936937
shouldNotFoundAttrs[k] = false
937938
}

processor/k8sattributesprocessor/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ resource_attributes:
3535
type: string
3636
enabled: true
3737
k8s.pod.ip:
38-
description: The IP of the Pod.
38+
description: The IP address of the Pod.
3939
type: string
4040
enabled: false
4141
k8s.deployment.name:

processor/k8sattributesprocessor/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const (
2121
filterOPNotEquals = "not-equals"
2222
filterOPExists = "exists"
2323
filterOPDoesNotExist = "does-not-exist"
24-
metadataPodStartTime = "k8s.pod.start_time"
2524
metadataPodIP = "k8s.pod.ip"
25+
metadataPodStartTime = "k8s.pod.start_time"
2626
specPodHostName = "k8s.pod.hostname"
2727
// TODO: use k8s.cluster.uid from semconv when available, and replace clusterUID with conventions.AttributeClusterUid
2828
clusterUID = "k8s.cluster.uid"

processor/k8sattributesprocessor/testdata/e2e/namespacedrbacnopodip/collector/configmap.yaml renamed to processor/k8sattributesprocessor/testdata/e2e/namespaced_rbac_no_pod_ip/collector/configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: ConfigMap
33
metadata:
44
name: {{ .Name }}-config
5-
namespace: e2ek8sattribute-namespacedrbac
5+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip
66
data:
77
relay: |
88
exporters:
@@ -15,7 +15,7 @@ data:
1515
processors:
1616
k8sattributes:
1717
filter:
18-
namespace: e2ek8sattribute-namespacedrbac
18+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip
1919
node_from_env_var: MY_NODE_NAME
2020
labels:
2121
- key: component

processor/k8sattributesprocessor/testdata/e2e/namespacedrbacnopodip/collector/deployment.yaml renamed to processor/k8sattributesprocessor/testdata/e2e/namespaced_rbac_no_pod_ip/collector/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: {{ .Name }}
5-
namespace: e2ek8sattribute-namespacedrbac
5+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip
66
spec:
77
replicas: 1
88
selector:

processor/k8sattributesprocessor/testdata/e2e/namespacedrbacnopodip/collector/role.yaml renamed to processor/k8sattributesprocessor/testdata/e2e/namespaced_rbac_no_pod_ip/collector/role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: Role
33
metadata:
44
name: {{ .Name }}
5-
namespace: e2ek8sattribute-namespacedrbac
5+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip
66
rules:
77
- apiGroups: [""]
88
resources: ["pods"]

processor/k8sattributesprocessor/testdata/e2e/namespacedrbacnopodip/collector/rolebinding.yaml renamed to processor/k8sattributesprocessor/testdata/e2e/namespaced_rbac_no_pod_ip/collector/rolebinding.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: RoleBinding
33
metadata:
44
name: {{ .Name }}
5-
namespace: e2ek8sattribute-namespacedrbac
5+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip
66
roleRef:
77
apiGroup: rbac.authorization.k8s.io
88
kind: Role
99
name: {{ .Name }}
1010
subjects:
1111
- kind: ServiceAccount
1212
name: {{ .Name }}
13-
namespace: e2ek8sattribute-namespacedrbac
13+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip

processor/k8sattributesprocessor/testdata/e2e/namespacedrbacnopodip/collector/service.yaml renamed to processor/k8sattributesprocessor/testdata/e2e/namespaced_rbac_no_pod_ip/collector/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: {{ .Name }}
5-
namespace: e2ek8sattribute-namespacedrbac
5+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip
66
spec:
77
type: ClusterIP
88
ports:

processor/k8sattributesprocessor/testdata/e2e/namespacedrbacnopodip/collector/serviceaccount.yaml renamed to processor/k8sattributesprocessor/testdata/e2e/namespaced_rbac_no_pod_ip/collector/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: {{ .Name }}
5-
namespace: e2ek8sattribute-namespacedrbac
5+
namespace: e2ek8sattribute-namespacedrbac-no-pod-ip

0 commit comments

Comments
 (0)