Circular references in templates are not caught in validation

Bug #1691575 reported by Zane Bitter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Zane Bitter

Bug Description

The patch https://review.openstack.org/#/c/291021/ avoids calculating the dependencies in the template_validate command.

Iterating over the dependencies is an important part of validation, because if there's a circular reference this is how you find it.

The following template should give an error on validation, but does not, although it would have prior to Mitaka:

heat_template_version: 2017-02-24
resources:
  res1:
    type: OS::Heat::None
    depends_on: res3

  res2:
    type: OS::Heat::None
    depends_on: res1

  res3:
    type: OS::Heat::None
    depends_on: res2

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/465760

Changed in heat:
status: Triaged → In Progress
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-2 → pike-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/465760
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=76aa7c87cb45374e2bfafb8b81a5b0ba69ee451e
Submitter: Jenkins
Branch: master

commit 76aa7c87cb45374e2bfafb8b81a5b0ba69ee451e
Author: Zane Bitter <email address hidden>
Date: Fri Jul 21 10:26:07 2017 -0400

    Check for circular dependencies in template validation

    We ought to iterate over the dependency list in the validate_template call,
    to check for any circular dependencies. This check was removed by
    d12cbe7959df33ccbba31878b3049b169db86857 in order to avoid trying to
    calculate implicit dependencies added by resource plugins (as e.g. many
    Neutron resources do) at a time when we don't have sufficient data to do a
    good job of it anyway.

    However, the previous patch d12cbe7959df33ccbba31878b3049b169db86857 split
    apart the calculation of explicit and implicit dependencies, so we can
    easily do this while still checking for circular references in the
    explicit dependencies. This patch splits the dependency calculation into
    two phases - the first using only data available from the template, and the
    second querying the resources for implicit dependencies.

    Use strict_validate = False as the criterion for when to avoid calculating
    implicit dependencies, since this corresponds exactly to when we don't have
    enough data to do so.

    Change-Id: I21c63dcc8d1cad20dbc237b472670753779b0ff8
    Closes-bug: #1691575

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 9.0.0.0b3

This issue was fixed in the openstack/heat 9.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.