opentofu/internal
Martin Atkins 21d6fb5a37 depsfile: Don't panic when lock file is unreadable
Previously we were expecting that the *hcl.File would always be non-nil,
even in error cases. That isn't always true, so now we'll be more robust
about it and explicitly return an empty locks object in that case, along
with the error diagnostics.

In particular this avoids a panic in a strange situation where the user
created a directory where the lock file would normally go. There's no
meaning to such a directory, so it would always be a mistake and so now
we'll return an error message about it, rather than panicking as before.

The error message for the situation where the lock file is a directory is
currently not very specific, but since it's HCL responsible for generating
that message we can't really fix that at this layer. Perhaps in future
we can change HCL to have a specialized error message for that particular
error situation, but for the sake of this commit the goal is only to
stop the panic and return a normal error message.
2020-12-15 17:00:35 -08:00
..
copy deprecate helper/copy 2020-10-08 08:42:16 -04:00
depsfile depsfile: Don't panic when lock file is unreadable 2020-12-15 17:00:35 -08:00
didyoumean didyoumean: move from "helper" to "internal" 2020-10-02 13:35:07 -07:00
earlyconfig internal/earlyconfig: staticcheck 2020-12-02 13:59:19 -05:00
getproviders command/init: Hint about providers in other namespaces 2020-12-10 10:11:27 -08:00
grpcwrap add grpcwrap.Provisioner 2020-12-02 12:45:00 -05:00
initwd use a single log writer 2020-10-19 14:29:54 -04:00
legacy remove old test provider 2020-12-02 12:45:00 -05:00
logging hide provider crashes from panicwrap when logging 2020-11-05 10:54:21 -05:00
modsdir internal/modsdir: Fix Dropped Error (#24600) 2020-06-04 10:26:26 -04:00
provider-simple add grpcwrap.Provisioner 2020-12-02 12:45:00 -05:00
provider-terraform/main add grpcwrap.Provisioner 2020-12-02 12:45:00 -05:00
providercache command/init: Hint about providers in other namespaces 2020-12-10 10:11:27 -08:00
provisioner-local-exec/main add grpcwrap.Provisioner 2020-12-02 12:45:00 -05:00
replacefile replacefile: don't create the temporary file in TMPDIR 2020-10-20 16:29:59 -07:00
tfplugin5 regenerate plugin proto with correct tooling 2020-12-01 14:06:49 -05:00
typeexpr internal/typeexpr: staticcheck 2020-12-02 13:59:19 -05:00