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

internal/getproviders: Allow basedir for local search to be symlink #25692

Merged
merged 1 commit into from
Aug 18, 2020

Commits on Jul 28, 2020

  1. internal/getproviders: Allow basedir for local search to be symlink

    The SearchLocalDirectory function was intentionally written to only
    support symlinks at the leaves so that it wouldn't risk getting into an
    infinite loop traversing intermediate symlinks, but that rule was also
    applying to the base directory itself.
    
    It's pretty reasonable to put your local plugins in some location
    Terraform wouldn't normally search (e.g. because you want to get them from
    a shared filesystem mounted somewhere) and creating a symlink from one
    of the locations Terraform _does_ search is a convenient way to help
    Terraform find those without going all in on the explicit provider
    installation methods configuration that is intended for more complicated
    situations.
    
    To allow for that, here we make a special exception for the base
    directory, resolving that first before we do any directory walking.
    
    In order to help with debugging a situation where there are for some
    reason symlinks at intermediate levels inside the search tree, we also now
    emit a WARN log line in that case to be explicit that symlinks are not
    supported there and to hint to put the symlink at the top-level if you
    want to use symlinks at all.
    
    (The support for symlinks at the deepest level of search is not mentioned
    in this message because we allow it primarily for our own cache linking
    behavior.)
    apparentlymart committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    a9c3c54 View commit details
    Browse the repository at this point in the history