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

fix(mapstr): cast inner maps to M on Clone #283

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

mauri870
Copy link
Member

@mauri870 mauri870 commented Feb 21, 2025

What does this PR do?

PR #262 changed the Clone behavior to preserve the type of inner map[string]interface{} instead of casting them to M. This PR reverts this behavior since we rely on inner maps being casted to M in beats. This was not tested before, that is why we only caught it now. Additionally, add tests to ensure this behavior is preserved.

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

Related issues

@mauri870 mauri870 added the bug Something isn't working label Feb 21, 2025
@mauri870 mauri870 self-assigned this Feb 21, 2025
@mauri870 mauri870 requested a review from a team as a code owner February 21, 2025 12:44
@mauri870 mauri870 requested review from belimawr and leehinman and removed request for a team February 21, 2025 12:44
@mauri870 mauri870 added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Feb 21, 2025
@mauri870 mauri870 requested a review from efd6 February 21, 2025 12:44
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @mauri870

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is unfortunate and a result of poorly constructed tests in libbeat/processors/add_cloud_metadata, but approving.

@mauri870 mauri870 merged commit 8b03463 into elastic:main Feb 24, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants