Commit Graph

25926 Commits

Author SHA1 Message Date
James Bardin 78d8af18c2
Merge pull request #24956 from hashicorp/jbardin/cbd-state
CreateBeforeDestroy inheritence and state serializaton
2020-05-18 11:46:29 -04:00
James Bardin 08128fe775 add omitempty to create_before_destroy
no need to litter the state file with "create_before_destroy":false
2020-05-18 11:31:36 -04:00
Paul Tyng eb4a3cafc6
Merge pull request #24972 from hashicorp/paultyng-patch-1
Remove sumologic from community
2020-05-18 11:02:55 -04:00
Paul Tyng e8f75b55ab
Remove sumologic from community 2020-05-16 12:23:46 -04:00
Nick Fagerlund e358d6b618
website: Edit text of new TF_IGNORE env var docs (#24788)
* website: Edit text of new TF_IGNORE env var docs

Fixing one broken link, and tidying the sentences a bit.

* typo

Co-authored-by: Pam Selle <pam@hashicorp.com>
2020-05-14 13:35:27 -07:00
James Bardin a286ef6d9c remove depends_on from helper test shims 2020-05-14 15:57:16 -04:00
James Bardin 756e889697 remove unused DependsOn usage in state 2020-05-14 15:46:08 -04:00
James Bardin c052463f62 test for inherited create_before_destroy in state 2020-05-14 15:46:08 -04:00
James Bardin 7731441beb Make sure CBD is correct during apply, and saved
The resource apply nodes need to be GraphNodeDestroyerCBD in order to
correctly inherit create_before_destroy. While the plan will have
recorded this to create the correct deposed nodes, the edges still need
to be transformed correctly.

We also need create_before_destroy to be saved to state for nodes that
inherited it, so that if they are removed from state the destroy will
happen in the correct order.
2020-05-14 15:46:08 -04:00
James Bardin cf9b6de03e force cbd during apply too
We need to run the force CBD transformer during apply too, both to
ensure we can rely on the `CreateBeforeDestroy()` status for dependants
during apply, but also to ensure that the correct status is stored into
state.
2020-05-14 15:46:08 -04:00
James Bardin 9fe87fe520 remove unused depends_on field and add test
The depends_on fields was deprecated during 0.12, and is no longer used.

Add a roundtrip test for the create_before_destroy status.
2020-05-14 15:46:08 -04:00
James Bardin 23f5fc3e5a thread create_before_destroy to the state file 2020-05-14 15:46:08 -04:00
Chris Griggs 6a01c40312
Merge pull request #24953 from hashicorp/cgriggs01-ksyun
[Website] KingsoftCloud provider link
2020-05-14 12:23:33 -07:00
Chris Griggs c29b51b455 [Website] Kingsoft cloud provider link 2020-05-14 09:33:12 -07:00
Alisdair McDiarmid 187f3f561b
Merge pull request #24952 from hashicorp/alisdair/upgrade-hcl
vendor: go get github.com/hashicorp/hcl/v2@v2.5.1
2020-05-14 09:56:56 -04:00
Alisdair McDiarmid b07368eec3 vendor: go get github.com/hashicorp/hcl/v2@v2.5.1
Upgrade hcl for hclwrite bugfixes, which will make 0.13upgrade more
reliable.
2020-05-14 09:36:28 -04:00
Kristin Laemmert 041f4dd8ca
configs: require normalized provider local names (#24945)
* addrs: replace NewLegacyProvider with NewDefaultProvider in ParseProviderSourceString

ParseProviderSourceString was still defaulting to NewLegacyProvider when
encountering single-part strings. This has been fixed.

This commit also adds a new function, IsProviderPartNormalized, which
returns a bool indicating if the string given is the same as a
normalized version (as normalized by ParseProviderPart) or an error.
This is intended for use by the configs package when decoding provider
configurations.

* terraform: fix provider local names in tests

* configs: validate that all provider names are normalized

The addrs package normalizes all source strings, but not the local
names. This caused very odd behavior if for e.g. a provider local name
was capitalized in one place and not another. We considered enabling
case-sensitivity for provider local names, but decided that since this
was not something that worked in previous versions of terraform (and we
have yet to encounter any use cases for this feature) we could generate
an error if the provider local name is not normalized. This error also
provides instructions on how to fix it.

* configs: refactor decodeProviderRequirements to consistently not set an FQN when there are errors
2020-05-14 09:00:58 -04:00
Daniel Dreier c057487997
Merge pull request #24946 from hashicorp/danieldreier/hashibot_config
Remove hashibot panic issue labeler
2020-05-13 18:02:57 -07:00
charlotte.mach 172d6caf04 Add info on dynamodb locking multiple state files as per issue #15303 2020-05-13 15:04:56 -07:00
Daniel Dreier 7aa8e65e16 Remove hashibot panic issue labeler
HashiBot labels issues as "crash" and "bug" when they container "panic:". This causes issues to bypass human triage, which means that provider-specific panics are put in our issue list rather than being labeled correctly. This removes that rule to allow for human labeling.
2020-05-13 11:58:57 -07:00
Kristin Laemmert d350818126
internal/getproviders: fix panic with invalid path parts (#24940)
* internal/getproviders: fix panic with invalid path parts

If the search path is missing a directory, the provider installer would
try to create an addrs.Provider with the wrong parts. For example if the
hostname was missing (as in the test case), it would call
addrs.NewProvider with (namespace, typename, version). This adds a
validation step for each part before calling addrs.NewProvider to avoid
the panic.
2020-05-13 13:16:09 -04:00
Petros Kolyvas 95ad52de11
Merge pull request #24942 from izeau/patch-1
website/docs: provider aliases in the JSON format
2020-05-13 11:59:09 -04:00
Alisdair McDiarmid c3c8fbd4db
Merge pull request #24917 from hashicorp/alisdair/registry-retries
internal/getproviders: Add configurable HTTP retry & timeout support
2020-05-13 10:17:12 -04:00
Jean Dupouy a54bb124a9
website/docs: provider aliases in the JSON format
Fixes #24889
2020-05-13 15:52:26 +02:00
Alisdair McDiarmid 070c3018f8 internal/providercache: Remove unused retry events 2020-05-13 09:48:41 -04:00
Alisdair McDiarmid e27a36cafd internal/getproviders: Retry failed HTTP requests
This is a port of the retry/timeout logic added in #24260 and #24259,
using the same environment variables to configure the retry and timeout
settings.
2020-05-13 09:48:41 -04:00
Alisdair McDiarmid 9a5e5bb5fc
Merge pull request #24841 from rafalpotempa/upgrade-crypto
Security: Upgrade version of golang.org/x/crypto to latest
2020-05-13 09:19:36 -04:00
Rafal Potempa 2646e42ac9 Upgrade version 2020-05-13 09:33:27 +02:00
Rafal Potempa b630543985 Upgrade crypto 2020-05-13 09:31:39 +02:00
James Bardin 6cf3f76623 update CHANGELOG.md 2020-05-12 17:12:41 -04:00
James Bardin e912dc8551
Merge pull request #19155 from bdwyertech/chef-exit-codes
Chef: Gracefully Handle RFC062 Exit Codes
2020-05-12 17:09:05 -04:00
James Bardin 2b9cb0e0e1
Merge pull request #24930 from hashicorp/jbardin/rename-expanders
Rename expanders
2020-05-12 16:16:12 -04:00
James Bardin 07c35dd4df update test strings
Match the new names output by the expander nodes
2020-05-12 11:07:00 -04:00
James Bardin 5cb6c86b32 rename plannable output
NodePlannableOutput is now the expander node, and is used in contexts
other than planning. Change the name to nodeExpandOutput
2020-05-12 11:07:00 -04:00
James Bardin 3a3eaa1ddf rename plannable local
NodePLannableLocal is now the expander node, and is is also used in
contexts other than plan. Change the name to nodeExpandLocal.
2020-05-12 11:07:00 -04:00
James Bardin a2d2ce35dc remove "prepare state" from expanders
That name tag was left in only to reduce the diff when during
implementation. Fix the naming now for these nodes so it is correct, and
prevent any possible name collision between types.
2020-05-12 10:28:33 -04:00
Kristin Laemmert 862dc36884
command/init: include config loader diagnostics in output (#24921)
Previously the diagnostics from the config loaders (earlyconfig and
regular) were only appended to the overall diags if an error was found.
This adds all diagnostics from the regular config loader so that any
generated warnings will be displayed, even if there are no errors.

I did not add the `earlyconfig` warnings since they will be displayed if
there is an error and are likely to be duplicated by the config loader.
2020-05-12 08:39:12 -04:00
Alisdair McDiarmid 14985469b4
Merge pull request #24915 from hashicorp/alisdair/013upgrade-docs
website: Add docs for 0.13upgrade
2020-05-11 15:42:25 -04:00
Alisdair McDiarmid 20483da548 website: Add docs for 0.13upgrade 2020-05-11 15:38:16 -04:00
Kristin Laemmert 60321b41e8
getproviders: move protocol compatibility functions into registry client (#24846)
* internal/registry source: return error if requested provider version protocols are not supported

* getproviders: move responsibility for protocol compatibility checks into the registry client

The original implementation had the providercache checking the provider
metadata for protocol compatibility, but this is only relevant for the
registry source so it made more sense to move the logic into
getproviders.

This also addresses an issue where we were pulling the metadata for
every provider version until we found one that was supported. I've
extended the registry client to unmarshal the protocols in
`ProviderVersions` so we can filter through that list, instead of
pulling each version's metadata.
2020-05-11 13:49:12 -04:00
Alisdair McDiarmid 1d834fb1d0
Merge pull request #24906 from hashicorp/alisdair/013upgrade-confirm
command: Add prompt & confirmation to 0.13upgrade
2020-05-11 12:29:46 -04:00
Alisdair McDiarmid 82ebbf9a23 command: Add prompt & confirmation to 0.13upgrade 2020-05-11 09:32:11 -04:00
Alisdair McDiarmid 47cd97bee2
Merge pull request #24903 from hashicorp/alisdair/lookup-legacy-provider-fix
internal: Fix LookupLegacyProvider
2020-05-11 09:13:16 -04:00
Alisdair McDiarmid 62b0cbed12 internal: Fix LookupLegacyProvider
When looking up the namespace for a legacy provider source, we need to
use the /v1/providers/-/{name}/versions endpoint. For non-HashiCorp
providers, the /v1/providers/-/{name} endpoint returns a 404.

This commit updates the LegacyProviderDefaultNamespace method and the
mock registry servers accordingly.
2020-05-08 12:29:25 -04:00
Pam Selle f82700bc56
Disallow provider configuration in expanding modules (#24892)
Validate providers in expanding modules. Expanding modules cannot have provider configurations with non-empty configs, which includes having a version configured. If an empty or alias-only block is passed, the provider must be passed through the providers argument on the module call
2020-05-08 11:35:28 -04:00
Chris Griggs 53a36a11b2
Merge pull request #24875 from hashicorp/cgriggs01-community
[Website] Adding community providers
2020-05-08 07:59:46 -07:00
Alisdair McDiarmid 0104e63c64
Merge pull request #24894 from hashicorp/alisdair/013upgrade-required-version
command: 0.13upgrade command checks and updates required_version
2020-05-08 08:50:56 -04:00
Alisdair McDiarmid 1fdcbc4825 command: Fix 0.13upgrade bug with multiple blocks
If a configuration had multiple blocks in the versions.tf file, it would
be added to the `rewritePaths` list multiple times. We would then remove
it from this slice, but only once, and so the output file would later be
rewritten to remove the required providers block.

This commit uses a set instead of a list to prevent this case, and adds
a regression test.
2020-05-07 20:11:44 -04:00
Alisdair McDiarmid e2be704d81 command: Extract reused hclwrite helper code 2020-05-07 20:11:44 -04:00
Robin Norwood af5c425360
website: Add link to new learn track in configuration/modules.html (#24847) 2020-05-07 15:52:22 -07:00