Skip to content

Commit

Permalink
fixes and changelog
Browse files Browse the repository at this point in the history
Signed-off-by: chrismark <[email protected]>
  • Loading branch information
ChrsMark committed Jan 26, 2021
1 parent 8338da4 commit 10ea526
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Update the baseline version of Sarama (Kafka support library) to 1.27.2. {pull}23595[23595]
- Add kubernetes.volume.fs.used.pct field. {pull}23564[23564]
- Add the `enable_krb5_fast` flag to the Kafka output to explicitly opt-in to FAST authentication. {pull}23629[23629]
- Add deployment name in pod's meta. {pull}23610[23610]

*Auditbeat*

Expand Down
6 changes: 4 additions & 2 deletions libbeat/common/kubernetes/metadata/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ func (p *pod) Generate(obj kubernetes.Resource, opts ...FieldOptions) common.Map

// check if Pod is handled by a ReplicaSet which is controlled by a Deployment
rsName, _ := out.GetValue("replicaset.name")
if rsName != nil {
rsName := rsName.(string)
if rsName, ok := rsName.(string); ok {
dep := p.getRSDeployment(rsName, po.GetNamespace())
if dep != "" {
out.Put("deployment.name", dep)
Expand Down Expand Up @@ -114,6 +113,9 @@ func (p *pod) GenerateFromName(name string, opts ...FieldOptions) common.MapStr
// getRSDeployment return the name of the Deployment object that
// owns the ReplicaSet with the given name under the given Namespace
func (p *pod) getRSDeployment(rsName string, ns string) string {
if p.client == nil {
return ""
}
rs, err := p.client.AppsV1().ReplicaSets(ns).Get(context.TODO(), rsName, metav1.GetOptions{})
if err != nil {
return ""
Expand Down
2 changes: 1 addition & 1 deletion libbeat/common/kubernetes/metadata/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestPod_Generate(t *testing.T) {
},
}

_, err := client.AppsV1().ReplicaSets(namespace).Create(context.TODO(), rs, metav1.CreateOptions{})
_, err := client.AppsV1().ReplicaSets(namespace).Create(context.Background(), rs, metav1.CreateOptions{})
if err != nil {
t.Fatalf("failed to create k8s deployment: %v", err)
}
Expand Down

0 comments on commit 10ea526

Please sign in to comment.