diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/schema/provider.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/helper/schema/provider.go | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/provider.go b/vendor/github.com/hashicorp/terraform/helper/schema/provider.go index 6cd325d..9702447 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/provider.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/provider.go | |||
@@ -9,7 +9,7 @@ import ( | |||
9 | 9 | ||
10 | "github.com/hashicorp/go-multierror" | 10 | "github.com/hashicorp/go-multierror" |
11 | "github.com/hashicorp/terraform/config" | 11 | "github.com/hashicorp/terraform/config" |
12 | "github.com/hashicorp/terraform/config/configschema" | 12 | "github.com/hashicorp/terraform/configs/configschema" |
13 | "github.com/hashicorp/terraform/terraform" | 13 | "github.com/hashicorp/terraform/terraform" |
14 | ) | 14 | ) |
15 | 15 | ||
@@ -64,6 +64,8 @@ type Provider struct { | |||
64 | stopCtx context.Context | 64 | stopCtx context.Context |
65 | stopCtxCancel context.CancelFunc | 65 | stopCtxCancel context.CancelFunc |
66 | stopOnce sync.Once | 66 | stopOnce sync.Once |
67 | |||
68 | TerraformVersion string | ||
67 | } | 69 | } |
68 | 70 | ||
69 | // ConfigureFunc is the function used to configure a Provider. | 71 | // ConfigureFunc is the function used to configure a Provider. |
@@ -251,7 +253,7 @@ func (p *Provider) Configure(c *terraform.ResourceConfig) error { | |||
251 | 253 | ||
252 | // Get a ResourceData for this configuration. To do this, we actually | 254 | // Get a ResourceData for this configuration. To do this, we actually |
253 | // generate an intermediary "diff" although that is never exposed. | 255 | // generate an intermediary "diff" although that is never exposed. |
254 | diff, err := sm.Diff(nil, c, nil, p.meta) | 256 | diff, err := sm.Diff(nil, c, nil, p.meta, true) |
255 | if err != nil { | 257 | if err != nil { |
256 | return err | 258 | return err |
257 | } | 259 | } |
@@ -296,6 +298,20 @@ func (p *Provider) Diff( | |||
296 | return r.Diff(s, c, p.meta) | 298 | return r.Diff(s, c, p.meta) |
297 | } | 299 | } |
298 | 300 | ||
301 | // SimpleDiff is used by the new protocol wrappers to get a diff that doesn't | ||
302 | // attempt to calculate ignore_changes. | ||
303 | func (p *Provider) SimpleDiff( | ||
304 | info *terraform.InstanceInfo, | ||
305 | s *terraform.InstanceState, | ||
306 | c *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { | ||
307 | r, ok := p.ResourcesMap[info.Type] | ||
308 | if !ok { | ||
309 | return nil, fmt.Errorf("unknown resource type: %s", info.Type) | ||
310 | } | ||
311 | |||
312 | return r.simpleDiff(s, c, p.meta) | ||
313 | } | ||
314 | |||
299 | // Refresh implementation of terraform.ResourceProvider interface. | 315 | // Refresh implementation of terraform.ResourceProvider interface. |
300 | func (p *Provider) Refresh( | 316 | func (p *Provider) Refresh( |
301 | info *terraform.InstanceInfo, | 317 | info *terraform.InstanceInfo, |
@@ -311,7 +327,7 @@ func (p *Provider) Refresh( | |||
311 | // Resources implementation of terraform.ResourceProvider interface. | 327 | // Resources implementation of terraform.ResourceProvider interface. |
312 | func (p *Provider) Resources() []terraform.ResourceType { | 328 | func (p *Provider) Resources() []terraform.ResourceType { |
313 | keys := make([]string, 0, len(p.ResourcesMap)) | 329 | keys := make([]string, 0, len(p.ResourcesMap)) |
314 | for k, _ := range p.ResourcesMap { | 330 | for k := range p.ResourcesMap { |
315 | keys = append(keys, k) | 331 | keys = append(keys, k) |
316 | } | 332 | } |
317 | sort.Strings(keys) | 333 | sort.Strings(keys) |