Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tosca 1.3 override requirements in node_type #138

Open
DYDKA4 opened this issue Feb 1, 2023 · 2 comments
Open

Tosca 1.3 override requirements in node_type #138

DYDKA4 opened this issue Feb 1, 2023 · 2 comments

Comments

@DYDKA4
Copy link

DYDKA4 commented Feb 1, 2023

Why are requirements is list? So I can't override requirements via derived from mechanism. Can you explain why requirements is list? I think, that requirements should be dict and capability, node, relationship could be list.

@tliron
Copy link
Contributor

tliron commented Feb 1, 2023

This is a good question and we've debated it quite a lot. I think it was decided in order to keep the requirement definitions in the same syntactical structure as the requirement assignments. However, grammatically they are quite different. In the node type it's a "sequenced list" meaning that a name can only appear once. So it's essentially equivalent to a map, and you can override it this way. But in a node template the same requirement name can appear more than once, because we are assigning individual requirements.

I am in favor of changing requirement definitions in node types to be a map.

@lauwers
Copy link
Contributor

lauwers commented Feb 8, 2023

As a rule of thumb, TOSCA uses lists whenever the order matters, which is definitely the case for requirements. A type designer may require that an orchestrator fulfill requirements in a specific order, e.g. when a node filter for requirement A uses a property value of a target node selected for requirement B. In that case, requirement B must be fulfilled before requirement A can be fulfilled. By organizing requirement definitions in a list, this ordering can be guaranteed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants