From 8a1089a161b1d6c1ecf29e3c4624713dd622a2b5 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 6 Apr 2017 10:39:59 -0400 Subject: [PATCH] convert the other context keys to the correct type --- helper/schema/backend.go | 2 +- helper/schema/provisioner.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/helper/schema/backend.go b/helper/schema/backend.go index 4ac2085f8..a0729c02c 100644 --- a/helper/schema/backend.go +++ b/helper/schema/backend.go @@ -29,7 +29,7 @@ type Backend struct { } var ( - backendConfigKey = contextKey("data") + backendConfigKey = contextKey("backend config") ) // FromContextBackendConfig extracts a ResourceData with the configuration diff --git a/helper/schema/provisioner.go b/helper/schema/provisioner.go index 6ac3fc1bf..c1564a215 100644 --- a/helper/schema/provisioner.go +++ b/helper/schema/provisioner.go @@ -46,25 +46,25 @@ type Provisioner struct { stopOnce sync.Once } -// These constants are the keys that can be used to access data in -// the context parameters for Provisioners. -const ( - connDataInvalid int = iota +// Keys that can be used to access data in the context parameters for +// Provisioners. +var ( + connDataInvalid = contextKey("data invalid") // This returns a *ResourceData for the connection information. // Guaranteed to never be nil. - ProvConnDataKey + ProvConnDataKey = contextKey("provider conn data") // This returns a *ResourceData for the config information. // Guaranteed to never be nil. - ProvConfigDataKey + ProvConfigDataKey = contextKey("provider config data") // This returns a terraform.UIOutput. Guaranteed to never be nil. - ProvOutputKey + ProvOutputKey = contextKey("provider output") // This returns the raw InstanceState passed to Apply. Guaranteed to // be set, but may be nil. - ProvRawStateKey + ProvRawStateKey = contextKey("provider raw state") ) // InternalValidate should be called to validate the structure