Skip to content

Commit 780d16c

Browse files
authored
Merge pull request #536 from hashicorp/dependabot/go_modules/github.com/hashicorp/packer-plugin-sdk-0.6.1
build(deps): bump github.com/hashicorp/packer-plugin-sdk from 0.6.0 to 0.6.1
2 parents 5d5f09e + db70305 commit 780d16c

File tree

7 files changed

+28
-24
lines changed

7 files changed

+28
-24
lines changed

.golangci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ issues:
2020
- linters:
2121
- lll
2222
source: "^//go:generate "
23+
- linters:
24+
- errcheck
25+
path: ".*_test.go"
2326

2427
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
2528
max-issues-per-linter: 0
@@ -74,7 +77,7 @@ run:
7477
# won't be reported. Default value is empty list, but there is
7578
# no need to include all autogenerated files, we confidently recognize
7679
# autogenerated files. If it's not please let us know.
77-
skip-files:
80+
exclude-files:
7881
- ".*\\.hcl2spec\\.go$"
7982
# - lib/bad.go
8083

@@ -92,7 +95,7 @@ run:
9295
# output configuration options
9396
output:
9497
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
95-
format: colored-line-number
98+
formats: colored-line-number
9699

97100
# print lines of code with issue, default is true
98101
print-issued-lines: true
@@ -118,7 +121,7 @@ linters-settings:
118121
# [deprecated] comma-separated list of pairs of the form pkg:regex
119122
# the regex is used to ignore names within pkg. (default "fmt:.*").
120123
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
121-
ignore: fmt:.*,io/ioutil:^Read.*,io:Close
124+
exclude-functions: fmt:.*,io/ioutil:^Read.*,io:Close
122125

123126
# path to a file containing a list of functions to exclude from checking
124127
# see https://github.com/kisielk/errcheck#excluding-functions for details

builder/common/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ func (w *AWSPollingConfig) LogEnvOverrideWarnings() {
463463
warning = fmt.Sprintf("%s Since you have not set the poll delay, "+
464464
"Packer will default to a 2-second delay.", warning)
465465
}
466-
log.Printf(warning)
466+
log.Print(warning)
467467
} else if timeoutSecondsIsSet {
468468
log.Printf("[WARNING] (aws): env var AWS_TIMEOUT_SECONDS is " +
469469
"deprecated in favor of AWS_MAX_ATTEMPTS env or aws_polling_max_attempts config option. " +

builder/common/step_key_pair_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package common
66
import (
77
"bytes"
88
"context"
9-
"fmt"
109
"sync"
1110
"testing"
1211

@@ -74,13 +73,13 @@ func TestStepKeyPair_withDefault(t *testing.T) {
7473
createKeyPairCallCount := state.Get("ec2").(*mockEC2KeyPairConn).CreateKeyPairCount
7574
createKeyPairArgs := state.Get("ec2").(*mockEC2KeyPairConn).CreateKeyPairArgs
7675
if createKeyPairCallCount != 1 {
77-
t.Fatalf(fmt.Sprintf("Expected CreateKeyPair to be called %d times, was called %d times", 1, createKeyPairCallCount))
76+
t.Fatalf("Expected CreateKeyPair to be called %d times, was called %d times", 1, createKeyPairCallCount)
7877
}
7978
if *createKeyPairArgs[0].KeyName != "temp-key-name" {
80-
t.Fatalf(fmt.Sprintf("Unexpected Key Type expected %s, got %s", "temp-key-name", *createKeyPairArgs[0].KeyName))
79+
t.Fatalf("Unexpected Key Type expected %s, got %s", "temp-key-name", *createKeyPairArgs[0].KeyName)
8180
}
8281

8382
if *createKeyPairArgs[0].KeyType != "rsa" {
84-
t.Fatalf(fmt.Sprintf("Expeccted KeyType %s got %s", "rsa", *createKeyPairArgs[0].KeyType))
83+
t.Fatalf("Expeccted KeyType %s got %s", "rsa", *createKeyPairArgs[0].KeyType)
8584
}
8685
}

builder/common/step_modify_ami_attributes.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ func (s *StepModifyAMIAttributes) Run(ctx context.Context, state multistep.State
4949
// Determine if there is any work to do.
5050
valid := false
5151
valid = valid || s.Description != ""
52-
valid = valid || (s.Users != nil && len(s.Users) > 0)
53-
valid = valid || (s.Groups != nil && len(s.Groups) > 0)
54-
valid = valid || (s.OrgArns != nil && len(s.OrgArns) > 0)
55-
valid = valid || (s.OuArns != nil && len(s.OuArns) > 0)
56-
valid = valid || (s.ProductCodes != nil && len(s.ProductCodes) > 0)
57-
valid = valid || (s.SnapshotUsers != nil && len(s.SnapshotUsers) > 0)
58-
valid = valid || (s.SnapshotGroups != nil && len(s.SnapshotGroups) > 0)
52+
valid = valid || len(s.Users) > 0
53+
valid = valid || len(s.Groups) > 0
54+
valid = valid || len(s.OrgArns) > 0
55+
valid = valid || len(s.OuArns) > 0
56+
valid = valid || len(s.ProductCodes) > 0
57+
valid = valid || len(s.SnapshotUsers) > 0
58+
valid = valid || len(s.SnapshotGroups) > 0
5959
valid = valid || s.IMDSSupport != ""
6060

6161
if !valid {

builder/common/step_run_spot_instance.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package common
66
import (
77
"context"
88
"encoding/base64"
9+
"errors"
910
"fmt"
1011
"io/ioutil"
1112
"log"
@@ -444,7 +445,7 @@ func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag)
444445
for _, outErr := range createOutput.Errors {
445446
errString = errString + aws.StringValue(outErr.ErrorMessage)
446447
}
447-
err = fmt.Errorf(errString)
448+
err = errors.New(errString)
448449
}
449450
state.Put("error", err)
450451
ui.Error(err.Error())

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/hashicorp/go-cleanhttp v0.5.2
1515
github.com/hashicorp/go-multierror v1.1.1
1616
github.com/hashicorp/hcl/v2 v2.19.1
17-
github.com/hashicorp/packer-plugin-sdk v0.6.0
17+
github.com/hashicorp/packer-plugin-sdk v0.6.1
1818
github.com/hashicorp/vault/api v1.14.0
1919
github.com/mitchellh/mapstructure v1.5.0
2020
github.com/stretchr/testify v1.10.0
@@ -61,7 +61,7 @@ require (
6161
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6262
github.com/dylanmei/iso8601 v0.1.0 // indirect
6363
github.com/fatih/color v1.18.0 // indirect
64-
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
64+
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
6565
github.com/go-logr/logr v1.4.2 // indirect
6666
github.com/go-logr/stdr v1.2.2 // indirect
6767
github.com/gofrs/flock v0.8.1 // indirect
@@ -127,7 +127,7 @@ require (
127127
golang.org/x/sync v0.12.0 // indirect
128128
golang.org/x/term v0.30.0 // indirect
129129
golang.org/x/text v0.23.0 // indirect
130-
golang.org/x/time v0.3.0 // indirect
130+
golang.org/x/time v0.11.0 // indirect
131131
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
132132
google.golang.org/api v0.150.0 // indirect
133133
google.golang.org/appengine v1.6.7 // indirect

go.sum

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL
121121
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
122122
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
123123
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
124-
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
125-
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
124+
github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE=
125+
github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA=
126126
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
127127
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
128128
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@@ -250,8 +250,9 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
250250
github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=
251251
github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM=
252252
github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0=
253-
github.com/hashicorp/packer-plugin-sdk v0.6.0 h1:v8JdmM1PkkHu3gIUs63UcsgGlD0U3m/7DWG6PxcmOPw=
254253
github.com/hashicorp/packer-plugin-sdk v0.6.0/go.mod h1:bDCCzvZ6lUJjrY7eI+i9lYmGs9NSymdFFQiGluF8dEg=
254+
github.com/hashicorp/packer-plugin-sdk v0.6.1 h1:9lpdiwwqRPVk80bX+XJul5/RrxHMXOta15hT7JOsbGU=
255+
github.com/hashicorp/packer-plugin-sdk v0.6.1/go.mod h1:B6i8yIPzzFWrZW0hHdH5TLFGYlJEdgRNJnP5eXNxJU4=
255256
github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=
256257
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
257258
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
@@ -490,8 +491,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
490491
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
491492
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
492493
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
493-
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
494-
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
494+
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
495+
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
495496
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
496497
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
497498
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=

0 commit comments

Comments
 (0)