Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-36711

CNA module variable default value not showing when null

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • OpsDev - Fridge

      current behaviour

      If a terraform variable of a CNA module sets its default value to null, the /asset_type endpoint of a module does not show "default: null" in the respective variable metadata.

      this problem can be seen on the "aws-rds" module where the instance_class has a default value of null in the module code but /asset_type/aws-rds does not show the default field for the variable.

      expected behaviour

      the expected behaviour would be that a tf variables default metadata is transported from the module to the /asset_type API endpoint, regardless of it being null or not.

      why?

      a user of a module needs to be aware what variables are optional and which ones are mandatory. a variable with a default value, regardless of it being null or something else, is optional and all others are mandatory.

      alternative solution

      alternatively a modules metadata exposed under /asset_type could contain explicit metadata about the variable, e.g. "required: bool"

              Unassigned Unassigned
              goberlec@redhat.com Gerd Oberlechner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: