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

store absolute addresses for resource dependencies in the state #23252

Merged
merged 8 commits into from
Nov 8, 2019

Commits on Oct 30, 2019

  1. change state dependencies to AbsResource addrs

    We need to be able to reference all possible dependencies for ordering
    when the configuration is no longer present, which means that absolute
    addresses must be used. Since this is only to recreate the proper
    ordering for instance destruction, only resources addresses need to be
    listed rather than individual instance addresses.
    jbardin committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    2c3c011 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2019

  1. read+write the new dependencies in the statefile

    The test fixture did not like having modules when using the generic json
    map, so read and compare the states in the final *File datastructure.
    jbardin committed Nov 7, 2019
    Configuration menu
    Copy the full SHA
    5a0a002 View commit details
    Browse the repository at this point in the history
  2. make use of the new state Dependencies

    Make use of the new Dependencies field in the instance state.
    
    The inter-instance dependencies will be determined from the complete
    reference graph, so that absolute addresses can be stored, rather than
    just references within a module. The Dependencies are added to the node
    in the same manner as state, i.e. via an "attacher" interface and
    transformer.  This is because dependencies are calculated from the graph
    itself, and not from the config.
    jbardin committed Nov 7, 2019
    Configuration menu
    Copy the full SHA
    42bb4a6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    16b368e View commit details
    Browse the repository at this point in the history
  4. fixup some test comparisons

    jbardin committed Nov 7, 2019
    Configuration menu
    Copy the full SHA
    886af20 View commit details
    Browse the repository at this point in the history
  5. append dependencies during refresh

    Refresh should load any new dependencies found because of configuration
    or state changes, but retain any dependencies already in the state.
    Orphaned resources would not be in config, but we do not want to lose
    the destroy ordering for the later apply.
    jbardin committed Nov 7, 2019
    Configuration menu
    Copy the full SHA
    5e16e8e View commit details
    Browse the repository at this point in the history
  6. failing test for update from orphaned instance

    Updates resulting from orphaned instances should happen after the
    deletion of the instances.
    jbardin committed Nov 7, 2019
    Configuration menu
    Copy the full SHA
    10152da View commit details
    Browse the repository at this point in the history
  7. use Dependencies to connect creator and destroyer

    The DestroyEdgeTransformer cannot determine ordering from the graph when
    the destroyers are from orphaned resources, because there are no
    references to resolve. The new stored Dependencies provides what we need
    to connect the instances in this case.
    
    We also add the StateDependencies method directly in the
    GraphNodeResourceInstance interface, since all instances already
    implement this, and we don't need another optional interface to check.
    
    The old code in DestroyEdgeTransformer may no longer be needed in the
    long run, but that can be determined separately, since too many of the
    tests start with an incomplete state and rely on the Dependencies being
    determined from the configuration alone.
    jbardin committed Nov 7, 2019
    Configuration menu
    Copy the full SHA
    46dbb3d View commit details
    Browse the repository at this point in the history