tosca-community-contributions icon indicating copy to clipboard operation
tosca-community-contributions copied to clipboard

Is the node field optional or mandatory in a requirement assignment?

Open philippemerle opened this issue 2 years ago • 1 comments

The following topology template:

tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
  node_templates:
    my_node:
      type: tosca.nodes.Root
      requirements:
        - dependency:
            capability: feature

seems to be correct according to the first table in section 3.8.2.1 of TOSCA 1.3 where the node field is optional (no in Required colunm). But the specification seems to not define the semantics of a requirement assignment with no node.

Proposition:

  1. Define the semantics of a requirement assignment with no node or
  2. Make node required in the first table in section 3.8.2.1 of TOSCA 1.3.

Perhaps this should be also applied to TOSCA 2.0 https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd05/TOSCA-v2.0-csd05.html#_Toc125468590.

philippemerle avatar Jun 11 '23 11:06 philippemerle

Nice to hear from you Philippe. Yes, this should be clarified in the spec. If the capability keyword in a requirement assignment refers to a capability name (as opposed to a capability type), then

  1. Either a valid node type must have been specified in the corresponding requirement definition, or
  2. A valid node type or node name must have been specified in the requirement assignment.

lauwers avatar Jun 25 '23 21:06 lauwers