Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Terragrunt package up to 0.54.1 and fix the API references #297

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
log "github.com/sirupsen/logrus"

"github.com/ghodss/yaml"
"github.com/gruntwork-io/terragrunt/cli"
"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io/terragrunt/options"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -259,7 +258,7 @@ func getDependencies(path string, terragruntOptions *options.TerragruntOptions)
}

depPath := dep
terrOpts, _ := options.NewTerragruntOptions(depPath)
terrOpts, _ := options.NewTerragruntOptionsWithConfigPath(depPath)
Comment on lines -262 to +261
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They refactored that function: since v0.48.7 options.NewTerragruntOptions() takes no parameters and returns a default configuration. To keep the backward compatibility the authors decided to create options.NewTerragruntOptionsWithConfigPath(path string) which would mimic the original behaviour.

terrOpts.OriginalTerragruntConfigPath = terragruntOptions.OriginalTerragruntConfigPath
childDeps, err := getDependencies(depPath, terrOpts)
if err != nil {
Expand Down Expand Up @@ -319,12 +318,11 @@ func getDependencies(path string, terragruntOptions *options.TerragruntOptions)

// Creates an AtlantisProject for a directory
func createProject(sourcePath string) (*AtlantisProject, error) {
options, err := options.NewTerragruntOptions(sourcePath)
options, err := options.NewTerragruntOptionsWithConfigPath(sourcePath)
if err != nil {
return nil, err
}
options.OriginalTerragruntConfigPath = sourcePath
options.RunTerragrunt = cli.RunTerragrunt
options.Env = getEnvs()

dependencies, err := getDependencies(sourcePath, options)
Expand Down Expand Up @@ -439,11 +437,10 @@ func createHclProject(sourcePaths []string, workingDir string, projectHcl string
terraformVersion := defaultTerraformVersion

projectHclFile := filepath.Join(workingDir, projectHcl)
projectHclOptions, err := options.NewTerragruntOptions(workingDir)
projectHclOptions, err := options.NewTerragruntOptionsWithConfigPath(workingDir)
if err != nil {
return nil, err
}
projectHclOptions.RunTerragrunt = cli.RunTerragrunt
projectHclOptions.Env = getEnvs()

locals, err := parseLocals(projectHclFile, projectHclOptions, nil)
Expand Down Expand Up @@ -496,11 +493,10 @@ func createHclProject(sourcePaths []string, workingDir string, projectHcl string

// build dependencies for terragrunt childs in directories below project hcl file
for _, sourcePath := range sourcePaths {
options, err := options.NewTerragruntOptions(sourcePath)
options, err := options.NewTerragruntOptionsWithConfigPath(sourcePath)
if err != nil {
return nil, err
}
options.RunTerragrunt = cli.RunTerragrunt
options.Env = getEnvs()

dependencies, err := getDependencies(sourcePath, options)
Expand Down Expand Up @@ -577,7 +573,7 @@ func createHclProject(sourcePaths []string, workingDir string, projectHcl string

// Finds the absolute paths of all terragrunt.hcl files
func getAllTerragruntFiles(path string) ([]string, error) {
options, err := options.NewTerragruntOptions(path)
options, err := options.NewTerragruntOptionsWithConfigPath(path)
if err != nil {
return nil, err
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/parse_hcl.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cmd

import (
"github.com/gruntwork-io/go-commons/errors"
"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io/terragrunt/errors"
Comment on lines +4 to -5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terragrunt exported that package to the common repository in v0.52.4, I believe.

"github.com/gruntwork-io/terragrunt/options"
"github.com/gruntwork-io/terragrunt/util"
"github.com/hashicorp/hcl/v2"
Expand Down Expand Up @@ -90,7 +90,7 @@ func decodeHcl(
}
}

evalContext, err := config.CreateTerragruntEvalContext(filename, terragruntOptions, extensions)
evalContext, err := extensions.CreateTerragruntEvalContext(filename, terragruntOptions)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They made CreateTerragruntEvalContext a method of config.EvalContextExtensions in v0.53.4. I guess it works better than passing these extensions as a parameter.

if err != nil {
return err
}
Expand Down Expand Up @@ -124,6 +124,7 @@ func decodeAsTerragruntInclude(
// The key signifiers of a parent are:
// - no include statement
// - no terraform source defined
//
// If both of those are true, it is likely a parent module
func parseModule(path string, terragruntOptions *options.TerragruntOptions) (isParent bool, includes []config.IncludeConfig, err error) {
configString, err := util.ReadFileAsString(path)
Expand Down
2 changes: 1 addition & 1 deletion cmd/parse_locals.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package cmd
// parses the `locals` blocks and evaluates their contents.

import (
"github.com/gruntwork-io/go-commons/errors"
"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io/terragrunt/errors"
"github.com/gruntwork-io/terragrunt/options"
"github.com/gruntwork-io/terragrunt/util"
"github.com/hashicorp/hcl/v2"
Expand Down
215 changes: 200 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,208 @@
module github.com/transcend-io/terragrunt-atlantis-config

go 1.16
go 1.21

toolchain go1.21.3

require (
github.com/bmatcuk/doublestar v1.3.1 // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-errors/errors v1.1.1 // indirect
github.com/gruntwork-io/terragrunt v0.36.6
github.com/hashicorp/go-getter v1.5.11
github.com/hashicorp/hcl/v2 v2.11.1
github.com/gruntwork-io/go-commons v0.17.1
github.com/gruntwork-io/terragrunt v0.54.1
github.com/hashicorp/go-getter v1.7.1
github.com/hashicorp/hcl/v2 v2.17.0
github.com/hashicorp/terraform-config-inspect v0.0.0-20210625153042-09f34846faab
github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c // indirect
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.8.4
github.com/zclconf/go-cty v1.13.2
golang.org/x/sync v0.4.0
)

require (
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.3 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
filippo.io/age v1.0.0 // indirect
github.com/AlecAivazis/survey/v2 v2.3.4 // indirect
github.com/Azure/azure-sdk-for-go v63.3.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.26 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20220407094043-a94812496cf5 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-versions v1.0.1 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/atomicgo/cursor v0.0.1 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go v1.46.6 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/bmatcuk/doublestar v1.3.1 // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/charmbracelet/bubbles v0.16.1 // indirect
github.com/charmbracelet/bubbletea v0.24.2 // indirect
github.com/charmbracelet/glamour v0.6.0 // indirect
github.com/charmbracelet/lipgloss v0.9.1 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/creack/pty v1.1.17 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/gitsight/go-vcsurl v1.0.1 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-github/v35 v35.3.0 // indirect
github.com/google/go-jsonnet v0.18.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gookit/color v1.5.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect
github.com/gruntwork-io/boilerplate v0.5.7 // indirect
github.com/gruntwork-io/gruntwork-cli v0.7.0 // indirect
github.com/gruntwork-io/terratest v0.41.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.10 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.3 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.1-vault // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform v0.15.3 // indirect
github.com/hashicorp/terraform-registry-address v0.2.0 // indirect
github.com/hashicorp/terraform-svchost v0.0.1 // indirect
github.com/hashicorp/vault/api v1.5.0 // indirect
github.com/hashicorp/vault/sdk v0.4.1 // indirect
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/mattn/go-zglob v0.0.2 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.4 // indirect
github.com/zclconf/go-cty v1.8.3
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
gopkg.in/ini.v1 v1.57.0 // indirect
github.com/inancgumus/screen v0.0.0-20190314163918-06e984b86ed3 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jstemmer/go-junit-report v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/lib/pq v1.10.5 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-zglob v0.0.3 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/microcosm-cc/bluemonday v1.0.21 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/panicwrap v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/owenrumney/go-sarif v1.1.1 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/pterm/pterm v0.12.41 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sahilm/fuzzy v0.1.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/sourcegraph/go-lsp v0.0.0-20200429204803-219e11d77f5d // indirect
github.com/sourcegraph/jsonrpc2 v0.2.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/terraform-linters/tflint v0.47.0 // indirect
github.com/terraform-linters/tflint-plugin-sdk v0.17.0 // indirect
github.com/terraform-linters/tflint-ruleset-terraform v0.4.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/urfave/cli/v2 v2.25.5 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yuin/goldmark v1.5.2 // indirect
github.com/yuin/goldmark-emoji v1.0.1 // indirect
github.com/zclconf/go-cty-yaml v1.0.3 // indirect
go.mozilla.org/gopgagent v0.0.0-20170926210634-4d7ea76ff71a // indirect
go.mozilla.org/sops/v3 v3.7.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.149.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/urfave/cli.v1 v1.20.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Loading
Loading