Skip to content

Commit

Permalink
Revert "Move labels and annotations under kubernetes.namespace. (#27917
Browse files Browse the repository at this point in the history
…)" (#29069)

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

This reverts commit bb36e72.

* Remove TODOs for 8.0

* Revert changes to Agent

* Revert changelog entry

(cherry picked from commit 39554cd)
  • Loading branch information
MichaelKatsoulis authored and mergify-bot committed Nov 23, 2021
1 parent 6caf4a7 commit 88757bd
Show file tree
Hide file tree
Showing 102 changed files with 2,386 additions and 3,700 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Remove deprecated config option aws_partition. {pull}28120[28120]
- Improve stats API {pull}27963[27963]
- Enable IMDSv2 support for `add_cloud_metadata` processor on AWS. {issue}22101[22101] {pull}28285[28285]
- Update kubernetes.namespace from keyword to group field and add name, labels, annotations, uuid as its fields {pull}27917[27917]
- Libbeat: logp package forces ECS compliant logs. Logs are JSON formatted. Options to enable ECS/JSON have been removed. {issue}15544[15544] {pull}28573[28573]
- Previously, RE2 and thus Golang had a bug where `(|a)*` matched more characters than `(|a)+`. To stay consistent with PCRE, the bug was fixed. Configurations that rely on the old, buggy behaviour has to be adjusted. See more about Golang bug: https://github.com/golang/go/issues/46123 {pull}27543[27543]
- Update docker client. {pull}28716[28716]
Expand Down
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

0 comments on commit 88757bd

Please sign in to comment.