xlab-si / xopera-opera

xOpera orchestrator compliant with TOSCA YAML v1.3 in the making
https://xlab-si.github.io/xopera-docs/
Apache License 2.0
35 stars 14 forks source link

Execute checks on requirements defined by node types #186

Closed dradX closed 3 years ago

dradX commented 3 years ago

Description

With this issue, we want to fix the checks on the node's requirements definition within the service template in case the node does not define a specific requirement.

Steps

Situation - The node definition does not have a specific definition of a requirement but derives from a normative or additionally defined node like in this example:

...
node_types:
  hello_type:
    derived_from: tosca.nodes.SoftwareComponent
    properties:
      time:
        default: "1" 
        type: string     
    interfaces:
      Standard:
        inputs:
          time:
            default: { get_property: [SELF, time] } 
            type: string            
        operations:
          create: playbooks/sleep.yaml
          start: playbooks/sleep.yaml
          delete: playbooks/sleep.yaml
...

In the template section the node uses undefined requirements:

...
    hello-14:
      type: hello_type
      properties:
        time: "1"
      requirements:
        - host: my-workstation
        - dependency1:  hello-1
        - dependency2:  hello-2
        - dependency7:  hello-7
        - dependency13:  hello-13
...

Current behavior

Currently, opera executes the deployment without taking into account the undefined dependency1 requirement and does not return an error.

Expected results

opera should return a parse error showing that an undefined node requirement dependency1 for node hello-14 has been used in the topology_template section.

anzoman commented 3 years ago

Thanks @dradX, this is also something that we have to fix in order to be compliant with TOSCA.

This issue is connected to #182.

dradX commented 3 years ago

@anzoman True, I was not aware we had a similar issue already open #182 - solving that one would probably resolve also this.

anzoman commented 3 years ago

I have found out that this issue has been duplicated twice, so part from this one, #182 is also duplicate of #63 which has been opened some time ago.