Skip to content

Commit

Permalink
CVE fixes and dependencies update (#3435)
Browse files Browse the repository at this point in the history
* Update to go 1.23

* Upgrade to go 1.23

* linter issues update

* Error construction update
  • Loading branch information
denis256 authored Sep 25, 2024
1 parent 23d56c5 commit 8009300
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env: &env

defaults: &defaults
docker:
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.22.6-tf1.5-tg58.8-pck1.8-ci56.0
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.23.1-tf1.5-tg58.8-pck1.8-ci58.2

# Install Terraform which is not available in the default image
install_terraform_latest: &install_terraform_latest
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ run:
timeout: 2m
issues-exit-code: 1
tests: true
go: "1.22"
go: "1.23"
output:
formats:
- format: colored-line-number
Expand Down
2 changes: 1 addition & 1 deletion .strict.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ run:
timeout: 2m
issues-exit-code: 1
tests: true
go: "1.22"
go: "1.23"
output:
formats:
- format: colored-line-number
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ clean:
rm -f terragrunt

install-lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0

run-lint:
golangci-lint run -v --timeout=5m ./...
Expand Down
2 changes: 1 addition & 1 deletion _ci/install-golang.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install golang using Chocolatey
choco install golang --version 1.22.6 -y
choco install golang --version 1.23.1 -y
# Verify installation
Get-Command go
go version
3 changes: 2 additions & 1 deletion awshelper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,13 @@ func CreateAwsSession(config *AwsSessionConfig, terragruntOptions *options.Terra
}

if _, err = sess.Config.Credentials.Get(); err != nil {
// construct dynamic error message based on the configuration
msg := "Error finding AWS credentials (did you set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables?)"
if config != nil && len(config.CredsFilename) > 0 {
msg = fmt.Sprintf("Error finding AWS credentials in file '%s' (did you set the correct file name and/or profile?)", config.CredsFilename)
}

return nil, errors.WithStackTraceAndPrefix(err, msg)
return nil, errors.WithStackTraceAndPrefix(err, msg) //nolint:govet
}

return sess, nil
Expand Down
2 changes: 1 addition & 1 deletion cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func WrapWithTelemetry(opts *options.TerragruntOptions) func(ctx *cli.Context, a
"args": opts.TerraformCliArgs,
"dir": opts.WorkingDir,
}, func(childCtx context.Context) error {
ctx.Context = childCtx
ctx.Context = childCtx //nolint:fatcontext
if err := initialSetup(ctx, opts); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions cli/provider_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func InitProviderCacheServer(opts *options.TerragruntOptions) (*ProviderCache, e
providerHandlers = append(providerHandlers, handlers.NewProviderDirectHandler(providerService, CacheProviderHTTPStatusCode, method, cliCfg.CredentialsSource()))
directIsdefined = true
}

method.AppendExclude(excludeAddrs)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gruntwork-io/terragrunt

go 1.22
go 1.23

require (
cloud.google.com/go/storage v1.43.0
Expand Down
1 change: 1 addition & 0 deletions internal/view/human_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (render *HumanRender) Diagnostic(diag *diagnostic.Diagnostic) (string, erro
ruleBuf.WriteString(line)
ruleBuf.WriteByte('\n')
}

ruleBuf.WriteString(leftRuleEnd)

return ruleBuf.String(), nil
Expand Down
2 changes: 1 addition & 1 deletion shell/run_shell_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestGitLevelTopDirCaching(t *testing.T) {
ctx = shell.ContextWithTerraformCommandHook(ctx, nil)
c := cache.ContextCache[string](ctx, shell.RunCmdCacheContextKey)
assert.NotNil(t, c)
assert.Empty(t, len(c.Cache))
assert.Empty(t, c.Cache)
terragruntOptions, err := options.NewTerragruntOptionsForTest("")
require.NoError(t, err)
path := "."
Expand Down

0 comments on commit 8009300

Please sign in to comment.