Commit Graph

31253 Commits

Author SHA1 Message Date
Craig Wright
8f5064e6b4
Merge pull request #33433 from chaosaffe/fix-getcommand-helptext 2023-07-14 10:12:10 -07:00
hashicorp-tsccr[bot]
4671514676
Result of tsccr-helper -log-level=info -pin-all-workflows . (#33527)
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
2023-07-14 18:02:38 +01:00
Jason Murray
4c8e560120
Update get CLI docs 2023-07-13 09:35:07 -07:00
Craig Wright
8b210951d9
Merge pull request #31995 from sed-i/yamlencode-cloudconfig 2023-07-12 14:46:31 -07:00
Liam Cervante
87ed762619
Make flaky 'TestTest_DoubleInterrupt' test more robust (#33503) 2023-07-11 10:35:26 +01:00
Leon
0181c4e2d9
Update website/docs/language/resources/provisioners/syntax.mdx
Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com>
2023-07-11 00:52:51 -04:00
Craig Wright
19a8850748
Merge pull request #33499 from MusicDin/main 2023-07-10 11:17:31 -07:00
Din Mušić
8501d07dff
Fix typo in connection.mdx 2023-07-10 20:09:18 +02:00
Liam Cervante
4862812c94
testing framework: introduce interrupts for stopping tests (#33477)
* [testing framework] prepare for beta phase of development

* [Testing Framework] Add module block to test run blocks

* [testing framework] allow tests to define and override providers

* testing framework: introduce interrupts for stopping tests

* remove panic handling, will do it properly later
2023-07-10 14:53:13 +01:00
Liam Cervante
4b34902fab
[testing framework] allow tests to define and override providers (#33466)
* [testing framework] prepare for beta phase of development

* [Testing Framework] Add module block to test run blocks

* [testing framework] allow tests to define and override providers
2023-07-10 14:33:15 +01:00
Liam Cervante
5acc95dda7
[Testing Framework] Add module block to test run blocks (#33456)
* [testing framework] prepare for beta phase of development

* [Testing Framework] Add module block to test run blocks
2023-07-10 11:42:05 +01:00
Liam Cervante
c9bc7e8479
Add input validation into the 'checks' outputs and tracking (#33481) 2023-07-10 11:33:45 +01:00
Liam Cervante
f74a8d16cf
[testing framework] implement expect_failures functionality (#33443) 2023-07-10 11:30:44 +01:00
CJ Horton
2622e89cfb
Merge pull request #33448 from agustinguayama/fix/small_typo
fix typo in terraform/internal/command /init.go
2023-07-07 09:45:44 -07:00
James Bardin
c42d3b4e51
Merge pull request #33462 from hashicorp/jbardin/destroy-output-provider-refs
always evaluate module outputs during destroy
2023-07-07 09:44:27 -04:00
Martin Atkins
9e6cc4ae6f go.mod: go get google.golang.org/grpc@v1.53.0
This is to upgrade past the vulnerability described here:
    https://github.com/advisories/GHSA-cfgp-2977-2fmm

Terraform does not seem to be significantly affected by it since our use
is primarily between Terraform Core and provider plugins where at worst
a provider could just make its own connection to Terraform malfunction.
However, this also appears to be a relatively low-risk upgrade.

This does force upgrading some of the Google Cloud Platform dependencies,
which the "gcs" (Google Cloud Storage) backend depends on, so there is
some minor risk to that backend but the upstream changes to those
dependencies do not seem to be significant.
2023-07-06 13:14:07 -07:00
James Bardin
6be6f69d61
Merge pull request #33482 from hashicorp/jbardin/schema-cache
Refactor providers.Schemas and add a global schema cache
2023-07-06 16:06:32 -04:00
James Bardin
a77baa866d additional schema handling comment 2023-07-06 15:53:08 -04:00
kmoe
d1a5dfa1ad
command: test plan -refresh= arg ordering (#33483)
* main: disambiguate arg ordering test

Make it extra clear what order of args we are asserting.

* command: fix plan -refresh=false test

The test for plan -refresh=false was not functioning, since ReadResource will not be called if the resource is not in prior state.

Add a new fixture directory with state, and also test the converse, to prevent regression.

* command: add test for refresh flag precedence

A consumer relies on the fact that running terraform plan -refresh=false -refresh true gives the same result as terraform plan -refresh=true.
2023-07-06 19:28:09 +01:00
James Bardin
76332db98d fix locking and race in test mocks 2023-07-06 11:46:17 -04:00
James Bardin
b9d8d99b04 remove fixed FIXME 2023-07-06 10:56:03 -04:00
James Bardin
68d86e81fb disable cache for now 2023-07-06 10:45:57 -04:00
James Bardin
cf5ebaf685 s/Schemas/ProviderSchema/ 2023-07-06 10:37:35 -04:00
James Bardin
36d34135ad replace remaining types in tests 2023-07-06 10:37:35 -04:00
James Bardin
4e8dd5866c update schemas type 2023-07-06 10:37:35 -04:00
James Bardin
d487ce20e1 update jsonprovider to use new schema type 2023-07-06 10:37:35 -04:00
James Bardin
ec3a38e5ed update providers.Schemas type
Use the global providers.SchemaCache and update all schema access to the
providers.Schemas, except where the provider.GetProviderSchemaResponse
type name would be expected.

Some tests that reuse provider factories needed a little more careful
handling. Change the fixed func to only reset the provider on the first
call.
2023-07-06 10:37:35 -04:00
James Bardin
9d9746560f use the same struct for all schema access
Unify the struct used for Schemes and GetProviderSchemaResponse so that
we can have a single cache which handles all schema access.
2023-07-06 10:37:35 -04:00
James Bardin
53901a7e62 Add basic global schema cache
Add a single global schema cache for providers. This allows multiple
provider instances to share a single copy of the schema, and prevents
loading the schema multiple times for a given provider type during a
single command.

This does not currently work with some provider releases, which are
using GetProviderSchema to trigger certain initializations. A new server
capability will be introduced to trigger reloading their schemas, but
not store duplicate results.
2023-07-06 10:37:35 -04:00
James Bardin
d199d427a1 remove unused factory functions 2023-07-06 10:37:35 -04:00
Liam Cervante
ea162f6ab5
[testing framework] prepare for beta phase of development (#33445) 2023-07-06 15:53:18 +02:00
Liam Cervante
3613e972c5
Plan renderer: Support users indexing integer paths with stringified numbers (#33475) 2023-07-05 11:11:02 +02:00
James Bardin
b45de53c13 always evaluate module outputs during destroy
A module output is generally not used during destroy, however it must be
evaluated when its value is used by a provider for configuration,
because that configuration is not stored between walks.

There was an oversight in the output expansion node where the output
node was not created because the operation was destroy, and module
outputs have nothing to destroy. This however skipped evaluation when
the output is needed by a provider as mentioned above. Because of the
way an implied plan is stored internally when executing `terraform
destroy`, this went unnoticed by the test.

Allowing the output to be evaluated during destroy fixes the issue, and
should be acceptable because an output is classified as temporary in the
graph, and will be pruned when not actually needed.

Update the existing test to serialize the plan, which triggers the
failure.
2023-06-30 15:24:49 -04:00
Alisdair McDiarmid
ad2298b114
Merge pull request #33108 from unRob/patch-1
Return debuggable CAS errors on consul state put
2023-06-30 09:50:11 -04:00
Agustin Guayama
db5b81d2c1
fix typo in terraform/internal/command /init.go 2023-06-29 17:34:34 -03:00
rita
76290e897e
Merge pull request #33441 from ctrombley/docs/checks-for-continuous-validation
docs: dissociate CV from preconditions and postconditions
2023-06-29 07:49:25 -07:00
Chris Trombley
6d817660eb docs: dissociate CV from preconditions and postconditions 2023-06-28 16:40:49 -07:00
James Bardin
f2b34c5f95 update CHANGELOG.md 2023-06-28 14:02:11 -04:00
James Bardin
3fcf16f0a1
Merge pull request #33403 from hashicorp/jbardin/deps-with-no-instances
connect references from config nodes during apply
2023-06-28 14:00:10 -04:00
James Bardin
bb0bb7af1a remove NodeApplyableResource
Move the logic for NodeApplyableResource into
nodeExpandApplyableResource to remove an unnecessary level of expansion.
2023-06-28 13:32:00 -04:00
James Bardin
5c9d7a810d connect references from config nodes during apply
In order to ensure that transitive dependencies are connected even when
there are no instances for a resource, we need to route the references
through the config ("expand") node. This happens naturally by having the
expand node report its config references, however legacy configs can
contain self-referenced without the "self" identifier, so those need to
be filtered out.
2023-06-28 13:31:58 -04:00
Liam Cervante
2eb99a0e44
Fix the Terraform build after recent merges (#33436) 2023-06-28 10:12:43 +02:00
Liam Cervante
212ae6c4ba
Introduce separate testing scope for reference validation (#33339) 2023-06-28 09:47:24 +02:00
Liam Cervante
dfc26c2ac4
[Testing Framework] Add test command to Terraform CLI (#33327)
* Add test structure to views package for rendering test output

* Add test file HCL configuration and parser functionality

* Adds a TestContext structure for evaluating assertions against the state and plan

* Add test command to Terraform CLI
2023-06-28 09:37:42 +02:00
Liam Cervante
ed822559e5
[Testing framework] Implement JSON view functionality for test command (#33400) 2023-06-28 09:30:29 +02:00
kmoe
fbff64ad45
configs: remove import block duplicate id check (#33434) 2023-06-27 19:25:36 +01:00
Jason Murray
79669df479
Remove PATH from GetCommand helpText 2023-06-26 13:42:22 -07:00
Roberto Hidalgo
8e5a66b2f5
use multierror.Append instead of append
Co-authored-by: Chris Thain <32781396+cthain@users.noreply.github.com>
2023-06-26 13:02:58 -04:00
Liam Cervante
3732bffe13
[Testing Framework] Adds TestContext for evaluating test assertions (#33326)
* Add test structure to views package for rendering test output

* Add test file HCL configuration and parser functionality

* Adds a TestContext structure for evaluating assertions against the state and plan
2023-06-26 17:42:53 +02:00
Roberto Hidalgo
787cc693cd
use go-multierror instead of manually joining error reasons
Co-authored-by: Chris Thain <32781396+cthain@users.noreply.github.com>
2023-06-24 11:04:55 -06:00