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

Allow updateMap to use custom sourceFile and mappingFile #1588

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

fanny-jiang
Copy link
Contributor

@fanny-jiang fanny-jiang commented Oct 25, 2024

What this PR does / why we need it:

Add support to the -updateMap flag to update provided mappingFile with a provided sourceFile so that it can be used more generically in development and CI.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer:

QA

  • Uncomment line 295 to print tmp file paths and build yaml-mapper binary
  • ./yaml-mapper -updateMap with no flags should update default mappingFile with values from the latest Datadog chart values.yaml:
    • Remove a few unmapped helm keys from mapping_datadog_helm_to_datadogagent_crd.yaml and run ./yaml-mapper -updateMap. The helm keys should be added back to the default mapping file. (i.e. remove agents.containers.agent.envDict: "")
    • temp chart.yaml and datadog-values.yaml files should get cleaned up
  • ./yaml-mapper -updateMap -sourceFile=<path-to-local-helm-charts-dir>/charts/datadog/values.yaml should update the default mappingFile with any new keys added to the local values.yaml file
  • ./yaml-mapper -updateMap -sourceFile=<path-to-local-helm-charts-dir>/charts/datadog/values.yaml -mappingFile=<other-mapping-file> should update provided mappingFile with keys from the local values.yaml file
  • ./yaml-mapper -updateMap -sourceFile=<any.yaml> -mappingFile=<some-mapping-file> should map keys from any yaml file to a provided mapping file
  • For the above testing where -sourceFile flag is used , make sure provided sourceFile doesn't get deleted!
  • values.yaml => DDA mapping should be unaffected

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Chart Version bumped
  • Documentation has been updated with helm-docs (run: .github/helm-docs.sh)
  • CHANGELOG.md has been updated
  • Variables are documented in the README.md
  • For Datadog Operator chart or value changes update the test baselines (run: make update-test-baselines)

@fanny-jiang fanny-jiang marked this pull request as ready for review October 25, 2024 19:06
@fanny-jiang fanny-jiang requested review from a team as code owners October 25, 2024 19:06
@fanny-jiang fanny-jiang merged commit c652360 into swang392/add-yaml-tooling Oct 25, 2024
2 checks passed
@fanny-jiang fanny-jiang deleted the fanny/mapUpdate-local-values branch October 25, 2024 20:55
@fanny-jiang fanny-jiang changed the title Allow updateMap to use provided sourceFile and mappingFile Allow updateMap to use custom sourceFile and mappingFile Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants