-
Notifications
You must be signed in to change notification settings - Fork 130
Add helm-dda yaml mapper #2268
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
base: main
Are you sure you want to change the base?
Add helm-dda yaml mapper #2268
Conversation
31d84ed to
9b2c720
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2268 +/- ##
==========================================
- Coverage 36.92% 36.83% -0.09%
==========================================
Files 273 281 +8
Lines 22921 23622 +701
==========================================
+ Hits 8463 8701 +238
- Misses 13819 14240 +421
- Partials 639 681 +42
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
c74a02e to
e2d359a
Compare
e2d359a to
174967e
Compare
levan-m
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High level structure and cli experience is great! didn't go through the mapping logic line by line but tests seem to cover a lot and did my testing too.
I left some comments/suggestions most of those can be addressed in follow-ups except the deadline/timeout.
|
|
||
| destKey, _ := mappingValues[sourceKey] | ||
| if (destKey == "" || destKey == nil) && !apiutils.IsEqualStruct(pathVal, defaultVal) { | ||
| log.Printf("Warning: DDA destination key not found. Could not map: %s\n", sourceKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't catch case when source contains keys not mapped to "" in the mapper file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 5d36072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix added by go linter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes added by go linter
What does this PR do?
Add a helm values.yaml->DDA mapper binary.
Motivation
What inspired you to submit this pull request?
Additional Notes
The mapper currently generates a large DDA manifest yaml file. Future work to improve readability of the DDA includes omitting default fields in the final mapped DDA.
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
make yaml-mapper-unit-testsmake yaml-mapperexamples/example_source.yamldda.yaml.<timestamp>dda.yamlfile. There should be no errors.example_source.yamlto add a key that doesn't have a mapped destination key, e.g.agents.podSecurity.allowedUnsafeSysctls1.Test flags:
destPath:dda.yaml.<timestamp>is createdmappingPath:mappingPathis provided, it'll be usedmappingPathis not provided, it'll use the default mapping. The default mapping file is determined in this order:1. The latest mapping file in the
helm-chartsrepo2. If the mapping file cannot be retrieved, it'll fall back on the embedded mapping file at
cmd/yaml-mapper/mapper/mapping_datadog_helm_to_datadogagent_crd.yamlsourcePath:namespace:metadata.namespacefieldmetadata.namespacefield is omittedprintOutputtrue: prints the DDA output to the stdoutfalse, DDA output is not sent to stdout. Logging will continue to be printed(Let's ignore the
updateMapandheaderPathfor now since they're not critical for functionality)Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel