Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1093

pdk convert doesn't add a Puppet requirement in metadata.json, failing pdk validate

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.8.0
    • Component/s: None
    • Template:
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Currently when we're updating a module's metadata.json file during
      convert, we only replace values if they are completely absent from the
      file. Unfortunately, this means if - for example - the existing metadata
      defines dependencies as null or an empty array then it will not be
      updated when the module is converted and it will subsequently fail to
      validate cleanly.

      This PR changes the metadata merging logic so that values defined as
      null will be replaced with the default metadata value. Additionally, if the requirements array exists but is empty, it will also be updated with the default value.
      Show
      Currently when we're updating a module's metadata.json file during convert, we only replace values if they are completely absent from the file. Unfortunately, this means if - for example - the existing metadata defines dependencies as null or an empty array then it will not be updated when the module is converted and it will subsequently fail to validate cleanly. This PR changes the metadata merging logic so that values defined as null will be replaced with the default metadata value. Additionally, if the requirements array exists but is empty, it will also be updated with the default value.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When running pdk convert on a module, the Puppet requirement is not added to metadata.json for the module. This causes a failure against pdk validate.

      A sample module to reproduce this easily can be found at https://github.com/GoogleCloudPlatform/puppet-google-auth - running pdk convert on this module will reproduce the issue.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                tim.sharpe Tim Sharpe
                Reporter:
                david.alexander David Alexander
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: