tliron / puccini

Cloud topology management and deployment tools based on TOSCA
https://puccini.cloud
Apache License 2.0
88 stars 20 forks source link

Outputs are not rendered in relationship template operation #132

Closed Shishqa closed 1 year ago

Shishqa commented 1 year ago

Consider an example:

tosca_definitions_version: tosca_simple_yaml_1_3
relationship_types:
  CustomDependsOn:
    derived_from: tosca.relationships.DependsOn
topology_template:
  node_templates:
    node_2:
      type: tosca:Root
      requirements:
        - dependency:
            node: node_1
            relationship: custom_depends
    node_1:
      type: tosca:Root
  relationship_templates:
    custom_depends:
      type: CustomDependsOn
      interfaces:
        Configure:
          operations:
            pre_configure_source:
              implementation: playbook.yaml
              outputs:
                var: [ TARGET, tosca_id ]

With running puccini-tosca parse test.yaml the puccini produces this output for the operation pre_configure_source:

pre_configure_source:
    description: Operation to pre-configure the source endpoint.
    implementation: playbook.yaml
    dependencies: []
    inputs: {}
    outputs: {}
    timeout: -1

However, the expected output has to have outputs (var) rendered. The same output is produced with SELF and SOURCE keywords.


Puccini version:

version=v0.21.0
revision=2a24a6c3467380001480d2de5c4570bb60e53fb8
timestamp=2023-03-23 23:14:55 MSK
arch=amd64
os=linux
compiler=gc
compiler-version=go1.20.1
tliron commented 1 year ago

Thanks @Shishqa, I would appreciate if you could verify the fix works! It was a simple fix.

Shishqa commented 1 year ago

Thanks a lot! It works as expected. I was trying to find a fix, but thought it needed special logic for relationship template :)

tliron commented 1 year ago

LOL, no, the functionality was there (worked in notifications), but I just forgot a line. :)