Skip to content

Commit 88757bd

Browse files
MichaelKatsoulismergify-bot
authored andcommitted
Revert "Move labels and annotations under kubernetes.namespace. (#27917)" (#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)
1 parent 6caf4a7 commit 88757bd

102 files changed

Lines changed: 2386 additions & 3700 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.next.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
1919
- Remove deprecated config option aws_partition. {pull}28120[28120]
2020
- Improve stats API {pull}27963[27963]
2121
- Enable IMDSv2 support for `add_cloud_metadata` processor on AWS. {issue}22101[22101] {pull}28285[28285]
22-
- Update kubernetes.namespace from keyword to group field and add name, labels, annotations, uuid as its fields {pull}27917[27917]
2322
- 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]
2423
- 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]
2524
- Update docker client. {pull}28716[28716]

auditbeat/docs/fields.asciidoc

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18222,47 +18222,16 @@ type: ip
1822218222
1822318223
--
1822418224
18225-
18226-
*`kubernetes.namespace.name`*::
18225+
*`kubernetes.namespace`*::
1822718226
+
1822818227
--
18229-
Kubernetes namespace name
18228+
Kubernetes namespace
1823018229
1823118230
1823218231
type: keyword
1823318232
1823418233
--
1823518234
18236-
*`kubernetes.namespace.uuid`*::
18237-
+
18238-
--
18239-
Kubernetes namespace uuid
18240-
18241-
18242-
type: keyword
18243-
18244-
--
18245-
18246-
*`kubernetes.namespace.labels.*`*::
18247-
+
18248-
--
18249-
Kubernetes namespace labels map
18250-
18251-
18252-
type: object
18253-
18254-
--
18255-
18256-
*`kubernetes.namespace.annotations.*`*::
18257-
+
18258-
--
18259-
Kubernetes namespace annotations map
18260-
18261-
18262-
type: object
18263-
18264-
--
18265-
1826618235
*`kubernetes.node.name`*::
1826718236
+
1826818237
--

auditbeat/include/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

filebeat/docs/fields.asciidoc

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -86641,47 +86641,16 @@ type: ip
8664186641

8664286642
--
8664386643

86644-
86645-
*`kubernetes.namespace.name`*::
86644+
*`kubernetes.namespace`*::
8664686645
+
8664786646
--
86648-
Kubernetes namespace name
86647+
Kubernetes namespace
8664986648

8665086649

8665186650
type: keyword
8665286651

8665386652
--
8665486653

86655-
*`kubernetes.namespace.uuid`*::
86656-
+
86657-
--
86658-
Kubernetes namespace uuid
86659-
86660-
86661-
type: keyword
86662-
86663-
--
86664-
86665-
*`kubernetes.namespace.labels.*`*::
86666-
+
86667-
--
86668-
Kubernetes namespace labels map
86669-
86670-
86671-
type: object
86672-
86673-
--
86674-
86675-
*`kubernetes.namespace.annotations.*`*::
86676-
+
86677-
--
86678-
Kubernetes namespace annotations map
86679-
86680-
86681-
type: object
86682-
86683-
--
86684-
8668586654
*`kubernetes.node.name`*::
8668686655
+
8668786656
--

filebeat/include/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

heartbeat/docs/fields.asciidoc

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15804,47 +15804,16 @@ type: ip
1580415804
1580515805
--
1580615806
15807-
15808-
*`kubernetes.namespace.name`*::
15807+
*`kubernetes.namespace`*::
1580915808
+
1581015809
--
15811-
Kubernetes namespace name
15810+
Kubernetes namespace
1581215811
1581315812
1581415813
type: keyword
1581515814
1581615815
--
1581715816
15818-
*`kubernetes.namespace.uuid`*::
15819-
+
15820-
--
15821-
Kubernetes namespace uuid
15822-
15823-
15824-
type: keyword
15825-
15826-
--
15827-
15828-
*`kubernetes.namespace.labels.*`*::
15829-
+
15830-
--
15831-
Kubernetes namespace labels map
15832-
15833-
15834-
type: object
15835-
15836-
--
15837-
15838-
*`kubernetes.namespace.annotations.*`*::
15839-
+
15840-
--
15841-
Kubernetes namespace annotations map
15842-
15843-
15844-
type: object
15845-
15846-
--
15847-
1584815817
*`kubernetes.node.name`*::
1584915818
+
1585015819
--

heartbeat/include/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

journalbeat/docs/fields.asciidoc

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16149,47 +16149,16 @@ type: ip
1614916149
1615016150
--
1615116151
16152-
16153-
*`kubernetes.namespace.name`*::
16152+
*`kubernetes.namespace`*::
1615416153
+
1615516154
--
16156-
Kubernetes namespace name
16155+
Kubernetes namespace
1615716156
1615816157
1615916158
type: keyword
1616016159
1616116160
--
1616216161
16163-
*`kubernetes.namespace.uuid`*::
16164-
+
16165-
--
16166-
Kubernetes namespace uuid
16167-
16168-
16169-
type: keyword
16170-
16171-
--
16172-
16173-
*`kubernetes.namespace.labels.*`*::
16174-
+
16175-
--
16176-
Kubernetes namespace labels map
16177-
16178-
16179-
type: object
16180-
16181-
--
16182-
16183-
*`kubernetes.namespace.annotations.*`*::
16184-
+
16185-
--
16186-
Kubernetes namespace annotations map
16187-
16188-
16189-
type: object
16190-
16191-
--
16192-
1619316162
*`kubernetes.node.name`*::
1619416163
+
1619516164
--

journalbeat/include/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libbeat/autodiscover/providers/kubernetes/pod.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ func (p *pod) GenerateHints(event bus.Event) bus.Event {
189189
}
190190

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

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

443442
// Don't set a port on the event

0 commit comments

Comments
 (0)