opentofu/internal/tofu
Martin Atkins 3d5039f1f3 tofu: Context.Plan now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Plan does not yet do anything with its new context, but this gets
the context plumbed in enough that we should be able to pass values like
telemetry spans all the way from the top-level in future.

OpenTofu has some historical situational private uses of context.Context
to handle the graceful shutdown behaviors. Those use context.Context as
a private implementation detail rather than public API, and so this commit
leaves them as-is and adds a new "primary context" alongside. Hopefully
in future refactoring we can simplify this to use the primary context also
as the primary cancellation signal, but that's too risky a change to bundle
in with this otherwise-mostly-harmless context plumbing.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
..
testdata Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
context_apply2_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_apply_checks_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_apply_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_apply.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
context_eval_test.go Another batch of minor typos (#1953) 2024-09-09 07:51:39 -04:00
context_eval.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
context_fixtures_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
context_functions_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_functions.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
context_import_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
context_import.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
context_input_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_input.go Fix typos (#1905) 2024-08-29 13:20:33 -04:00
context_plan2_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_plan_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_plan.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_plugins_test.go Cleanup ContextPlugins after function changes (#1550) 2024-04-25 07:19:15 -04:00
context_plugins.go Cleanup ContextPlugins after function changes (#1550) 2024-04-25 07:19:15 -04:00
context_refresh_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_refresh.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_validate_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
context_validate.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
context_walk.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
context.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
eval_conditions.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
eval_context_builtin_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
eval_context_builtin.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
eval_context_mock.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
eval_context.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
eval_count_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
eval_import_test.go Support for_each syntax in import block (#1492) 2024-04-17 17:12:10 +03:00
eval_import.go 300/provider foreach (#1911) 2024-09-06 14:33:05 +01:00
eval_iteration.go 300/provider foreach (#1911) 2024-09-06 14:33:05 +01:00
eval_provider_test.go Partial revert of #1911, support provider for_each in aliases (#2121) 2024-11-05 06:19:52 -05:00
eval_provider.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
eval_variable_test.go Fix typos (#1905) 2024-08-29 13:20:33 -04:00
eval_variable.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
evaluate_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
evaluate_triggers_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
evaluate_triggers.go Another batch of minor typos (#1953) 2024-09-09 07:51:39 -04:00
evaluate_valid_test.go Integrate provider functions (#1439) 2024-04-10 08:04:08 -04:00
evaluate_valid.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
evaluate.go Fix typos (#1905) 2024-08-29 13:20:33 -04:00
execute.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
features.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph_builder_apply_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
graph_builder_apply.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
graph_builder_eval.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
graph_builder_plan_test.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
graph_builder_plan.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
graph_builder_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph_builder.go Only call StringWithNodeTypes for TRACE logs (#1810) 2024-07-24 13:44:20 -04:00
graph_dot_test.go Error handling fixes (#1816) 2024-07-15 11:58:43 +02:00
graph_dot.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph_interface_subgraph.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph_test.go Another batch of minor typos (#1953) 2024-09-09 07:51:39 -04:00
graph_walk_context.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
graph_walk_operation.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph_walk_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph_walk.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
graph.go Improve panic handling within go-routines (#1425) 2024-03-26 07:41:16 -04:00
hook_mock.go Introduce locking on the hook mocks to avoid data race failures (#1505) 2024-04-18 08:31:11 +01:00
hook_stop_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
hook_stop.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
hook_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
hook.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
instance_expanders.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
marks_test.go Improve comparison of sensitive marks on resources, and propagate the sensitive_attributes correctly (#1640) 2024-07-09 08:42:02 -04:00
marks.go Improve comparison of sensitive marks on resources, and propagate the sensitive_attributes correctly (#1640) 2024-07-09 08:42:02 -04:00
node_check.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_data_destroy_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_data_destroy.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_external_reference.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_local_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_local.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_module_expand_test.go add override implementation for testing framework (#1499) 2024-06-06 13:20:41 +03:00
node_module_expand.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_module_variable_test.go tofu: Context.Plan now takes a context.Context 2024-11-19 10:15:21 -08:00
node_module_variable.go Fix function refs in variable validation (#2052) 2024-10-17 12:37:54 -04:00
node_output_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_output.go add override implementation for testing framework (#1499) 2024-06-06 13:20:41 +03:00
node_provider_abstract.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_provider_eval.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_provider_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_provider.go Improve log messages for providers with keys (#2152) 2024-11-07 11:56:21 -05:00
node_resource_abstract_instance_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_abstract_instance.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_abstract_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_abstract.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_apply_instance.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_apply_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_apply.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
node_resource_deposed_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_deposed.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_destroy.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_forget.go Add support for removed block (#1158) 2024-02-21 10:31:44 +02:00
node_resource_import.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_plan_destroy.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_plan_instance.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_plan_orphan_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_plan_orphan.go Fix destroy/orphan path with provider instances (#2150) 2024-11-07 12:41:13 -05:00
node_resource_plan.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_validate_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_resource_validate.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
node_root_variable_test.go Allow configured providers to provide additional functions. (#1491) 2024-04-18 15:11:38 +02:00
node_root_variable.go Assert that NodeRootVariable implements Execute (#1857) 2024-07-26 07:32:33 -04:00
node_value.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
opentf_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
phasestate_string.go Rename opentf package to tofu (#466) 2023-09-20 15:16:53 +03:00
provider_for_test_framework.go upgrade golangci-lint to v1.62 (#2174) 2024-11-18 19:56:29 +02:00
provider_mock.go Allow configured providers to provide additional functions. (#1491) 2024-04-18 15:11:38 +02:00
provisioner_mock_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
provisioner_mock.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
reduce_plan_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
reduce_plan.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
resource_provider_mock_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
schemas_test.go Cleanup ContextPlugins after function changes (#1550) 2024-04-25 07:19:15 -04:00
schemas.go Fix typos (#1905) 2024-08-29 13:20:33 -04:00
test_context_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
test_context.go Fix provider functions in child modules (#2082) 2024-10-23 10:42:38 -04:00
transform_attach_config_provider_meta.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_attach_config_provider.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_attach_config_resource_test.go add automated copyright header check (#1696) 2024-06-03 16:49:36 +03:00
transform_attach_config_resource.go Improve performance of AttachResourceConfigTransformer on big graphs (#1558) 2024-04-29 11:36:54 -04:00
transform_attach_schema.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_attach_state.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_check_starter.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_check.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_config_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_config.go add override implementation for testing framework (#1499) 2024-06-06 13:20:41 +03:00
transform_destroy_cbd_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_destroy_cbd.go Fix typos (#1905) 2024-08-29 13:20:33 -04:00
transform_destroy_edge_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_destroy_edge.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_diff_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_diff.go Add support for removed block (#1158) 2024-02-21 10:31:44 +02:00
transform_expand.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_external_reference.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_import_state_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_local.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_module_expansion_test.go Improve ModuleExpansionTransformer performance (#1809) 2024-07-29 15:55:37 -04:00
transform_module_expansion.go Improve ModuleExpansionTransformer performance (#1809) 2024-07-29 15:55:37 -04:00
transform_module_variable_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_module_variable.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_orphan_count_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_orphan_count.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_orphan_output.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_orphan_resource_test.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_orphan_resource.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_output.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_provider_test.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
transform_provider.go Implement Provider for_each (#2105) 2024-11-05 18:08:23 -05:00
transform_provisioner.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_reference_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_reference.go chore: fix some function names (#2108) 2024-10-29 12:07:10 +02:00
transform_removed_modules.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_resource_count.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_root_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_root.go add override implementation for testing framework (#1499) 2024-06-06 13:20:41 +03:00
transform_state.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_targets_test.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
transform_targets.go Add exclude flag support (#1900) 2024-11-05 10:16:00 -05:00
transform_transitive_reduction_test.go Integrate provider functions (#1439) 2024-04-10 08:04:08 -04:00
transform_transitive_reduction.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_variable.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_vertex_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform_vertex.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
transform.go Only call StringWithNodeTypes for TRACE logs (#1810) 2024-07-24 13:44:20 -04:00
ui_input_mock.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_input_prefix_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_input_prefix.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_input.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output_callback_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output_callback.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output_mock_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output_mock.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output_provisioner_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output_provisioner.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_output.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
update_state_hook_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
update_state_hook.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
upgrade_resource_state_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
upgrade_resource_state.go Another batch of minor typos (#1953) 2024-09-09 07:51:39 -04:00
util_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
util.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
validate_selfref_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
validate_selfref.go Fix typos (#1905) 2024-08-29 13:20:33 -04:00
valuesourcetype_string.go Rename opentf package to tofu (#466) 2023-09-20 15:16:53 +03:00
variables_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
variables.go Another batch of minor typos (#1953) 2024-09-09 07:51:39 -04:00
version_required.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
walkoperation_string.go Rename opentf package to tofu (#466) 2023-09-20 15:16:53 +03:00