Closed philippemerle closed 3 years ago
Condition clauses are a big TODO! I will work on implementing them.
For now I have implemented proper parsing and validation, but normalization remains a TODO.
This is somewhat challenging because the attribute name ... well, there's no way of validating that the target nodes actually have that attribute until runtime.
Thank you Tal.
This is somewhat challenging because the attribute name ... well, there's no way of validating that the target nodes actually have that attribute until runtime.
I think you could validate at compile time as 'state' is a declared attribute of the 'tosca.nodes.Root' type and its type is string compatible with the 'started' constant string passed to 'equal'.
But what if you don't use a node that derives from root? And what if you include nodes as your policy targets that derive from various hierarchies? The validation check would have to be done for each node type independently.
But I'm not sure it needs be validated. You could consider any node that doesn't have the attribute to immediately fail the condition. That seems reasonable to me and more flexible because it exactly allows the trigger to be filtered in this way. Remember that we are dealing with attribute assertions here, so it's only at runtime that they can be asserted anyway.
The spec is unclear about this. It's up to us to interpret its spirit.
The following template:
is not supported by puccini 0.18.0:
These four condition clause definitions should be supported, shouldn't them?