tliron / puccini

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

Property assignment not supported in Interface operations #99

Closed pmjordan closed 2 years ago

pmjordan commented 2 years ago

Consider examples/tosca/interfaces.yaml replace lines 42-44 with the lines

retries: 
  value: 3

This fails validation with the message @43,17 node_types["BetterServer"].interfaces["Standard"].operations["create"].inputs["retries"].value: unsupported field This is an example of property refinement within an interface operation. This seems to be allowed by 3.6.10.6. of the 1.3 spec.

tliron commented 2 years ago

This is indeed a bug, but it ended up being rather delicate.

Actually, the issue is that operation inputs are not "properties" but rather "parameters" -- "properties" in TOSCA do not have the "value" keyword. This was an omission on my part because the spec does clearly say that they are parameters. To be honest, I'm not sure why this is the case and it's generally confusing that there is both a "default" and a "value" field. But this is the spec.

Fixing this ended up harder than expected, because I made some assumptions in the code as to where parameters were used. However, it was good to do because it ended up cleaning up some of that code.

pmjordan commented 2 years ago

That looked like alot of work. Thank you.