Commit Graph

32531 Commits

Author SHA1 Message Date
AbstractionFactory
8cc04a2bcf Minor fix
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
06544ccbaf URL format fix
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
8da8db0aa5 Removed left-over headline
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
5eb72afe12 Review fixes
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
94f487bde3 Navigation note
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
8cabeaae24 Survey results
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
0fa58254ce Added future plans
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
3468302422 Added potential alternatives
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
fd95fa6a45 Navigation linking
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
AbstractionFactory
8f728cde15 Moved SBOM to a separate RFC
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
Martin Atkins
a59608864a rfc/oci-registries: go-getter style arguments instead of version argument
In OpenTofu's current design, the "version" argument in a "module" block
is reserved for use only by the module registry protocol. Directly
specifying a remote source address does not allow that argument because
it delegates the installation process to go-getter, which has no concept
of versioning.

Therefore we'll start by following the existing precedent from existing
source address syntaxes like the one we use for Git repositories, where
the tag or digest is selected using URL query-string-style syntax.

In a later version of OpenTofu we might move to support "version" for
some of the remote source address syntaxes, at least including the "oci"
and "git" protocols. However, such a change is not in scope for the OCI
registry project because it would likely require a wholesale replacement
of go-getter with an API that better resembles our module registry client
API.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
Martin Atkins
e612095451 rfc/oci-registries: Implementation-related content from earlier drafts
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
f64a45113d Module attestations
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
f279684009 Addressing review comments
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
f64498e2b8 Authentication
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
6252f505c4 Link fix
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
df2e3baade Removed Helm reference
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
898f9f78d3 Minor fixes
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
55d7a98a0b Minor fixes and module contents
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
e85fae8e0e WIP refactor
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
1263570efe Typo fix
Co-authored-by: Yousif Akbar <11247449+yhakbar@users.noreply.github.com>
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
Martin Atkins
a1ec1298bd rfc: Dependency Packages from OCI Registries
This commit rescopes what was originally a draft about provider
installation from OCI registries into a more general document about how
we intend to use OCI container images and OCI registries as a distribution
vehicle for at least two different kinds of OpenTofu dependency packages
(module and provider packages).

This document already had good content about how OCI registries and
artifacts work _in general_, and its associated PR was already attracting
general discussion about whether to use Docker-style or ORAS-style
conventions across both provider and module packages, so we'll now use
this document to discuss just the overall question of what style of
packaging we intend to use (across both package types) and will discuss
the module-specific and provider-specific details in other RFCs.

This also reworks the document to now propose using the Docker-like
conventions instead of the ORAS-like conventions, since that matches what
we've been exploring in prototypes. Of course, that decision is not final
until this RFC is accepted and merged, but we have considerably better
understanding of how this would work under the Docker-like approach than
ORAS and it seems like consensus is so far heading in that direction. We
may revise this document again if we learn of some strong arguments in
favor of the ORAS approach.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 11:13:19 -08:00
AbstractionFactory
a92ed801e5 Draft: OCI provider registry
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-03-04 11:13:19 -08:00
Martin Atkins
ceaab30ba1 cloudplugin: Remove incomplete stub of "cloud" subcommand
We seem to have inherited an incomplete implementation of something from
the predecessor project here: a "tofu cloud" command that just tries to
immediately delegate any invocation to another executable called
"terraform-cloudplugin" in the current working directory, used as a
go-plugin style plugin.

This has some TODO comments suggesting that it was intended to change to
download a plugin from some remote place before executing it, but our
stubby version doesn't do that. I was also hidden behind an experimental
feature guard and so has never been accessible in any released version of
OpenTofu; we don't currently produce any releases with experimental
features enabled.

Therefore this commit just deletes it so that we don't have this dead code
to potentially worry about. Perhaps one day we'll offer some extension
point for adding extra subcommands through plugins, but if we do that then
we'll presumably design our own mechanism for doing it rather than
extending this dead code that was added for reasons unknown to us.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-04 10:48:52 -08:00
Roger Simms
e43390b120 2025 feb updates (#2560)
Signed-off-by: Roger Simms <roger.simms@harness.io>
2025-03-04 18:26:51 +00:00
Diógenes Fernandes
662b101112 feat: remove progress messages from commands using -concise argument (#2549)
Signed-off-by: Diógenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-03-04 11:30:31 -03:00
Oleksandr Levchenkov
5e41711584 [RFC] Deprecation of module variables and outputs (#2180)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-03-03 16:16:29 +02:00
Diógenes Fernandes
35368d9909 fix: small typo on OpenTofu name on CONTRIBUTING guide (#2550)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-02-27 17:27:58 -03:00
Martin Atkins
4babd3a7da go.mod: Upgrade to Go 1.24
This selects the latest version of Go for forthcoming releases.

Upgrading does immediately change some behaviors, which are documented in
the CHANGELOG.md update here.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-26 11:33:43 -08:00
Martin Atkins
2b4e7b7def GitHub Actions: Use latest golangci-lint and its GitHub Action
The version we were previously using does not support Go v1.24.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-26 11:33:43 -08:00
Martin Atkins
620b449533 Prepare for upgrade to golangci-lint v1.64.5
In a future commit we will adopt golangci-lint v1.64.5, which now triggers
lint warnings for some code that was previously not detected. This commit
is the smallest change to address those differences.

Unfortunately the "cloud" package and the "remote" backend both rely on
non-idiomatic error message formatting because they emit the returned error
message text directly into the UI, so to avoid changing the UI output but
also avoid significant refactoring this just adds nolint comments to those
for now. A future commit might address this by reworking things so that
the UI takes care of its own presentation concerns instead of relying on
the main implementation to directly generate UI-appropriate error strings.

This also completely disables the exportloopref linter, because that was
for a loop scoping hazard that was already addressed by a language change
in Go 1.22. This linter is therefore completely removed in newer versions
of golangci-lint and would thus generate an error if left enabled after
upgrading.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-26 11:33:43 -08:00
Martin Atkins
cd99be2e1c go.mod: go get golang.org/x/text@v0.25.0
This fixes a problem with the "stringer" tool that breaks our "go generate"
process after upgrading to Go 1.24.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-26 11:33:43 -08:00
Mikel Olasagasti Uranga
66765bdab3 Fix: Ensure constant format strings in fmt and printf calls
Go 1.24 introduces stricter checks for format string validation.
This commit fixes instances where non-constant format strings were
used in calls to functions like `fmt.Errorf`, `fmt.Printf`, and similar.

Changes include:
- Replacing dynamically constructed strings passed as format strings
with constant format strings.
- Refactoring `fmt.Sprintf` calls to ensure the format string matches
the number of arguments provided.
- Simplifying redundant formatting and ensuring compliance with Go
1.24's stricter `vet` tool checks.

This update ensures compatibility with Go 1.24 and prevents potential
runtime errors caused by misinterpreted dynamic format strings.

Resolves #2389

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-26 11:33:43 -08:00
Andrei Ciobanu
eba25e2fed Add the initial implementation for s3 locking (#2521)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-02-25 14:17:30 +02:00
Jarrett Duskey
ecd4dc5c61 Add count of forgotten resources to plan and apply outputs. (#2010)
Signed-off-by: Jarrett Duskey <jarrett@duskey.io>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2025-02-24 14:53:32 -05:00
James Humphries
23a26b0e58 fix(genconfig): properly quote attribute names when necessary (#2533)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2025-02-21 10:00:47 -05:00
Alexander Scheel
c66319a56b Remove experimental marker from OpenBao transit (#2536)
Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
2025-02-21 10:00:13 -05:00
James Humphries
d2ae0b21ed Reworked gpg key expiry warning to only fire if ALL keys are expired (#2476)
Signed-off-by: James Humphries <James@james-humphries.co.uk>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-02-20 13:33:39 +00:00
Martin Atkins
9a86d86f4d tofu: Some benchmarks for situations with many instances
Although we don't promise that OpenTofu will work well with more than a
few hundred resource instances in a particular configuration, we know that
some people do use it that way and they sometimes find and share
opportunities for improving performance due to those opportunities being
easier to spot at large scale.

These two benchmarks aim to help us measure improvements that affect the
pure overhead of the core language runtime, without any real provider calls
and without the CLI layer's contributions, so that we can more easily
compare before and after of changes when we're either trying to understand
a reported performance regression or we're trying out potential performance
improvements.

As noted in the comments inline, the presence of these benchmarks is not
intended to represent a commitment to support using OpenTofu outside of its
design assumptions, but they will hopefully help us continue our current
best-effort approach to reducing overhead where we can do so without risk
to existing functionality, increasing maintenance overhead, or making it
harder to introduce new features over time.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-19 08:15:29 -08:00
Martin Atkins
30fcff72d8 tofu+configload: Test utilities take testing.TB
A lot of our testing utilities were written before the introduction of the
testing.TB interface that represents what *testing.T and *testing.B have
in common, and those that weren't have followed precedent from those that
were in directly expecting *testing.T.

Using testing.TB instead makes these helpers usable from both normal tests
and testing benchmark functions, since they only use methods that are
available in both contexts.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-19 08:15:29 -08:00
Andrei Ciobanu
de95b65faa RFC: s3 locking based on conditional writes (#2511)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-02-19 10:11:09 +02:00
Zach Goldberg
d5a6ff8d9f January TSC meetings (#2530)
Signed-off-by: Zach Goldberg <zach@gruntwork.io>
2025-02-18 11:14:45 -08:00
Andrei Ciobanu
a3276028ad Upgrade aws sdk to a version that will give us access to s3 conditional writes arguments (#2528)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-02-18 15:58:17 +02:00
Janik
cfb85299d5 gitignore: add coverage.out and coverage.html (#2519)
Signed-off-by: Janik H. <janik@aq0.de>
2025-02-13 19:59:28 -05:00
AbstractionFactory
ecac914580 Issue template overhaul (#2506)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-02-13 08:27:12 +01:00
Martin Atkins
5d03530483 command/views/json: Refactor NewDiagnostic into multiple functions
This function was previously quite long and complex, so this commit splits
it into a number of smaller functions.

The previous code structure was made more awkward by having to work around
all being together in one function -- particularly the part iterating over
the values used in an expression -- and so the new layout is quite
different and thus the diff is hard to read. However, there are
intentionally no test changes in this commit to help us be confident that
this has not regressed anything, and the existing unit tests for this
component seem quite comprehensive.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-12 11:40:41 -08:00
Martin Atkins
b03f9635ce addrs: TestMap test function is exempt from the cyclop lint
This function's cyclomatic complexity is essentially just a count of the
number of conditions in the test, which are written out as a flat sequence
of "if" statements and so cannot really be simplified any more without
making the test harder to read and maintain overall.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-12 09:09:52 -08:00
Martin Atkins
65f4d7f430 addrs: Rework parseRef to be shorter
Our complexity lint rules previously considered this function to have both
too many statements and too many lines.

Factoring out more of the "single-attr ref" logic into the
parseSingleAttrRef function eliminated one statement per case that was
using it.

Factoring out the handling of module call references -- the most complex
case this function handles -- into a separate parseModuleCallRef reduced
it considerably more.

Removing the empty lines between the "case" statements was necessary after
that just to get below the line count limit, which seems like a rather
dubious situation for a lint rule to complain about but it doesn't seem
to hurt readability, so fair enough.

The rework of parseSingleAttrRef made it slightly less convenient to use
as part of parseModuleCallRef, but not onerously so and thus this
prioritizes making the common case simpler at the expense of a small
amount of extra work in the parseModuleCallRef function.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-12 09:09:52 -08:00
Andrei Ciobanu
dfe2876931 Add a new warning when a provider cannot be downloaded and it was requested by an implicit usage (#2479)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-02-12 18:40:54 +02:00
Oleksandr Levchenkov
5ff40ae505 refactor sensitive marks usage (#2503)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-11 19:02:21 +02:00