Commit Graph

22082 Commits

Author SHA1 Message Date
James Bardin a84b4a669a use the open state file for refresh when possible
Only open a new file descriptor for RefreshState if we haven't written a
state, and don't have the correct state open already. This prevents
windows from failing to refresh a locked state.
2018-03-19 18:17:43 -04:00
James Bardin 8fb8b2cffc make sure ReadState returns an error
ReadState would hide any errors, assuming that it was an empty state.
This can mask errors on Windows, where the OS enforces read locks on the
state file.
2018-03-19 18:17:25 -04:00
James Bardin e10a7917e6 add failing test for windows state locks
Refreshing a locked state on windows could return nil if the read path
was locked, no state was yet written, and the read path is the same as
the write path.

Add a test that locks then refreshes a newly initialized state struct.
2018-03-19 17:09:53 -04:00
Brian Flad edd68950c9
Merge pull request #17616 from lrakai/master
Typo Correction
2018-03-19 06:30:03 -04:00
Outsider 815d4db368
website: remove an unnecessary parameter for API 2018-03-18 19:02:05 +09:00
Logan Rakai dd935588f7
Typo Correction 2018-03-18 00:01:30 -06:00
ScottWinkler 60bc16305a tools/terraform-bundle: accept custom plugins from a local directory
To make it easier to include third-party plugins in generated bundles, we'll now search a local directory for available plugins and skip attempting to install from releases.hashicorp.com if a dependency can be satisfied locally.
2018-03-16 16:28:58 -07:00
James Bardin 3fbdee0777 clean up remote.Cmd api
Combine the ExitStatus and Err values from remote.Cmd into an error
returned by Wait, better matching the behavior of the os/exec package.

Non-zero exit codes are returned from Wait as a remote.ExitError.
Communicator related errors are returned directly.

Clean up all the error handling in the provisioners using a
communicator. Also remove the extra copyOutput synchronization that was
copied from package to package.
2018-03-16 14:29:48 -04:00
James Bardin a20dbb4378
Merge pull request #17607 from JoshCooley/patch-1
Spelling correction
2018-03-16 14:21:58 -04:00
Paul Tyng 5fe745b977
Merge pull request #17591 from hashicorp/pt/tfeua
Allow callers to append to user agent
2018-03-16 11:12:24 -04:00
Josh Cooley 426045eb2e
Spelling correction 2018-03-16 09:59:33 -05:00
James Bardin ecec59f0f0 udpate CHANGELOG.md
remove redundant entry.
2018-03-15 17:06:57 -04:00
James Bardin c4e5de7115 release: clean up after v0.11.4 2018-03-15 20:52:58 +00:00
James Bardin 9578557f8f Merge branch 'master' into stable-website 2018-03-15 20:50:52 +00:00
James Bardin 7878d66b38
v0.11.4 2018-03-15 20:35:34 +00:00
Brian Flad c565eb8e7a
Update CHANGELOG for #17484 2018-03-15 16:23:28 -04:00
Brian Flad 077b828902
Merge pull request #17484 from hashicorp/f-validation-ValidateRFC3339TimeString
validation: Add ValidateRFC3339TimeString
2018-03-15 16:22:04 -04:00
James Bardin a17f79167d
Merge pull request #17596 from hashicorp/jbardin/remote-exec-error
fix improper remote-exec timeout and communicator error handling
2018-03-15 16:12:29 -04:00
James Bardin 88e911af45 fix a provisionerFail test which was incorrect
The provisionerFail_createBeforeDestroy test was verifying the incorrect
output. The create_before_destroy instance in the state has an ID of
"bar" with require_new="abc", and a new instance would get an ID of
"foo" with require_new="xyz". The existing test was expecting the
following state:

aws_instance.bar: (1 deposed)
  ID = bar
  provider = provider.aws
  require_new = abc
  Deposed ID 1 = foo (tainted)

Which showed "bar" still the primary instance in the state, with the new
instance "foo" as being the deposed instance, though properly tainted.

The new output is:

aws_instance.bar: (tainted) (1 deposed)
  ID = foo
  provider = provider.aws
  require_new = xyz
  type = aws_instance
  Deposed ID 1 = bar

Showing the new "foo instance as being the primary instance in the
state, with "bar" as the deposed instance.
2018-03-15 16:04:05 -04:00
James Bardin b2d111c2bd return provisioner Apply errors
EvaApplyProvisioners was not returning errors if there was already a
multierror stored in the Error field. Always return the error to the
caller.
2018-03-15 16:04:05 -04:00
James Bardin a1061ed931 update the chef and habitat error handling
Use the new ExitStatus method, and also check the cmd.Err() method for
errors.

Remove leaks from the output goroutines in both provisioners by
deferring their cleanup, and returning early on all error conditions.
2018-03-15 16:04:05 -04:00
James Bardin a715430d24 fix exit status handling in salt-masterless
Convert to the new Cmd.ExitStatus() method in the salt-masterless
provisioner. Add calls to Wait and remove race conditions around setting
the status.
2018-03-15 16:04:00 -04:00
James Bardin b214834834 update the vendored winrm release
This was updated to see if we can get at any error status from the
remote command and transport, which still is not available, but kept the
latest version since it fixes a couple race conditions.
2018-03-15 16:03:40 -04:00
James Bardin af132a186d remove timeout from remote-exec command context
The timeout for the remote command was taken from the wrong config
field, and the connection timeout was being used which is 5 min. Any
remote command taking more than 5 min would be terminated by
disconnecting the communicator. Remove the timeout from the context, and
rely on the global timeout provided by terraform.

There was no way to get the error from the communicator previously, so
the broken connection was silently ignored and the provisioner returned
successfully. Now we can use the new cmd.Err() method to retrieve any
errors encountered during execution.
2018-03-15 16:03:40 -04:00
James Bardin 2d7dc605a0 get communicator errors from a remote.Cmd
The remote.Cmd struct could not convey any transport related error to
the caller, meaning that interrupted commands would show that they
succeeded.

Change Cmd.SetExited to accept an exit status, as well as an error to
store for the caller.  Make the status and error fields internal,
require serialized access through the getter methods.

Users of remote.Cmd should not check both Cmd.Err() and Cmd.ExitStatus()
until after Wait returns.

Require communicators to call Cmd.Init before executing the command.
This will indicate incorrect usage of the remote.Cmd by causing a panic
in SetExitStatus.
2018-03-15 16:03:20 -04:00
Brian Flad 994a78dbc7 validation: Return "invalid RFC3339 timestamp" in ValidateRFC3339TimeString 2018-03-15 12:31:31 -04:00
Paul Tyng 6284f99708
Allow callers to append to user agent 2018-03-15 10:53:44 -04:00
Paul Tyng fb9531b3d9
Rename http client test 2018-03-15 09:48:37 -04:00
Guillaume J. Charmes bfac8e0eec
Update vendor for DeepCopy issue
Signed-off-by: Guillaume J. Charmes <gcharmes@magicleap.com>
2018-03-14 20:13:36 -04:00
Guillaume J. Charmes a4f941368b
Fix issue with deepcopy returning wrong type causing panic
Signed-off-by: Guillaume J. Charmes <gcharmes@magicleap.com>
2018-03-14 19:34:23 -04:00
Martin Atkins ead558261d
Update CHANGELOG.md 2018-03-14 14:59:30 -07:00
James McGill 035d56409f helper/schema: handle TypeMap elem consistently with other collection types
For historical reasons, the handling of element types for maps is inconsistent with other collection types.

Here we begin a multi-step process to make it consistent, starting by supporting both the "consistent" form of using a schema.Schema and an existing erroneous form of using a schema.Type directly. In subsequent commits we will phase out the erroneous form and require the schema.Schema approach, the same as we do for TypeList and TypeSet.
2018-03-14 14:50:41 -07:00
Radek Simko 04899393b0
Update CHANGELOG.md 2018-03-14 18:54:22 +00:00
Radek Simko f6c3e40439
Merge pull request #17463 from hashicorp/b-helper-r-diff-nested-keys
helper/schema: Allow ResourceDiff.ForceNew on nested fields (avoid crash)
2018-03-14 18:53:44 +00:00
Brian Flad 2044f09bb4
Merge pull request #17585 from DeviaVir/patch-1
Fixing small typo in resource/wait.go
2018-03-14 13:23:44 -04:00
Chase 02ff60d083
Fixing small typo in resource/wait.go 2018-03-14 17:33:03 +01:00
Brian Flad 504d5ef233
Merge pull request #17572 from hashicorp/d-getting-started-resource-dependencies-bucket-name
docs/getting-started: Replace underscores in aws_s3_bucket name in dependencies example
2018-03-13 15:22:49 -04:00
Brian Flad 3833e507db
Merge pull request #17571 from hashicorp/d-docs-internal-remote-service-discovery-sidebar
docs/internal: Fix sidebar navigation for Remote Service Discovery page
2018-03-13 15:21:02 -04:00
Brian Flad 4e7c9dd07b docs/getting-started: Replace underscores in aws_s3_bucket name in dependencies example 2018-03-13 12:56:49 -04:00
Brian Flad 9b295e2bc7 docs/internal: Fix sidebar navigation for Remote Service Discovery page 2018-03-13 12:49:49 -04:00
James Bardin 69c323a9f4
Merge pull request #17561 from stack72/manta-backend
backend/manta: Manta Backend was not dealing with a ResourceNotFound
2018-03-13 11:51:01 -04:00
James Bardin 42ae8497e9
Merge pull request #17567 from stack72/dependecies-triton-go-1.1.1
backend/manta: Update triton-go dependency to 1.1.1
2018-03-13 11:50:49 -04:00
stack72 78525fd65a backend/manta: Update triton-go dependency to 1.1.1
This will support the features of RBAC in Manta Backends
2018-03-13 12:10:41 +02:00
Paul Tyng 9442c4b46e
Merge pull request #17551 from hashicorp/paultyng-patch-1
Export a const for validation methods
2018-03-12 19:06:04 -04:00
James Bardin cf887b08b7 update CHANGELOG.md 2018-03-12 15:54:26 -04:00
stack72 a6f76aa0af backend/manta: Manta Backend was not dealing with a ResourceNotFound
Fixes: #17314

We now deal correctly with the creation of the state file - we were
not dealing well with a ResourceNotFound error

Now that this has been changed around, we try and create the statefile
and if there is an error, we look for an existing statefile - previously
this was not the order of operations
2018-03-12 17:27:57 +02:00
Radek Simko 9cef4674c5
Merge pull request #17550 from lrakai/lrakai-patch-module-usage
Grammar Improvement
2018-03-12 10:56:11 +00:00
Paul Tyng 528cbecfce
Make failure message more explicit 2018-03-10 21:53:54 -05:00
Paul Tyng 707d7febe3
Use constants in test 2018-03-10 20:56:13 -05:00
Paul Tyng f18e4f2921
Export a const for validation methods 2018-03-10 12:40:37 -05:00