Commit Graph

20211 Commits

Author SHA1 Message Date
James Bardin e3e6eee311 Merge pull request #15691 from hashicorp/jbardin/changelog
update CHANGELOG for 0.10.0
2017-08-02 11:41:45 -04:00
James Bardin 6134082a10 update CHANGELOG for 0.10.0 2017-08-02 11:32:13 -04:00
Jake Champlin 270bbdb19b
core: Add `GetOkRaw` schema function
Adds `GetOkRaw` as a schema function. This should only be used to verify
boolean attributes are either set or not set, regardless of their zero
value for their type. There are a few small use cases outside of the boolean
type where this will be helpful as well.

Overall, this shouldn't detract from the zero-value checks that `GetOK()`
currently has, and should only be used when absolutely needed. However,
there are enough use-cases for this addition without checking for the
zero-value of the type, that this is needed.

Primary use case is for a boolean attribute that is `Optional` and `Computed`,
without a default value. There's currently no way to verify that the boolean
attribute was explicitly set to the zero-value literal with the current
`GetOk()` function. This new function allows for that check, keeping the
`Computed` check for the returned `exists` boolean.

```
$ make test TEST=./helper/schema TESTARGS="-run=TestResourceDataGetOkRaw"
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/08/02 11:17:32 Generated command/internal_plugin_list.go
go test -i ./helper/schema || exit 1
echo ./helper/schema | \
        xargs -t -n4 go test -run=TestResourceDataGetOkRaw -timeout=60s -parallel=4
go test -run=TestResourceDataGetOkRaw -timeout=60s -parallel=4 ./helper/schema
ok      github.com/hashicorp/terraform/helper/schema    0.005s
```
2017-08-02 11:18:59 -04:00
Clint 9b9bfb9fec Add provider dev program guide (#15677)
* Add provider dev program guide

Requires assets from https://github.com/hashicorp/terraform-website/pull/12

* editing from feedback

* add spaces after ##
2017-08-02 09:54:26 -05:00
James Bardin 07b0101fb5 update workspace new test for inmem backend
The existing test assumed local state files.
2017-08-01 19:34:22 -04:00
James Bardin 32ae05c342 fix strict remote.State lineage check
We can't check lineage in the remote state instance, because we may need
to overwrite a state with a new lineage. Whil it's tempting to add an
optional interface for this, like OverwriteState(), optional interfaces
are never _really_ optional, and will have to be implemented by any
wrapper types as well.

Another solution may be to add a State.Supersedes field to indicate that
we intend to replace an existing state, but that may not be worth the
extra check either.
2017-08-01 19:34:22 -04:00
James Bardin c3e943bed2 add another failing test for remote.State lineage
Want to make sure we don't hit this again.
2017-08-01 19:34:21 -04:00
James Bardin 16e8e405c7 create failing test cases for remote lineage issue
Some remote backend would fail on `-state push -force`, or `workspace
new -state` because of a new strict lineage check in remote.State.
2017-08-01 19:34:21 -04:00
James Bardin 18d71f273e make inmem behave more like remote backends
When remote backend imeplemtations create a new named state, they may
need to acquire a lock and/or save an actual empty state to the backend.
Copy this behavior in the inmem backend for testing.
2017-08-01 19:34:21 -04:00
James Bardin 5deef9621d export Reset()
This package is used for testing, so there needs to be an easy method
for reinitializing the stored data between tests.
2017-08-01 19:34:21 -04:00
James Bardin ac60ddcd40 Support named states in inmeme backend
Used to expand test coverage
2017-08-01 19:34:21 -04:00
clint shryock 6a869f89bf fix broken/old link in Commands/Workspace 2017-08-01 17:49:32 -05:00
James Bardin 470448d8ce update CHANGELOG.md 2017-07-31 18:41:48 -04:00
James Bardin efb007542b Merge pull request #15666 from hashicorp/f-init-from-module
command: terraform init -from-module=...
2017-07-31 09:32:17 -04:00
James Bardin d02b4fd9b8 Merge pull request #15664 from hashicorp/jbardin/s3-backend-docs
Update S3 backend docs to reflect new workspaces
2017-07-31 09:08:14 -04:00
Martin Atkins 8a7a0a7459 command: terraform init -from-module=...
This restores the earlier behavior of the first positional argument to
terraform init in 0.9, but as a command line option.

The positional argument was removed to improve consistency with other
commands that take a working directory as their first positional argument.
It was originally intended that this functionality would return in a
later release along with some other general improvements to Terraform's
module handling, but we're introducing here an interim solution that
uses the existing module source concept, to allow for easier porting of
workflows that previously depended on the automatic copy behavior.

In a future release this feature may change again as the module
improvements design firms up, but we expect it to be broadly compatible
with this temporary state.
2017-07-28 15:23:29 -07:00
James Bardin f63b216016 Update S3 backend docs to reflect new workspaces
Explain the path generated for state files when using workspaces.
2017-07-28 15:08:24 -04:00
James Bardin ca68723c91 memoize DiffFieldReader.ReadField
The field reader code path is extremely inefficient, but refactoring
it all is much to invasive a change at the moment.

Have DiffFieldReader internally cache results for ReadField.
2017-07-28 14:26:36 -04:00
James Bardin 51547ad2ba add tests for state commands through a backend 2017-07-27 18:06:47 -04:00
James Bardin 5b4ae36cb0 don't print help for state loading errors
These already include detailed messages, and it's not a usage issue,
it's a config or file location issue.
2017-07-27 18:06:47 -04:00
James Bardin 2e7c8ab76a update commands.go to use StateMeta 2017-07-27 18:06:47 -04:00
James Bardin 33ba6774e0 Make the state commands use the real command.Meta
In order to use a backend for the state commands, we need an initialized
meta. Use a single Meta instance rather than temporary ones to make sure
the backends are initialized properly.
2017-07-27 15:33:50 -04:00
James Bardin 45a9edb763 make state mv and rm work with remote states
The default value for the -state flag was overriding the location of any
remote state.
2017-07-27 09:41:39 -04:00
Jake Champlin 870617d22d Merge pull request #15634 from fossabot/master
Add license scan report and status
2017-07-25 17:31:56 -04:00
fossabot d6baeef3d7 Add license scan report and status 2017-07-25 14:24:46 -07:00
Martin Atkins 5be673f996 Update README logo URL
This now uses the canonical location for the logo image on the main Terraform website.

(The image isn't actually there at the time of this commit, but will be published here as
part of updating the website for the 0.10.0 release.)
2017-07-25 13:49:08 -07:00
Martin Atkins 23ef0e3247 website: more-elaborate "terraform init" docs
The "terraform init" command has a lot of different functionality now,
making it hard to follow all of the options in the previous presentation.
Instead, here we describe each of the steps and its associated options
separately, hopefully making it easier to understand what each option
relates to.

In addition, much of the detail around backend partial configuration is
factored out into the backend configuration page, where it seems more
"at home"; previously it felt hard to follow exactly how partial
configuration would be used, due to the information on it being split over
two different pages.
2017-07-25 08:25:49 -07:00
Martin Atkins 539f0db74e examples: remove openstack example
This has now moved into the openstack provider repository, linked from
the README here.
2017-07-24 16:02:13 -07:00
Martin Atkins d32a0e8e1f examples: remove digitalocean example
This has now moved into the digitalocean provider repository, linked from
the README here.
2017-07-24 15:50:21 -07:00
Martin Atkins 590bbe9b31 examples: Remove the consul example
This is now in the consul provider repository, linked from the README
here.
2017-07-24 15:32:47 -07:00
Martin Atkins 583c24a3c2 examples: Update README to reflect 0.10 init/apply workflow
Previous instructions assumed the pre-0.9 version of init, which served
a different purpose.
2017-07-24 15:23:49 -07:00
Martin Atkins 0e0c7883e4 examples: Remove the clc example
This has now moved into the repository for the CenturyLink Cloud provider,
linked from the README here.
2017-07-24 15:20:11 -07:00
Martin Atkins 3b95c85f18 examples: Remove the Google Cloud examples
These are now in the provider's own repository, linked from the README
here.
2017-07-24 15:08:40 -07:00
seph 29ebe07e1e Update link to the AWS example 2017-07-24 14:52:29 -05:00
Jake Champlin 0c69e46649 Update CHANGELOG.md 2017-07-24 11:15:01 -04:00
Jake Champlin f98cfc9018 Merge pull request #15617 from svanharmelen/b-chef-provisioner
provisioner/chef: fix panic
2017-07-24 09:14:13 -06:00
protondonor fc3782f051 Document failure behavior for `import` command.
- Remove link to issue 11835.
2017-07-22 08:48:19 -07:00
protondonor 1069aab47a Document changes to terraform import in the release notes.
- Documentation based on the commit message for the change
(9a398a7793)
2017-07-22 08:48:19 -07:00
Sander van Harmelen b01f68f343 provisioner/chef: fix panic
Fixes #15431
Fixes #15500
2017-07-22 09:58:58 +02:00
Martin Atkins e079e9d339 examples: remove azure examples
These have now moved into the AzureRM provider repository, linked from the
README here.
2017-07-21 17:53:10 -07:00
Martin Atkins 9be103b62d examples: Remove AliCloud and AWS examples
The examples for these providers have moved into the providers' own
repositories, so this is just cleaning up the old copies in the main repo
to avoid any confusion caused by the duplication.

The examples readme has links to these provider-specific examples so that
people looking for them in the old location can still find them.
2017-07-21 16:51:24 -07:00
James Bardin 1070d04b07 Remove consul context adapter for RenewPeriodic
Updated the vendored consul which no longer requires the channel adapter
to convert a `chan stuct{}` to a `<-chan struct{}`.

Call testutil.NewTestServerConfigT with the new signature.
2017-07-20 11:09:45 -04:00
James Bardin 7584ac1247 update consul vendor 2017-07-20 11:09:45 -04:00
James Bardin 0bca383b6b Merge pull request #15528 from alrs/command-swallowed-errors
Fix swallowed errors in command package.
2017-07-20 08:57:10 -04:00
Lars Lehtonen 822a98a0b4
Fix swallowed tests in terraform package tests 2017-07-20 02:23:43 -07:00
Jake Champlin c40be7cd14 Merge pull request #15598 from alrs/helper-swallowed-error
Fix swallowed err in acctest package
2017-07-20 00:33:15 -06:00
Lars Lehtonen e34f194b31
Fix swallowed err in acctest package 2017-07-19 16:24:41 -07:00
Lars Lehtonen 119996b815
Return immediately after newly-added error condition 2017-07-19 15:46:21 -07:00
Martin Atkins 8666d36609 Merge #15596: docker image build configurations 2017-07-19 15:04:24 -07:00
Martin Atkins 1fac5de738 release: clean up after v0.10.0-rc1 2017-07-19 14:07:06 -07:00