Skip to content

Commit 744e512

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents 8277bd4 + 5f7c213 commit 744e512

File tree

245 files changed

+274
-22
lines changed

Some content is hidden

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

245 files changed

+274
-22
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion

gendoc/main.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,24 @@ func main() {
4040
filePath := filepath.Dir(filename)
4141
message("generating doc from: %s\n", filePath)
4242

43-
// document for DataSources
44-
for k, v := range provider.DataSourcesMap {
45-
genDoc("data_source", filePath, k, v)
46-
}
43+
// document for Index
44+
products := genIdx(filePath)
4745

48-
// document for Resources
49-
for k, v := range provider.ResourcesMap {
50-
genDoc("resource", filePath, k, v)
51-
}
46+
for _, product := range products {
47+
// document for DataSources
48+
for _, dataSource := range product.DataSources {
49+
genDoc(product.Name, "data_source", filePath, dataSource, provider.DataSourcesMap[dataSource])
50+
}
5251

53-
// document for Index
54-
genIdx(filePath)
52+
// document for Resources
53+
for _, resource := range product.Resources {
54+
genDoc(product.Name, "resource", filePath, resource, provider.ResourcesMap[resource])
55+
}
56+
}
5557
}
5658

5759
// genIdx generating index for resource
58-
func genIdx(filePath string) {
60+
func genIdx(filePath string) (prods []Product) {
5961
filename := "provider.go"
6062

6163
message("[START]get description from file: %s\n", filename)
@@ -81,7 +83,7 @@ func genIdx(filePath string) {
8183
doc := strings.TrimSpace(description[pos+16:])
8284
// description = strings.TrimSpace(description[:pos])
8385

84-
prods, err := GetIndex(doc)
86+
prods, err = GetIndex(doc)
8587
if err != nil {
8688
message("[FAIL!]: %s", err)
8789
os.Exit(1)
@@ -111,11 +113,13 @@ func genIdx(filePath string) {
111113
}
112114

113115
message("[SUCC.]write doc to file success: %s", filename)
116+
return
114117
}
115118

116119
// genDoc generating doc for data source and resource
117-
func genDoc(dtype, fpath, name string, resource *schema.Resource) {
120+
func genDoc(product, dtype, fpath, name string, resource *schema.Resource) {
118121
data := map[string]string{
122+
"product": product,
119123
"name": name,
120124
"dtype": strings.Replace(dtype, "_", "", -1),
121125
"resource": name[len(cloudMark)+1:],

gendoc/template.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
const (
44
docTPL = `---
5+
subcategory: "{{.product}}"
56
layout: "{{.cloud_mark}}"
67
page_title: "{{.cloud_title}}: {{.name}}"
78
sidebar_current: "docs-{{.cloud_mark}}-{{.dtype}}-{{.resource}}"

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require (
1616
github.com/mitchellh/go-homedir v1.1.0
1717
github.com/pkg/errors v0.9.1
1818
github.com/tencentcloud/tencentcloud-sdk-go v3.0.229+incompatible
19-
github.com/terraform-providers/terraform-provider-tencentcloud v1.38.3 // indirect
2019
github.com/yangwenmai/ratelimit v0.0.0-20180104140304-44221c2292e1
2120
github.com/zclconf/go-cty v1.4.2 // indirect
2221
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,8 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s
458458
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
459459
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ=
460460
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
461-
github.com/tencentcloud/tencentcloud-sdk-go v3.0.196+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
462461
github.com/tencentcloud/tencentcloud-sdk-go v3.0.229+incompatible h1:ZlFfQuJYC+g2bEjlZUvIUQUifHhzWM69GTzFh0qzLl4=
463462
github.com/tencentcloud/tencentcloud-sdk-go v3.0.229+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
464-
github.com/terraform-providers/terraform-provider-tencentcloud v1.38.3 h1:1RfGV7CiPmeyrG41LdvuJ3CmPao2QxHnEQnXKqVAxSk=
465-
github.com/terraform-providers/terraform-provider-tencentcloud v1.38.3/go.mod h1:5jcaioF+8fIC9h4RBZV0e32uanncMZr5c2/8p/CWCU8=
466463
github.com/tetafro/godot v0.3.7 h1:+mecr7RKrUKB5UQ1gwqEMn13sDKTyDR8KNIquB9mm+8=
467464
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
468465
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q=

tencentcloud/extension_mongodb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func TencentMongodbBasicInfo() map[string]*schema.Schema {
153153
"tags": {
154154
Type: schema.TypeMap,
155155
Optional: true,
156-
Description: "The tags of the Mongodb.",
156+
Description: "The tags of the Mongodb. Key name `project` is system reserved and can't be used.",
157157
},
158158
// payment
159159
"charge_type": {

tencentcloud/resource_tc_mongodb_instance.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ func resourceTencentCloudMongodbInstanceRead(d *schema.ResourceData, meta interf
366366
if tag.TagValue == nil {
367367
return errors.New("mongodb tag value is nil")
368368
}
369+
if *tag.TagKey == "project" {
370+
continue
371+
}
369372

370373
tags[*tag.TagKey] = *tag.TagValue
371374
}

tencentcloud/resource_tc_mongodb_sharding_instance.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ func resourceMongodbShardingInstanceRead(d *schema.ResourceData, meta interface{
361361
if tag.TagValue == nil {
362362
return errors.New("mongodb tag value is nil")
363363
}
364+
if *tag.TagKey == "project" {
365+
continue
366+
}
364367

365368
tags[*tag.TagKey] = *tag.TagValue
366369
}

tencentcloud/resource_tc_mongodb_standby_instance.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ func resourceTencentCloudMongodbStandbyInstanceRead(d *schema.ResourceData, meta
421421
if tag.TagValue == nil {
422422
return errors.New("mongodb tag value is nil")
423423
}
424+
if *tag.TagKey == "project" {
425+
continue
426+
}
424427

425428
tags[*tag.TagKey] = *tag.TagValue
426429
}

website/docs/d/as_scaling_configs.html.markdown

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)