Skip to content

Commit 35fd995

Browse files
committed
upgrade dependices
1 parent 48fac55 commit 35fd995

File tree

1,056 files changed

+57635
-16376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,056 files changed

+57635
-16376
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dev_watch.sh
88
export_env.sh
99
.idea
1010
*.log
11+
*.exe
1112
.terraform/
1213
terraform-provider-tencentcloud
1314
terraform-provider-qcloud

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.13.3
1+
1.13.11

.golangci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
issues:
2+
exclude-rules:
3+
# Exclude issues bypassing staticcheck.conf
4+
- linters:
5+
- staticcheck
6+
text: "SA1019:"
27
max-per-linter: 0
38
max-same-issues: 0
49

@@ -20,8 +25,8 @@ linters:
2025

2126
linters-settings:
2227
errcheck:
23-
ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close
28+
ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close
2429

2530
run:
26-
deadline: 5m
2731
modules-download-mode: vendor
32+
timeout: 10m

GNUmakefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ lint:
3434
@tfproviderlint \
3535
-c 1 \
3636
-AT001 \
37+
-AT002 \
38+
-AT005 \
39+
-AT006 \
40+
-AT007 \
41+
-AT008 \
42+
-R003 \
43+
-R012 \
44+
-R013 \
3745
-S001 \
3846
-S002 \
3947
-S003 \
@@ -51,6 +59,31 @@ lint:
5159
-S016 \
5260
-S017 \
5361
-S019 \
62+
-S020 \
63+
-S021 \
64+
-S022 \
65+
-S023 \
66+
-S024 \
67+
-S025 \
68+
-S026 \
69+
-S027 \
70+
-S028 \
71+
-S029 \
72+
-S030 \
73+
-S031 \
74+
-S032 \
75+
-S033 \
76+
-S034 \
77+
-S035 \
78+
-S036 \
79+
-S037 \
80+
-V002 \
81+
-V003 \
82+
-V004 \
83+
-V005 \
84+
-V006 \
85+
-V007 \
86+
-V008 \
5487
./$(PKG_NAME)
5588

5689
tools:

go.mod

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@ go 1.13
44

55
require (
66
github.com/agext/levenshtein v1.2.3 // indirect
7-
github.com/aws/aws-sdk-go v1.30.5
8-
github.com/bflad/tfproviderlint v0.5.0
7+
github.com/aws/aws-sdk-go v1.31.2
8+
github.com/bflad/tfproviderlint v0.14.0
99
github.com/client9/misspell v0.3.4
1010
github.com/fatih/color v1.9.0
11-
github.com/golangci/golangci-lint v1.21.0
11+
github.com/golangci/golangci-lint v1.27.0
1212
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
13-
github.com/hashicorp/hcl/v2 v2.3.0
14-
github.com/hashicorp/terraform-plugin-sdk v1.4.1
13+
github.com/hashicorp/hcl/v2 v2.5.1
14+
github.com/hashicorp/terraform-plugin-sdk v1.13.0
1515
github.com/mattn/go-colorable v0.1.6 // indirect
1616
github.com/mitchellh/go-homedir v1.1.0
1717
github.com/pkg/errors v0.9.1
1818
github.com/smartystreets/assertions v1.0.1 // indirect
19-
github.com/smartystreets/goconvey v1.6.4 // indirect
20-
github.com/tencentcloud/tencentcloud-sdk-go v3.0.169+incompatible
19+
github.com/tencentcloud/tencentcloud-sdk-go v3.0.176+incompatible
2120
github.com/yangwenmai/ratelimit v0.0.0-20180104140304-44221c2292e1
2221
github.com/zclconf/go-cty v1.3.1 // indirect
2322
golang.org/x/sys v0.0.0-20200406155108-e3b113bbe6a4 // indirect
24-
golang.org/x/tools v0.0.0-20200406213809-066fd1390ee0 // indirect
2523
)

go.sum

Lines changed: 115 additions & 69 deletions
Large diffs are not rendered by default.

staticcheck.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
checks = [
2+
"all",
3+
"-SA1019",
4+
"-ST1000",
5+
"-ST1003",
6+
"-ST1005",
7+
"-ST1012"
8+
]

tencentcloud/common.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
87
"io/ioutil"
98
"log"
109
"os"
@@ -15,6 +14,7 @@ import (
1514
"time"
1615

1716
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
17+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1818
"github.com/pkg/errors"
1919
sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
2020
)
@@ -23,6 +23,10 @@ const FILED_SP = "#"
2323

2424
var contextNil context.Context = nil
2525

26+
type contextLogId string
27+
28+
const logIdKey = contextLogId("logId")
29+
2630
var logFirstTime = ""
2731
var logAtomicId int64 = 0
2832

@@ -59,7 +63,7 @@ func init() {
5963
// getLogId get logId for trace, return a new logId if ctx is nil
6064
func getLogId(ctx context.Context) string {
6165
if ctx != nil {
62-
logId, ok := ctx.Value("logId").(string)
66+
logId, ok := ctx.Value(logIdKey).(string)
6367
if ok {
6468
return logId
6569
}

tencentcloud/data_source_tc_as_scaling_configs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func dataSourceTencentCloudAsScalingConfigRead(d *schema.ResourceData, meta inte
174174
defer logElapsed("data_source.tencentcloud_as_scaling_configs.read")()
175175

176176
logId := getLogId(contextNil)
177-
ctx := context.WithValue(context.TODO(), "logId", logId)
177+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
178178

179179
asService := AsService{
180180
client: meta.(*TencentCloudClient).apiV3Conn,

tencentcloud/data_source_tc_as_scaling_groups.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func dataSourceTencentCloudAsScalingGroupRead(d *schema.ResourceData, meta inter
207207
defer logElapsed("data_source.tencentcloud_as_scaling_groups.read")()
208208

209209
logId := getLogId(contextNil)
210-
ctx := context.WithValue(context.TODO(), "logId", logId)
210+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
211211

212212
asService := AsService{
213213
client: meta.(*TencentCloudClient).apiV3Conn,

tencentcloud/data_source_tc_as_scaling_policies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func dataSourceTencentCloudAsScalingPolicyRead(d *schema.ResourceData, meta inte
123123
defer logElapsed("data_source.tencentcloud_as_scaling_policies.read")()
124124

125125
logId := getLogId(contextNil)
126-
ctx := context.WithValue(context.TODO(), "logId", logId)
126+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
127127

128128
asService := AsService{
129129
client: meta.(*TencentCloudClient).apiV3Conn,

tencentcloud/data_source_tc_availability_zones.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func dataSourceTencentCloudAvailabilityZones() *schema.Resource {
7979
func dataSourceTencentCloudAvailabilityZonesRead(d *schema.ResourceData, meta interface{}) error {
8080
defer logElapsed("data_source.tencentcloud_availability_zones.read")()
8181
logId := getLogId(contextNil)
82-
ctx := context.WithValue(context.TODO(), "logId", logId)
82+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
8383
cvmService := CvmService{
8484
client: meta.(*TencentCloudClient).apiV3Conn,
8585
}

tencentcloud/data_source_tc_cam_group_memberships.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func dataSourceTencentCloudCamGroupMembershipsRead(d *schema.ResourceData, meta
6565
defer logElapsed("data_source.tencentcloud_cam_group_memberships.read")()
6666

6767
logId := getLogId(contextNil)
68-
ctx := context.WithValue(context.TODO(), "logId", logId)
68+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
6969

7070
groupId := d.Get("group_id").(string)
7171
camService := CamService{

tencentcloud/data_source_tc_cam_group_policy_attachments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func dataSourceTencentCloudCamGroupPolicyAttachmentsRead(d *schema.ResourceData,
108108
defer logElapsed("data_source.tencentcloud_cam_group_policy_attachments.read")()
109109

110110
logId := getLogId(contextNil)
111-
ctx := context.WithValue(context.TODO(), "logId", logId)
111+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
112112

113113
params := make(map[string]interface{})
114114
groupId := d.Get("group_id").(string)

tencentcloud/data_source_tc_cam_groups.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func dataSourceTencentCloudCamGroupsRead(d *schema.ResourceData, meta interface{
9090
defer logElapsed("data_source.tencentcloud_cam_groups.read")()
9191

9292
logId := getLogId(contextNil)
93-
ctx := context.WithValue(context.TODO(), "logId", logId)
93+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
9494

9595
params := make(map[string]interface{})
9696
if v, ok := d.GetOk("group_id"); ok {

tencentcloud/data_source_tc_cam_policies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func dataSourceTencentCloudCamPoliciesRead(d *schema.ResourceData, meta interfac
123123
defer logElapsed("data_source.tencentcloud_cam_policies.read")()
124124

125125
logId := getLogId(contextNil)
126-
ctx := context.WithValue(context.TODO(), "logId", logId)
126+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
127127

128128
params := make(map[string]interface{})
129129
if v, ok := d.GetOk("policy_id"); ok {

tencentcloud/data_source_tc_cam_role_policy_attachments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func dataSourceTencentCloudCamRolePolicyAttachmentsRead(d *schema.ResourceData,
108108
defer logElapsed("data_source.tencentcloud_cam_role_policy_attachments.read")()
109109

110110
logId := getLogId(contextNil)
111-
ctx := context.WithValue(context.TODO(), "logId", logId)
111+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
112112

113113
params := make(map[string]interface{})
114114
roleId := d.Get("role_id").(string)

tencentcloud/data_source_tc_cam_roles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func dataSourceTencentCloudCamRolesRead(d *schema.ResourceData, meta interface{}
104104
defer logElapsed("data_source.tencentcloud_cam_roles.read")()
105105

106106
logId := getLogId(contextNil)
107-
ctx := context.WithValue(context.TODO(), "logId", logId)
107+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
108108

109109
params := make(map[string]interface{})
110110
if v, ok := d.GetOk("role_id"); ok {

tencentcloud/data_source_tc_cam_saml_providers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func dataSourceTencentCloudCamSAMLProvidersRead(d *schema.ResourceData, meta int
7878
defer logElapsed("data_source.tencentcloud_cam_saml_providers.read")()
7979

8080
logId := getLogId(contextNil)
81-
ctx := context.WithValue(context.TODO(), "logId", logId)
81+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
8282

8383
params := make(map[string]interface{})
8484
if v, ok := d.GetOk("name"); ok {

tencentcloud/data_source_tc_cam_user_policy_attachments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func dataSourceTencentCloudCamUserPolicyAttachmentsRead(d *schema.ResourceData,
108108
defer logElapsed("data_source.tencentcloud_cam_user_policy_attachments.read")()
109109

110110
logId := getLogId(contextNil)
111-
ctx := context.WithValue(context.TODO(), "logId", logId)
111+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
112112

113113
params := make(map[string]interface{})
114114
userId := d.Get("user_id").(string)

tencentcloud/data_source_tc_cam_users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func dataSourceTencentCloudCamUsersRead(d *schema.ResourceData, meta interface{}
144144
defer logElapsed("data_source.tencentcloud_cam_users.read")()
145145

146146
logId := getLogId(contextNil)
147-
ctx := context.WithValue(context.TODO(), "logId", logId)
147+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
148148

149149
params := make(map[string]interface{})
150150
if v, ok := d.GetOk("name"); ok {

tencentcloud/data_source_tc_cbs_snapshot_policies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func dataSourceTencentCloudCbsSnapshotPolicies() *schema.Resource {
101101
func dataSourceTencentCloudCbsSnapshotPoliciesRead(d *schema.ResourceData, meta interface{}) error {
102102
defer logElapsed("data_source.tencentcloud_cbs_snapshot_policies.read")()
103103
logId := getLogId(contextNil)
104-
ctx := context.WithValue(context.TODO(), "logId", logId)
104+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
105105

106106
var policyId string
107107
var policyName string

tencentcloud/data_source_tc_cbs_snapshots.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func dataSourceTencentCloudCbsSnapshotsRead(d *schema.ResourceData, meta interfa
129129
defer logElapsed("data_source.tencentcloud_cbs_snapshots.read")()
130130

131131
logId := getLogId(contextNil)
132-
ctx := context.WithValue(context.TODO(), "logId", logId)
132+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
133133

134134
params := make(map[string]string)
135135
if v, ok := d.GetOk("snapshot_id"); ok {

tencentcloud/data_source_tc_cbs_storages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func dataSourceTencentCloudCbsStoragesRead(d *schema.ResourceData, meta interfac
155155
defer logElapsed("data_source.tencentcloud_cbs_storages.read")()
156156

157157
logId := getLogId(contextNil)
158-
ctx := context.WithValue(context.TODO(), "logId", logId)
158+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
159159

160160
params := make(map[string]string)
161161
if v, ok := d.GetOk("storage_id"); ok {

tencentcloud/data_source_tc_ccn_bandwidth_limits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func dataSourceTencentCloudCcnBandwidthLimitsRead(d *schema.ResourceData, meta i
7878
defer logElapsed("data_source.tencentcloud_ccn_bandwidth_limit.read")()
7979

8080
logId := getLogId(contextNil)
81-
ctx := context.WithValue(context.TODO(), "logId", logId)
81+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
8282

8383
service := VpcService{client: meta.(*TencentCloudClient).apiV3Conn}
8484

tencentcloud/data_source_tc_ccn_instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func dataSourceTencentCloudCcnInstancesRead(d *schema.ResourceData, meta interfa
142142
defer logElapsed("data_source.tencentcloud_ccn_instances.read")()
143143

144144
logId := getLogId(contextNil)
145-
ctx := context.WithValue(context.TODO(), "logId", logId)
145+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
146146

147147
service := VpcService{client: meta.(*TencentCloudClient).apiV3Conn}
148148

tencentcloud/data_source_tc_cfs_access_groups.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func dataSourceTencentCloudCfsAccessGroups() *schema.Resource {
7979
func dataSourceTencentCloudCfsAccessGroupsRead(d *schema.ResourceData, meta interface{}) error {
8080
defer logElapsed("data_source.tencentcloud_cfs_access_groups.read")()
8181
logId := getLogId(contextNil)
82-
ctx := context.WithValue(context.TODO(), "logId", logId)
82+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
8383
cfsService := CfsService{
8484
client: meta.(*TencentCloudClient).apiV3Conn,
8585
}

tencentcloud/data_source_tc_cfs_access_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func dataSourceTencentCloudCfsAccessRules() *schema.Resource {
8484
func dataSourceTencentCloudCfsAccessRulesRead(d *schema.ResourceData, meta interface{}) error {
8585
defer logElapsed("data_source.tencentcloud_cfs_access_rules.read")()
8686
logId := getLogId(contextNil)
87-
ctx := context.WithValue(context.TODO(), "logId", logId)
87+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
8888
cfsService := CfsService{
8989
client: meta.(*TencentCloudClient).apiV3Conn,
9090
}

tencentcloud/data_source_tc_cfs_file_systems.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func dataSourceTencentCloudCfsFileSystems() *schema.Resource {
125125
func dataSourceTencentCloudCfsFileSystemsRead(d *schema.ResourceData, meta interface{}) error {
126126
defer logElapsed("data_source.tencentcloud_cfs_file_systems.read")()
127127
logId := getLogId(contextNil)
128-
ctx := context.WithValue(context.TODO(), "logId", logId)
128+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
129129
cfsService := CfsService{
130130
client: meta.(*TencentCloudClient).apiV3Conn,
131131
}

tencentcloud/data_source_tc_clb_attachments.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ func dataSourceTencentCloudClbServerAttachments() *schema.Resource {
7777
"targets": {
7878
Type: schema.TypeSet,
7979
Computed: true,
80-
MinItems: 1,
81-
MaxItems: 100,
8280
Description: "Information of the backends to be attached.",
8381
Elem: &schema.Resource{
8482
Schema: map[string]*schema.Schema{
@@ -111,7 +109,7 @@ func dataSourceTencentCloudClbServerAttachmentsRead(d *schema.ResourceData, meta
111109
defer logElapsed("data_source.tencentcloud_clb_attachments.read")()
112110

113111
logId := getLogId(contextNil)
114-
ctx := context.WithValue(context.TODO(), "logId", logId)
112+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
115113

116114
params := make(map[string]string)
117115
clbId := d.Get("clb_id").(string)

tencentcloud/data_source_tc_clb_instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func dataSourceTencentCloudClbInstancesRead(d *schema.ResourceData, meta interfa
145145
defer logElapsed("data_source.tencentcloud_clb_instances.read")()
146146

147147
logId := getLogId(contextNil)
148-
ctx := context.WithValue(context.TODO(), "logId", logId)
148+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
149149

150150
params := make(map[string]interface{})
151151
if v, ok := d.GetOk("clb_id"); ok {

tencentcloud/data_source_tc_clb_listener_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func dataSourceTencentCloudClbListenerRulesRead(d *schema.ResourceData, meta int
175175
defer logElapsed("data_source.tencentcloud_clb_listener_rules.read")()
176176

177177
logId := getLogId(contextNil)
178-
ctx := context.WithValue(context.TODO(), "logId", logId)
178+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
179179

180180
listenerId := d.Get("listener_id").(string)
181181
clbId := d.Get("clb_id").(string)

tencentcloud/data_source_tc_clb_listeners.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func dataSourceTencentCloudClbListenersRead(d *schema.ResourceData, meta interfa
153153
defer logElapsed("data_source.tencentcloud_clb_listeners.read")()
154154

155155
logId := getLogId(contextNil)
156-
ctx := context.WithValue(context.TODO(), "logId", logId)
156+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
157157

158158
clbId := d.Get("clb_id").(string)
159159

tencentcloud/data_source_tc_clb_redirections.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func dataSourceTencentCloudClbRedirectionsRead(d *schema.ResourceData, meta inte
102102
defer logElapsed("data_source.tencentcloud_clb_redirections.read")()
103103

104104
logId := getLogId(contextNil)
105-
ctx := context.WithValue(context.TODO(), "logId", logId)
105+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
106106

107107
params := make(map[string]string)
108108
params["clb_id"] = d.Get("clb_id").(string)

0 commit comments

Comments
 (0)