Commit Graph

26371 Commits

Author SHA1 Message Date
jessica-ritter edbf59ed4c
what happens when prefix is not in string
https://github.com/hashicorp/terraform/blob/master/lang/functions.go#L126 shows that Terraform's Trimprefix comes directly from the standard go library. 
When prefix is absent in the go standard library, the original string is returned; https://golang.org/pkg/strings/#TrimPrefix.
2020-06-22 11:31:08 -07:00
Alisdair McDiarmid 43737f2f4f
Update CHANGELOG.md 2020-06-22 13:11:07 -04:00
Alisdair McDiarmid 6198b8a4f1
Merge pull request #25334 from hashicorp/alisdair/fix-nested-provider-requirements
configs: Fix nested provider requirements bug
2020-06-22 13:07:32 -04:00
Alisdair McDiarmid 45f7da9678 configs: Fix nested provider requirements bug
In a recent PR, we changed the provider requirements code to permit
per-module requirements gathering, to enhance the provider command
output. This had an incorrect implementation of recursive requirements
gathering for the normal case, which resulted in only depth-1 modules
being inspected.

This commit fixes the broken recursion and adds a grandchild module to
the unit tests as test coverage. This also demanded fixing the
testNestedModuleConfigFromDir helper function to cope with nested
modules in test configs.
2020-06-22 12:16:22 -04:00
James Bardin 06493d791b
Merge pull request #25302 from hashicorp/jbardin/data-source-plan
Hide empty plans for misbehaving data resource
2020-06-22 12:04:37 -04:00
James Bardin ff91a2257b
Merge pull request #25297 from hashicorp/jbardin/terraform-remote-state
don't set remote workspace in state
2020-06-22 12:04:19 -04:00
Alisdair McDiarmid 69b94ec149
Update CHANGELOG.md 2020-06-22 09:48:13 -04:00
Alisdair McDiarmid 2fdde395ea
Merge pull request #25299 from hashicorp/alisdair/fix-command-fixture-modify-in-place
command: Fix command fixture modify-in-place bugs
2020-06-22 09:47:04 -04:00
James Bardin f433228906 hide empty plans for misbehaving data resource
If a data source is storing a value that doesn't comply precisely with
the schema, it will now show up as a perpetual diff during plan.

Since we can easily detect if there is no resulting change from the
stored value, rather than presenting a planned read each time, we can
change the plan to a NoOp and log the incongruity as a warning.
2020-06-18 19:21:19 -04:00
Alisdair McDiarmid 820ed48813 command: Fix init flags silent exit bug
When using `-flag=value` with Powershell, unquoted values are broken
into separate arguments. This means that the following command:

  terraform init -backend-config=./backend.conf

is interpreted by Terraform as:

  terraform init -backend-config= ./backend.conf

This results in an empty backend-config setting (which is semantically
valid!) followed by a custom configuration path (pointing at a file).

Due to a bug where we could exit without printing diagnostics, this
would result in a silent failure that was very difficult to diagnose.
2020-06-18 17:58:45 -04:00
Alisdair McDiarmid 0ed04d05aa command: Fix command fixture modify-in-place bugs
Some of the tests in the command package were running directly on the
fixture directories, and modifying or locking files within them. This
could cause state to leak between tests.

This commit cleans up all such cases that I could find.
2020-06-18 17:09:20 -04:00
James Bardin fb06063b2b don't set remote workspace in state
The workspace attribute is not computed, and cannot be changed from the
configuration.
2020-06-18 16:34:57 -04:00
Martin Atkins dc8fd14c1e website: "Provider Requirements" documentation
We previously covered everything about using providers on a single page,
but that was getting unwieldy already and we now have a lot more to
discuss with v0.13 introducing a new source address syntax and some other
concepts.

Here we split the provider-related content into two parts: "Provider
Requirements" covers how to find and declare dependencies on providers,
and then "Provider Configuration" (formerly just "Providers") then focuses
primarily on how to write zero or more provider configurations for a
particular provider.

Because "Provider Requirements" is now presented before "Provider
Configuration" in the navigation, I've also moved some of the introductory
content about providers in general onto the "Requirements" page. The
first paragraph of that content is duplicated onto the "Configuration"
page for discoverability, but we now link to the requirements page to get
the full story.
2020-06-18 09:31:52 -07:00
Nick Fagerlund b1eb9dcfcf website: Configuration Language navigation refactoring
The "Configuration Language" section was becoming rather unweildy, both
by having a lot of pages and by some of the pages being quite large in
themselves.

This is a first step towards breaking things up a little more, starting
with two changes:

 - The "Configuration Language" navigation is now split into two
   sub-headings "Configuration Blocks" and "Syntax".

 - Some of the information about sub-blocks of the "terraform" block are
   now given their own pages, because their content is quite complex
   in itself.

 - "Version Constraints" is now a page in its own right, rather than this
   content being duplicated in slightly different forms across multiple
   contexts that make use of user-specified version constraints.
2020-06-18 09:31:52 -07:00
Matt Schuchard 86a511e257
update hcl language markdown to terraform markdown 2020-06-18 12:30:36 -04:00
Alisdair McDiarmid aefead2207
Update CHANGELOG.md 2020-06-18 10:29:58 -04:00
Alisdair McDiarmid c12ad38c5d
Merge pull request #25277 from hashicorp/alisdair/fix-terraform-version-version
command: Fix bug with -v/-version/--version flags
2020-06-18 10:21:31 -04:00
Chris Griggs ea24faa9ac
Merge pull request #25290 from hashicorp/cgriggs01-azuredevops
[Website] Azure DevOps provider links
2020-06-18 07:04:30 -07:00
Chris Griggs 207b10278a [Website] Azure DevOps provider links 2020-06-18 06:51:32 -07:00
Chris Griggs bc569eb083
Merge pull request #25278 from hashicorp/cgriggs01-mso
[Website] Cisco MSO provider links
2020-06-17 14:27:31 -07:00
Chris Griggs 24e1c9eff5 [Website] Cisco MSO provider links 2020-06-17 14:00:20 -07:00
Alvin Huang d4c055dea4
Merge pull request #25275 from hashicorp/ci/fix-go-mod-updating
don't update deps of gox in docker build and use -mod=readonly
2020-06-17 16:25:20 -04:00
Alvin Huang ada89661d5 don't update deps of gox in docker build and use -mod=readonly 2020-06-17 15:34:30 -04:00
Alisdair McDiarmid 163c943e9b command: Fix bug with -v/-version/--version flags
We globally support a -v/-version/--version flag, which triggers the
version subcommand. The recent introduction of JSON output support meant
we started parsing the flags for the first time, but we didn't add flags
for these global version arguments.

This commit adds those flags (but doesn't check them, since they have no
effect on the version command itself). Also adds usage information for
terraform version.
2020-06-17 15:24:15 -04:00
hashicorp-ci d144c391fa Cleanup after v0.13.0-beta2 release 2020-06-17 18:36:14 +00:00
hashicorp-ci 3e164035b6
Release v0.13.0-beta2 2020-06-17 18:10:32 +00:00
Alvin Huang 92868d7d8f
Merge pull request #25274 from hashicorp/ci/arg-in-light-dockerfile
Pass ARG to second stage in light Dockerfile
2020-06-17 14:07:46 -04:00
Alisdair McDiarmid 4c36e7dc20
Merge pull request #25273 from hashicorp/alisdair/update-go-cty-yaml
vendor: update go-cty-yaml
2020-06-17 13:57:22 -04:00
Kristin Laemmert 1b8f4566fa
internal/initwd: fix panics with relative submodules in DirFromModule (#25250)
* internal/initwd: fix panics with relative submodules in DirFromModule

There were two related issues here:

1. panic with any local module with submodules
1. panic with a relative directory that was above the workdir ("../")

The first panic was caused by the local installer looking up the root
module with the (nonexistant) key "root.", instead of "".

The second panic was caused by the installer trying to determine the
relative path from ".". This was fixed by detecting "." as the source
path and using the absolute path for the call to filepath.Rel.

Added test cases for both panics and updated the existing e2e tests with
the correct install paths.
2020-06-17 13:24:56 -04:00
Alvin Huang 9364cf5964 bump base image of light docker image to alpine:3.12 2020-06-17 13:08:28 -04:00
Alvin Huang 2de5556491 pass ARG to second stage docker light image build 2020-06-17 13:07:30 -04:00
Alisdair McDiarmid 80ca4db54d lang: Add regression test for yamldecode bug 2020-06-17 13:05:14 -04:00
Alisdair McDiarmid cd2ba6ca46 vendor: go get github.com/zclconf/go-cty-yaml@v1.0.2 2020-06-17 13:05:08 -04:00
Alvin Huang 1a43187e49
Merge pull request #25272 from hashicorp/ci/add-gox-tools
Add `gox` to tools package
2020-06-17 11:26:43 -04:00
Alvin Huang 1c3805efae fix make fmtcheck hint output 2020-06-17 11:06:19 -04:00
Alvin Huang 54fb4b63bf gofmt tools/tools.go 2020-06-17 11:04:43 -04:00
Alvin Huang 7a471c0da7 adding gox to tools package 2020-06-17 10:59:28 -04:00
Alvin Huang 9b41578d83 add test for 'full' docker image build 2020-06-17 10:48:10 -04:00
James Bardin 3e39d4762a update CHANGELOG.md 2020-06-17 10:42:08 -04:00
James Bardin 27012f7ee1
Merge pull request #25258 from hashicorp/jbardin/module-refs
Whole module references
2020-06-17 10:39:18 -04:00
James Bardin 4add3a063f update CHANGELOG.md 2020-06-16 16:34:51 -04:00
James Bardin c31b08999c update CHANGELOG.md 2020-06-16 16:33:37 -04:00
James Bardin fd1904983b
Merge pull request #24080 from fabiomatavelli/b-fix-remote-exec
ssh: return error if host is empty
2020-06-16 16:31:50 -04:00
Petros Kolyvas 4a3d0118c6
Merge pull request #25139 from xiaozhu36/master
backend/oss: supports setting HTTPS_PROXY
2020-06-16 14:49:34 -04:00
Kristin Laemmert c2e041a646
Update CHANGELOG.md 2020-06-16 14:48:51 -04:00
Katy Moe 6b3d0ee64b add test for terraform version 2020-06-16 14:47:57 -04:00
Katy Moe dbe139e616 add test for terraform version -json 2020-06-16 14:47:57 -04:00
Katy Moe d8e22f1804 add terraform version -json 2020-06-16 14:47:57 -04:00
Alisdair McDiarmid a3231814c2
Merge pull request #25263 from hashicorp/alisdair/fix-test-cleanup
command: Fix test cleanup
2020-06-16 14:24:13 -04:00
Alisdair McDiarmid d2b215f4d5 command: Fix test cleanup
This test runs `init`, which causes some dangling `.terraform` state
after running tests.
2020-06-16 14:11:08 -04:00