Uploaded image for project: 'Migration Toolkit for Applications'
  1. Migration Toolkit for Applications
  2. MTA-6109

[CLI][Assets Generation] The --set flag doesn't work as expected when changing values in a dictionary

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Blocker Blocker
    • MTA 8.0.0
    • MTA 8.0.0
    • MTA CLI
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • Critical
    • None

      Description of problem:

      Using the --set flag in the CLI to change the value of a key nested in a dictionary overwrites the entire dictionary instead of updating just that value.

      Version-Release number of selected component (if applicable):

      v0.8.0-beta.2

      How reproducible:

      Always

      Steps to Reproduce:

      1. Clone https://github.com/konveyor/cf-k8s-helm-chart
      2. Run the following command, pointing to the attached discovery manifest. Notice that we are overriding the app name:

      kantra generate helm --chart-dir /path/to/chart/cf-k8s-helm-chart/java-backend/ --input /path/to/manifest/discover_manifest_app1.yaml --output-dir /path/to/output --set manifest.name=app2
      

      Actual results:

      All keys under manifest but name have been removed. Some templates that render depending on the existence of other nested keys under manifest don't render anymore. See attached file kantra-output.zip for additional details.

      Expected results:

      Only the value for manifest.name changes, leaving other values for the remaining keys under manifest intact.

      Additional info:

      I checked this with the helm template command, and it worked as expected. Here's the command I used:

      helm template /path/to/chart/cf-k8s-helm-chart/java-backend/ --values /path/to/manifest/discover_manifest_app1.yaml --output-dir /path/to/output --set manifest.name=app2
      

      Only the value manifest.name was changed, and the rest of keys under manifest kept their original values. See attacked file helm-output.zip for additional details.

        1. discover_manifest_app1.yaml
          2 kB
          Ramon Roman Nissen

              jgil@redhat.com Jordi Gil
              rromanni@redhat.com Ramon Roman Nissen
              Nandini Chandra Nandini Chandra
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: