Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Move labels and annotations under kubernetes.namespace. (#27917)" #29069

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 2 additions & 33 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18222,47 +18222,16 @@ type: ip

--


*`kubernetes.namespace.name`*::
*`kubernetes.namespace`*::
+
--
Kubernetes namespace name
Kubernetes namespace


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

Large diffs are not rendered by default.

35 changes: 2 additions & 33 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -86641,47 +86641,16 @@ type: ip

--


*`kubernetes.namespace.name`*::
*`kubernetes.namespace`*::
+
--
Kubernetes namespace name
Kubernetes namespace


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

35 changes: 2 additions & 33 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15804,47 +15804,16 @@ type: ip

--


*`kubernetes.namespace.name`*::
*`kubernetes.namespace`*::
+
--
Kubernetes namespace name
Kubernetes namespace


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/include/fields.go

Large diffs are not rendered by default.

35 changes: 2 additions & 33 deletions journalbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16149,47 +16149,16 @@ type: ip

--


*`kubernetes.namespace.name`*::
*`kubernetes.namespace`*::
+
--
Kubernetes namespace name
Kubernetes namespace


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion journalbeat/include/fields.go

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions libbeat/autodiscover/providers/kubernetes/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ func (p *pod) GenerateHints(event bus.Event) bus.Event {
}

// Look at all the namespace level default annotations and do a merge with priority going to the pod annotations.
rawNsAnn, err := kubeMeta.GetValue("namespace.annotations")
if err == nil {
if rawNsAnn, ok := kubeMeta["namespace_annotations"]; ok {
namespaceAnnotations, _ := rawNsAnn.(common.MapStr)
if len(namespaceAnnotations) != 0 {
annotations.DeepUpdateNoOverwrite(namespaceAnnotations)
Expand Down Expand Up @@ -385,7 +384,7 @@ func (p *pod) containerPodEvents(flag string, pod *kubernetes.Pod, c *containerI
"runtime": c.runtime,
}
if len(namespaceAnnotations) != 0 {
kubemeta.Put("namespace.annotations", namespaceAnnotations)
kubemeta["namespace_annotations"] = namespaceAnnotations
}

ports := c.spec.Ports
Expand Down Expand Up @@ -437,7 +436,7 @@ func (p *pod) podEvent(flag string, pod *kubernetes.Pod, ports common.MapStr, in
kubemeta = kubemeta.Clone()
kubemeta["annotations"] = annotations
if len(namespaceAnnotations) != 0 {
kubemeta.Put("namespace.annotations", namespaceAnnotations)
kubemeta["namespace_annotations"] = namespaceAnnotations
}

// Don't set a port on the event
Expand Down
Loading