Skip to content

resolve-loop

This test is of type template.

Service Template

The following service template is used.

tests/query/resolve-loop/template.yaml
tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
    node_templates:
        webapp:
            type: WebApplication
            properties:
                db_username: executeQuery(SELECT node_templates.webapp.properties.db_password)
                db_password: executeQuery(SELECT node_templates.webapp.properties.db_username)
                port:
            requirements:
                - database_endpoint: mysql_database
                - host: tomcat
        tomcat:
            type: Tomcat
            requirements:
                - host: vm_1
        mysql_database:
            type: Database
            properties:
                username: user
                password: password
            requirements:
                - my_db_connection: dbms
        dbms:
            type: DBMS
            requirements:
                - host: vm_2
        vm_1:
            type: VirtualMachine
            requirements:
                - host: openstack
        vm_2:
            type: VirtualMachine
            requirements:
                - host: openstack
        openstack:
            type: Compute
            capabilities:
                host:
                    properties:
                        num_cpus: 1
                        mem_size: 2 GB
            os:
                properties:
                    type: linux
                    distribution: ubuntu
    groups:
        database_group:
            type: tosca.groups.Root
            members:
                - mysql_database
                - dbms
    policies:
        - placement_policy:
              type: tosca.policies.placement
              targets:
                  - vm_1
                  - vm_2

Expected Error

The following error is expected to be thrown.

Circular dependencies detected. Unable to resolve queries in your template.

Last update: November 18, 2024