This allows child processes launched with local-exec to contribute to the same trace that OpenTofu started.
Signed-off-by: ogormans-deptstack <sean.ogorman@deptagency.com>
The previous commit already removed WinRM support and made it return a
relatively-terse error message, but during the v1.13 release series we'd
like to use a more helpful error message that includes a link to
Microsoft's documentation about enabling an OpenSSH server to use as an
alternative.
This commit is designed to be reverted during the v1.14 period so that
we'll just fall back on the error message already implemented in
"package communicator". This new message needs to be implemented outside
of the communicator abstraction because that old API doesn't support
returning diagnostics, but it's not worth the risk to refactor it just for
an error message we're intending to remove in the next release series
anyway.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
The upstream libraries we use to implement this feature are in various
states of unmaintained-ness where we've not been able to upgrade them
beyond the old versions we're currently using without them no longer
working well together.
Therefore we previously made this connection type produce a deprecation
warning in OpenTofu v1.12, and now we're making it produce an error instead
and so we can remove all of our code that was calling in to those
dependencies.
Although this is a breaking change, we're justifying it under the
"external dependencies" pragmatic exception in our compatibility promises:
external software has changed in a way that makes it no longer viable to
offer this feature. Modern Windows has built-in support for running an
OpenSSH server, and so we expect that most folks who were previously
relying on WinRM should be able to migrate to using SSH instead.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
The "terraform_version" property of the JSON state format (intentionally
misnamed for backward-compatibility with our predecessor) changes each time
we make a new release, so we'll compare it with the currently-expected
version number instead of with a hard-coded value.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This is to give provisioners access to trace span metadata, which we'll make use of in later commits.
Signed-off-by: ogormans-deptstack <sean.ogorman@deptagency.com>
All of the exported querying methods of Expander are supposed to hold a
read lock whenever they Expander.exps, but this particular method was
missing those calls and so it could potentially race with calls that write
new expansions into the data structure.
This seems to be quite hard to hit in practice because it can only arise
if you have an "orphan" resource instance whose node happens to execute
concurrently with the expansion node for a module or resource, but
the race detector can sometimes catch it when executing
TestContext2Apply_providerModuleIteration/apply_orphan_destroy from
"package tofu".
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
The comment here was trying to say that we don't need to _deep-copy_
cty.Value values, but it wasn't clear about that and so it seemed weird
to have a comment saying that copying isn't needed right before a call to
a function called "Copy".
This updates the comment to be more explicit, and also takes the
opportunity to simplify to use maps.Clone instead of maps.Copy, since we
have no need for the intermediate empty map we were previously creating
prior to the Copy call.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
We already changed these files considerably in opentofu/opentofu#3671, so
we'll take this opportunity to modernize the rest of the code while the
likelihood of successful clean backporting from this file is pretty low
anyway.
In the case of instance_object_src_test.go some additional editing was
required because uint64Ptr becomes unused when we adopt the built-in "new"
function, which would cause this file to fail the dead code lint.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
We already changed these files considerably in opentofu/opentofu#3671, so
we'll take this opportunity to modernize the rest of the code while the
likelihood of successful clean backporting from this file is pretty low
anyway.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
These tests currently require some manual setup to be able to run in
acceptance test (rather than unit test) mode, so this comment just captures
those steps so we can find them more easily in future.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This test appears to have been written to use the current timestamp in the
Consul keys it uses for testing just to minimize the risk of collisions
with objects already present in the KV store.
Unfortunately, modern Consul now rejects this shape of key because the
default string representation of a timestamp includes characters that
Consul does not allow. This commit changes it to use a decimal
representation of the integer unix timestamp representation instead, which
achieves a similar result using a less disruptive set of characters.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
"hostthatdoesnotexist" is not a hostname that is guaranteed to be unused,
and on some systems a hostname without any dots causes an implicit search
within various domain suffixes. There is no explicitly-specified rule for
what error should be returned when suffix-based search fails, so different
implementations handle that differently and this test was not written to
tolerate those differences, causing false failures.
The "invalid" top-level domain is reserved by RFC 6761 and required to
always cause the NXDOMAIN error, which is the DNS error required to produce
the error message this test expects.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
I've had to remind myself of all of these setup steps each time I've run
the acceptance tests, so I'm just noting some details here to make it
easier for me or someone else to perform the same setup in future.
Maybe we'll build some automation around this someday, but for now I'm
mainly motivated by using these tests to verify a routine upgrade of all
of the libraries that this backend depends on, in preparation for the
OpenTofu v1.12 series.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
On Windows, the two sequential plan runs in TestJsonIntoStream have different latencies — the -json-into run is consistently slower and crosses the timer threshold that emits state_lock_acquire, while the -json run does not. This causes a spurious one-line diff between the two outputs.
Strip state_lock_acquire/release lines from both outputs before comparison since these messages are timing-dependent and not relevant to the test's core assertion.
This is a routine upgrade. OpenTofu directly uses these libraries as part
of implementing the provider plugin protocol, but they are also used
indirectly by the libraries we use to interact with OpenTelemetry
collectors and some Google APIs and so the impact of upgrading these is
always quite tricky to evaluate.
However, I've reviewed the changes between these releases and it seems like
there are no behavior changes that would be significant for the use-cases
OpenTofu cares about. The gRPC library in particular has had a lot of
commits since we last upgraded it, but many of them are performance
improvements in the implementation details rather than significant behavior
changes.
This also includes the result of running "make protobuf" with the updated
version of the protobuf code generator, which for this release has merely
changed the version number recorded in the comments.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>