Commit Graph

21381 Commits

Author SHA1 Message Date
James Bardin 342c529aa5
v0.11.5 2018-03-21 21:05:10 +00:00
James Bardin 4cdb6dff0b update CHANGELOG.md 2018-03-21 17:02:41 -04:00
James Bardin 47b178aee9
Merge pull request #17645 from hashicorp/jbardin/GH-17462
unlock state in console, import, graph, and push
2018-03-21 12:26:05 -04:00
Sébastien Maccagnoni 31f2e6a463 website: Correct descriptions on provider category pages 2018-03-21 09:17:24 -07:00
James Bardin 90a75422fb unlock state in console, import, graph, and push
The state locking improvements for the regular command had the side
effect of locking the state in the console, import, graph and push
commands. Those commands had been updated to get a state via the
Backend.Context method, which locks the state whenever possible, and now
need to call Unlock directly.

Add Unlock calls to all commands that call Context directly.
2018-03-21 12:13:40 -04:00
James Bardin 40421c30e3
Merge pull request #17646 from hashicorp/jbardin/GH-17638
use correct context for communicator.Retry
2018-03-21 08:34:17 -04:00
James Bardin 56acda00bc add timeout test to remote-exec
Add a test to remote-exec to make sure the proper timeout is honored
during apply.

TODO: we need some test helpers for provisioners, so they can all be
verified.
2018-03-20 14:24:01 -04:00
James Bardin 2954d9849a add some more functionality to MockCommunicator 2018-03-20 14:23:32 -04:00
James Bardin 9b4b5f2a72 use correct context for communicator.Retry
The timeout for a provisioner is expected to only apply to the initial
connection. Keep the context for the communicator.Retry separate from
the global cancellation context.
2018-03-20 13:06:28 -04:00
James Bardin 38e6309f03
Merge pull request #17642 from hashicorp/jbardin/GH-17462
remove more unneeded partial outputs
2018-03-20 11:11:54 -04:00
Brian Flad 5bc83aa111
Merge pull request #17639 from vlad-ro/master
Minor grammar fix.
2018-03-20 07:37:22 -04:00
Sander van Harmelen 36777e3022
Add a line to describe the new Chef provisioner option (#17640) 2018-03-20 12:16:17 +01:00
Sander van Harmelen 45ed0e1f44
Update CHANGELOG.md 2018-03-20 11:55:49 +01:00
Scott Hain 07aeea51da Updates the chef provisioner to allow specifying a channel (#17355)
* Updates the chef provisioner to allow specifying a channel

This also updates the omnitruck url to the current url.

Signed-off-by: Scott Hain <shain@chef.io>

* Update omnitruck URL

Signed-off-by: Scott Hain <shain@chef.io>
2018-03-20 11:51:14 +01:00
James Bardin a5c4f7e08e remove unneeded partial outputs
filterPartialOutputs was not taking into account that some dependent
resources might yet be removed from the graph. Check that they are not
in the targeted set before declaring that the output remain.
2018-03-19 21:20:06 -04:00
James Bardin e5f8adfc1a add failing test for invalid output with targets
Outputs that are missing references aren't always removed from the
graph, due to being filtered before their dependents are removed.
2018-03-19 20:32:37 -04:00
James Bardin 6b6b92f6b3
Merge pull request #17636 from hashicorp/jbardin/windows-refresh-lock
Don't open a new file descriptor for a locked state.
2018-03-19 19:17:12 -04:00
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
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 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 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
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