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

context Refresh and Apply sometimes return nil #13665

Merged
merged 1 commit into from
Apr 14, 2017

Commits on Apr 14, 2017

  1. context Refresh and Apply sometimes return nil

    The documentation for Refresh indicates that it will always return a
    valid state, but that wasn't true in the case of a graph builder error.
    While this same concept wasn't documented for Apply, it was still
    assumed in the terraform apply code.
    
    Since the helper testing framework relies on the absence of a state to
    determine if it can call Destroy, the Context can't can't start
    returning a state in all cases. Document this, and use the State method
    to fetch the correct state value after Apply.
    
    Add a nil check to the WriteState function, so that writing a nil state
    is a noop.
    
    Make sure to init before sorting the state, to make sure we're not
    attempting to sort nil values. This isn't technically needed with the
    current code, but it's just safer in general.
    jbardin committed Apr 14, 2017
    Configuration menu
    Copy the full SHA
    928e606 View commit details
    Browse the repository at this point in the history