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

Add helm-operator-mapper tool for migrating from helm to operator #1570

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

swang392
Copy link
Contributor

What this PR does / why we need it:

Add yaml-mapper tool to helm charts to help users switch from installing the Datadog Agent with helm charts to using Operator. The yaml mapper script will take a values.yaml file used for helm charts and convert it into one that is compatible with the operator.

Special notes for your reviewer:

part of agent innovation week project

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)

@github-actions github-actions bot added the chart/datadog This issue or pull request is related to the datadog chart label Oct 21, 2024
@swang392 swang392 marked this pull request as ready for review October 21, 2024 20:40
@swang392 swang392 requested review from a team as code owners October 21, 2024 20:40
Copy link
Contributor

@buraizu buraizu left a comment

Choose a reason for hiding this comment

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

Just requesting some minor updates

tools/yaml-mapper/README.md Outdated Show resolved Hide resolved
tools/yaml-mapper/README.md Outdated Show resolved Hide resolved
tools/yaml-mapper/README.md Outdated Show resolved Hide resolved
tools/yaml-mapper/README.md Outdated Show resolved Hide resolved
@swang392 swang392 added the enhancement New feature or request label Oct 22, 2024
swang392 and others added 4 commits October 22, 2024 10:41
* add updateMap flag

* fix mapping

* fix values parsing

* remove invalid parent keys from mapping

* refactor

* more refactor, add comments

* remove _
* add updateMap flag

* fix mapping

* update mapping for secrets, config maps

* update mapping

* fix values parsing

* remove invalid parent keys from mapping

* update mapper

* minor fixes

* updating mapper

* remove parents to nested keys

---------

Co-authored-by: Fanny Jiang <[email protected]>
* updateMap to use provided sourceFile and mappingFile

* remove comment, grammar fixes

* update readme, rename tooling

* fix mapping

* fix logging
@swang392 swang392 changed the title Add yaml-mapper tool for migrating from helm to operator Add helm-operator-mapper tool for migrating from helm to operator Oct 29, 2024
Copy link
Contributor

@buraizu buraizu left a comment

Choose a reason for hiding this comment

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

Thanks, approving with a couple of additional minor suggestions for formatting consistency

## Example usage (using provided files)

```bash
$ ./helm-operator-mapper -sourceFile=example_source.yaml -mappingFile=mapping_datadog_helm_to_datadogagent_crd.yaml -prefixFile=example_prefix.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
$ ./helm-operator-mapper -sourceFile=example_source.yaml -mappingFile=mapping_datadog_helm_to_datadogagent_crd.yaml -prefixFile=example_prefix.yaml
$ ./helm-operator-mapper -sourceFile=<EXAMPLE_SOURCE>.yaml -mappingFile=mapping_datadog_helm_to_datadogagent_crd.yaml -prefixFile=<EXAMPLE_PREFIX>.yaml


## Purpose

The purpose of this tool is to map a YAML file of a certain structure to another YAML file of a different structure. For instance, migrating a Helm chart values.yaml file to another values.yaml file after a significant chart update.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The purpose of this tool is to map a YAML file of a certain structure to another YAML file of a different structure. For instance, migrating a Helm chart values.yaml file to another values.yaml file after a significant chart update.
The purpose of this tool is to map a YAML file of a certain structure to another YAML file of a different structure. For instance, migrating a Helm chart `values.yaml` file to another `values.yaml` file after a significant chart update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chart/datadog This issue or pull request is related to the datadog chart enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants