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

[8.15](backport #41100) Only watch metadata for ReplicaSets in K8s #41214

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 14, 2024

Proposed commit message

Use metadata watchers for ReplicaSets in components that need them. The only data we need from ReplicaSets are their name and OwnerReferences, which are used to connect Pods to Deployments and DaemonSets.

This PR makes the change in:

  • autodiscovery
  • the add_kubernetes_metadata processor

For more details see elastic/elastic-agent#5623.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

You need a full K8s cluster, unfortunately. I've tested it using the default elastic-agent standalone manifest, by building a custom container image and loading it into a local kind cluster.

Related issues


This is an automatic backport of pull request #41100 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner October 14, 2024 10:51
@mergify mergify bot added the backport label Oct 14, 2024
@mergify mergify bot requested a review from a team as a code owner October 14, 2024 10:51
@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Oct 14, 2024
@mergify mergify bot requested a review from a team as a code owner October 14, 2024 10:51
@mergify mergify bot requested review from gizas and tetianakravchenko and removed request for a team October 14, 2024 10:51
Copy link
Contributor Author

mergify bot commented Oct 14, 2024

Cherry-pick of ee780d2 has failed:

On branch mergify/bp/8.15/pr-41100
Your branch is up to date with 'origin/8.15'.

You are currently cherry-picking commit ee780d2528.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG.next.asciidoc
	modified:   libbeat/autodiscover/providers/kubernetes/pod_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod
	both modified:   go.sum
	both modified:   libbeat/autodiscover/providers/kubernetes/pod.go
	both modified:   libbeat/processors/add_kubernetes_metadata/kubernetes.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot requested review from AndersonQ and leehinman and removed request for a team October 14, 2024 10:51
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 14, 2024
* Bump github.com/elastic/elastic-agent-autodiscover to v0.9.0

* Only watch metadata for ReplicaSets in k8s autodiscovery

* Only watch metadata for ReplicaSets in add_kubernetes_metadata processor

* Fix linter warnings

* Merge changelog entries

(cherry picked from commit ee780d2)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
#	libbeat/autodiscover/providers/kubernetes/pod.go
#	libbeat/processors/add_kubernetes_metadata/kubernetes.go
@swiatekm swiatekm added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 14, 2024
@swiatekm swiatekm merged commit 2861b61 into 8.15 Oct 14, 2024
140 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.15/pr-41100 branch October 14, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant