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

helper/schema: CoreConfigSchema refinements #19478

Merged
merged 3 commits into from
Nov 27, 2018
Merged

Commits on Nov 26, 2018

  1. helper/schema: Tell Core attribute is optional if set conditionally

    The SDK has a mechanism that effectively makes it possible to declare an
    attribute as being _conditionally_ required, which is not a concept that
    Terraform Core is aware of.
    
    Since this mechanism is in practice only used for a small UX improvement
    in prompting for these values interactively when the environment variable
    is not set, we avoid here introducing all of this complexity into the
    plugin protocol by just having the provider selectively modify its schema
    if it detects that such an attribute might be set dynamically.
    
    This then prevents Terraform Core from validating the presence of the
    argument or prompting for a new value for it, allowing the null value to
    pass through into the provider so that the default value can be generated
    again dynamically.
    
    This is a kinda-kludgey solution which we're accepting here because the
    alternative would be a much-more-complex two-pass decode operation within
    Core itself, and that doesn't seem worth it.
    
    This fixes #19139.
    apparentlymart committed Nov 26, 2018
    Configuration menu
    Copy the full SHA
    3f61eda View commit details
    Browse the repository at this point in the history
  2. helper/schema: Better mimic some undocumented behaviors in Core schema

    Since the SDK's schema system conflates attributes and nested blocks, it's
    possible to state some nonsensical schema situations such as:
    
    - A nested block is both optional but has MinItems > 0
    - A nested block is entirely computed but has MinItems or MaxItems set
    
    Both of these weird situations are handled here in the same way that the
    existing helper/schema validation code would've handled them: by
    effectively disabling the MinItems/MaxItems checks where they would've
    been ignored before.
    
    the MinItems/MaxItems
    apparentlymart committed Nov 26, 2018
    Configuration menu
    Copy the full SHA
    0b9d2a5 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2018

  1. helper/schema: Update docs for PromoteSingle

    This is no longer effective and should not be used in any new schema.
    apparentlymart committed Nov 27, 2018
    Configuration menu
    Copy the full SHA
    055fde8 View commit details
    Browse the repository at this point in the history