Update scripts directory to OpenTofu (#508)

This commit is contained in:
Elbaz 2023-09-20 16:51:36 +03:00 committed by GitHub
parent 1ef63b4c92
commit 922f61d847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View File

@ -226,7 +226,7 @@ func (i *ModuleInstaller) moduleInstallWalker(ctx context.Context, manifest mods
Severity: hcl.DiagError,
Summary: "Failed to remove local module cache",
Detail: fmt.Sprintf(
"OpenTF tried to remove %s in order to reinstall this module, but encountered an error: %s",
"OpenTofu tried to remove %s in order to reinstall this module, but encountered an error: %s",
instPath, err,
),
})
@ -471,7 +471,7 @@ func (i *ModuleInstaller) installRegistryModule(ctx context.Context, req *config
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid response from remote module registry",
Detail: fmt.Sprintf("The registry at %s returned an invalid response when OpenTF requested available versions for module %q (%s:%d).", hostname, req.Name, req.CallRange.Filename, req.CallRange.Start.Line),
Detail: fmt.Sprintf("The registry at %s returned an invalid response when OpenTofu requested available versions for module %q (%s:%d).", hostname, req.Name, req.CallRange.Filename, req.CallRange.Start.Line),
Subject: req.CallRange.Ptr(),
})
return nil, nil, diags
@ -490,7 +490,7 @@ func (i *ModuleInstaller) installRegistryModule(ctx context.Context, req *config
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: "Invalid response from remote module registry",
Detail: fmt.Sprintf("The registry at %s returned an invalid version string %q for module %q (%s:%d), which OpenTF ignored.", hostname, mv.Version, req.Name, req.CallRange.Filename, req.CallRange.Start.Line),
Detail: fmt.Sprintf("The registry at %s returned an invalid version string %q for module %q (%s:%d), which OpenTofu ignored.", hostname, mv.Version, req.Name, req.CallRange.Filename, req.CallRange.Start.Line),
Subject: req.CallRange.Ptr(),
})
continue
@ -666,7 +666,7 @@ func (i *ModuleInstaller) installRegistryModule(ctx context.Context, req *config
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Unreadable module directory",
Detail: fmt.Sprintf("The directory %s could not be read. This is a bug in OpenTF and should be reported.", modDir),
Detail: fmt.Sprintf("The directory %s could not be read. This is a bug in OpenTofu and should be reported.", modDir),
})
} else if vDiags := mod.CheckCoreVersionRequirements(req.Path, req.SourceAddr); vDiags.HasErrors() {
// If the core version requirements are not met, we drop any other
@ -767,7 +767,7 @@ func (i *ModuleInstaller) installGoGetterModule(ctx context.Context, req *config
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Unreadable module directory",
Detail: fmt.Sprintf("The directory %s could not be read. This is a bug in OpenTF and should be reported.", modDir),
Detail: fmt.Sprintf("The directory %s could not be read. This is a bug in OpenTofu and should be reported.", modDir),
})
} else if vDiags := mod.CheckCoreVersionRequirements(req.Path, req.SourceAddr); vDiags.HasErrors() {
// If the core version requirements are not met, we drop any other
@ -899,7 +899,7 @@ func maybeImproveLocalInstallError(req *configs.ModuleRequest, diags hcl.Diagnos
// treats relative paths as local, so if it seems like that's
// what the user was doing then we'll add an additional note
// about it.
suggestion = "\n\nOpenTF treats absolute filesystem paths as external modules which establish a new module package. To treat this directory as part of the same package as its caller, use a local path starting with either \"./\" or \"../\"."
suggestion = "\n\nOpenTofu treats absolute filesystem paths as external modules which establish a new module package. To treat this directory as part of the same package as its caller, use a local path starting with either \"./\" or \"../\"."
}
newDiags = newDiags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,

View File

@ -58,7 +58,7 @@ gox \
-arch="${XC_ARCH}" \
-osarch="${XC_EXCLUDE_OSARCH}" \
-ldflags "${LD_FLAGS}" \
-output "pkg/{{.OS}}_{{.Arch}}/opentf" \
-output "pkg/{{.OS}}_{{.Arch}}/tofu" \
.
# Move all the compiled things to the $GOPATH/bin

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# This is a helper script to launch OpenTF inside the "dlv" debugger,
# This is a helper script to launch OpenTofu inside the "dlv" debugger,
# configured to await a remote debugging connection on port 2345. You can
# then connect to it using the following command, or its equivalent in your
# debugging frontend of choice:
@ -10,17 +10,17 @@
# https://github.com/derekparker/delve/tree/master/Documentation/installation
#
# For more convenient use, you may wish to put this script in your PATH:
# ln -s ../src/github.com/opentofu/opentofu/scripts/debug-opentf $GOPATH/bin/debug-opentf
# ln -s ../src/github.com/opentofu/opentofu/scripts/debug-opentofu $GOPATH/bin/debug-opentofu
#
# Note that when running this script the OpenTF binary is NOT in $GOPATH/bin,
# so any providers installed there won't be found unless OpenTF searches
# Note that when running this script the OpenTofu binary is NOT in $GOPATH/bin,
# so any providers installed there won't be found unless OpenTofu searches
# there for some _other_ reason.
set -eu
echo "Launching OpenTF in a headless debug session"
echo "Launching OpenTofu in a headless debug session"
echo "Connect to it using: dlv connect 127.0.0.1:2345"
echo "(OpenTF takes a long time to build and launch in this mode; some logs will appear below)"
echo "(OpenTofu takes a long time to build and launch in this mode; some logs will appear below)"
echo "---------------------------"
exec dlv debug github.com/opentofu/opentofu --headless --listen :2345 --log -- "$@"

View File

@ -13,7 +13,7 @@ skip=$skip"|internal/planproto|internal/tfplugin5|internal/tfplugin6"
packages=$(go list ./... | egrep -v ${skip})
# We are skipping style-related checks, since opentf intentionally breaks
# We are skipping style-related checks, since tofu intentionally breaks
# some of these. The goal here is to find issues that reduce code clarity, or
# may result in bugs. We also disable fucntion deprecation checks (SA1019)
# because our policy is to update deprecated calls locally while making other