Nested validation issues with non-defaulted nested parameters

Bug #1626022 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
New
Medium
Unassigned

Bug Description

There are a couple of related problems with nested validation which are causing us some issues with TripleO atm:

$ cat parent.yaml
heat_template_version: 2016-10-14

parameters:
  with_default:
    type: string
    default: foo
  no_default:
    type: string

resources:

  a_resource:
    type: OS::Heat::RandomString

  the_nested:
    type: nested.yaml
    properties:
      from_parent_param: {get_param: no_default}
      from_parent_param_default: {get_param: with_default}
      from_parent_attr: {get_attr: [a_resource, value]}
[stack@instack ~]$ cat nested.yaml
heat_template_version: 2016-04-08

parameters:
  from_parent_param:
    type: string
  from_parent_param_default:
    type: string
  from_parent_attr:
    type: string

resources:
  test:
    type: OS::Heat::RandomString
    properties:
      salt:
        list_join:
          - ','
          - {get_param: from_parent_param}
          - {get_param: from_parent_param_default}
          - {get_param: from_parent_attr}

$ heat template-validate -f parent.yaml --show-nested
WARNING (shell) "heat template-validate" is deprecated, please use "openstack orchestration template validate" instead
{
  "NestedParameters": {
    "the_nested": {
      "Type": "file:///home/stack/nested.yaml",
      "Description": "No description",
      "Parameters": {
        "from_parent_param": {
          "Type": "String",
          "NoEcho": "false",
          "Description": "",
          "Label": "from_parent_param"
        },
        "from_parent_param_default": {
          "Type": "String",
          "NoEcho": "false",
          "Description": "",
          "Value": "foo",
          "Label": "from_parent_param_default"
        },
        "from_parent_attr": {
          "Type": "String",
          "NoEcho": "false",
          "Description": "",
          "Label": "from_parent_attr"
        }
      }
    }
  },
  "Description": "No description",
  "Parameters": {
    "no_default": {
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Label": "no_default"
    },
    "with_default": {
      "Default": "foo",
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Label": "with_default"
    }
  }
}

The problem here is that there is no way to know that a Value is actually passed from the parent, e.g for from_parent_param and from_parent_attr, we know there should be some Value on create, so a placeholder is needed (to distinguish from parameters in nested.yaml where no default is defined *and* no value is passed from the parent.

Steven Hardy (shardy)
summary: - Nested validation breaks with non-defaulted nested parameters
+ Nested validation issues with non-defaulted nested parameters
Revision history for this message
Thomas Herve (therve) wrote :

It took some more explanations for me to understand, so I'll try to write them down here: the problem is that we'd like the Value field to have something indication that the parent passes down something, presumably a placeholder.

It's a good bug to track, but I suspect that would be solve by a larger spec involving validation. We need at least to agree on what the Value field would look like in that case.

Changed in heat:
milestone: none → ongoing
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.