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

Module Expansion Activate! #24461

Merged
merged 15 commits into from
Mar 26, 2020
Merged

Module Expansion Activate! #24461

merged 15 commits into from
Mar 26, 2020

Commits on Mar 25, 2020

  1. add EvalContext.WithPath

    As the Graph is walked, the current way to set the context path was to
    have the walker return a context from EnterPath. This required that
    every node know it's absolute path, which can no longer be the case
    during plan when modules have not been expanded.
    
    This introduces a new method called WithPath, which returns a copy of
    the context with the internal path updated to reflect the method
    argument. Any use of the EvalContext that requires knowing the path will
    now panic if it wasn't explicitly set to ensure that evaluations always
    occur in the correct path.
    
    Add EvalContext to the GraphWalker interface.
    EvalContext returns an EvalContext that has not yet set a path. This
    will allow us to enforce that all context operations requiring a module
    instance path will require that a path be explicitly set rather than
    evaluating within the wrong path.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    0b025d7 View commit details
    Browse the repository at this point in the history
  2. expand planned resources

    While the Expander itself now handles the recursive expansion of
    modules, Resources themselves still need to be expanded twice, because
    the evaluation of the Resource, which entails evaluating the for_each or
    count expressions, is separate from the ResourceInstance expansion.
    
    Add a nodeExpandPlannableResource to do handle this expansion to allow
    all NodePlannableResources to call EvalWriteResourceState with an
    absolute address.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    40f0902 View commit details
    Browse the repository at this point in the history
  3. create nodeExpandApplyableResource

    Resources also need to be expanded during apply, which cannot be done
    via EvalTree due to the lack of EvalContext.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    23cebc5 View commit details
    Browse the repository at this point in the history
  4. NewNodeAbstractResource accepts a ResourceConfig

    Use the new addrs type here.
    
    Also remove the uniqueMap from the config transformer. We enforce
    uniqueness during config loading, and this is more likely to have false
    positives due to stringification than anything.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    0b85eea View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    74d85aa View commit details
    Browse the repository at this point in the history
  6. create refresh node expanders

    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    0afa371 View commit details
    Browse the repository at this point in the history
  7. use addrs.ConfigResource for dependency tracking

    We can't get module instances during transformation, so we need to
    reduce the Dependencies to using `addrs.ConfigResource` for now.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    b3fc0da View commit details
    Browse the repository at this point in the history
  8. remove UnkeyedInstanceShim from some provider nodes

    Remove the shims where they aren't necessary from the Init and Close
    provider nodes. This also removed some provider path checks from the
    builtin eval context, which cannot be resolved since the context may not
    be created with a ModuleInstance path.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    2474b87 View commit details
    Browse the repository at this point in the history
  9. cleanup some expanders

    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    7f0199b View commit details
    Browse the repository at this point in the history
  10. orphan resources needs to use AbsResource

    The expand logic was separated into
    nodeExpandRefreshableManagedResource, but the orphan logic wasn't
    updated.
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    8eb3f2c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    cd045f6 View commit details
    Browse the repository at this point in the history
  12. module expansion test

    simplify the test a bit and add a few more combinations to the config
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    04a117b View commit details
    Browse the repository at this point in the history
  13. don't log path in EvalRaw

    eval nodes no longer always have a context path
    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    5810261 View commit details
    Browse the repository at this point in the history
  14. comment updates

    jbardin committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    4f1692c View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2020

  1. comment update and remove extra Name method

    This name method won't be called in the full graph, and remove it to
    prevent confusion with the parent node in logs.
    jbardin committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    cec989d View commit details
    Browse the repository at this point in the history