Skip to content

Commit 71b753f

Browse files
authored
fix(fgs/function): adjust the parameter encrypted_user_data and depend_list (#6336)
* fix(fgs/function): the value of the encrypted user data not returned * chore(fgs/function): deprecate depend list and supports version list
1 parent 856f249 commit 71b753f

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

docs/resources/fgs_function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ $ terraform import huaweicloud_fgs_function.test <id>
505505
```
506506

507507
Note that the imported state may not be identical to your resource definition, due to the attribute missing from the
508-
API response. The missing attributes are: `app`, `func_code`, `tags`.
508+
API response. The missing attributes are: `app`, `func_code`, `encrypted_user_data`, `tags`.
509509
It is generally recommended running `terraform plan` after importing a function.
510510
You can then decide if changes should be applied to the function, or the resource definition should be updated to align
511511
with the function. Also you can ignore changes as below.

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962
7-
github.com/chnsz/golangsdk v0.0.0-20250207083604-9eb3506329cf
7+
github.com/chnsz/golangsdk v0.0.0-20250217034539-d16a3d7dc780
88
github.com/hashicorp/go-cleanhttp v0.5.2
99
github.com/hashicorp/go-multierror v1.1.1
1010
github.com/hashicorp/go-uuid v1.0.3
@@ -17,6 +17,9 @@ require (
1717
github.com/stretchr/testify v1.8.4
1818
github.com/thedevsaddam/gojsonq v2.3.0+incompatible
1919
github.com/tidwall/gjson v1.17.1
20+
github.com/tjfoc/gmsm v1.4.1
21+
go.mongodb.org/mongo-driver v1.12.0
22+
golang.org/x/crypto v0.21.0
2023
)
2124

2225
require (
@@ -57,13 +60,10 @@ require (
5760
github.com/pmezard/go-difflib v1.0.0 // indirect
5861
github.com/tidwall/match v1.1.1 // indirect
5962
github.com/tidwall/pretty v1.2.0 // indirect
60-
github.com/tjfoc/gmsm v1.4.1 // indirect
6163
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
6264
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
6365
github.com/vmihailenco/tagparser v0.1.1 // indirect
6466
github.com/zclconf/go-cty v1.11.0 // indirect
65-
go.mongodb.org/mongo-driver v1.12.0 // indirect
66-
golang.org/x/crypto v0.21.0 // indirect
6767
golang.org/x/net v0.23.0 // indirect
6868
golang.org/x/sys v0.18.0 // indirect
6969
golang.org/x/text v0.14.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6
2222
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
2323
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
2424
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
25-
github.com/chnsz/golangsdk v0.0.0-20250207083604-9eb3506329cf h1:TLRIbEinizoM7AL8JJJMFBzv2B295Q8B7uHKSkAwxFI=
26-
github.com/chnsz/golangsdk v0.0.0-20250207083604-9eb3506329cf/go.mod h1:Erm4hDWxXgAdbkG3+hhJFgRzEL1TvvcroWzw2Gax4uI=
25+
github.com/chnsz/golangsdk v0.0.0-20250217034539-d16a3d7dc780 h1:diWEvRNeM/FktUT+HWiv6z9LLpG3smWeKCNpAyGq5m0=
26+
github.com/chnsz/golangsdk v0.0.0-20250217034539-d16a3d7dc780/go.mod h1:Erm4hDWxXgAdbkG3+hhJFgRzEL1TvvcroWzw2Gax4uI=
2727
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
2828
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
2929
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=

huaweicloud/services/fgs/resource_huaweicloud_fgs_function.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ func resourceFgsFunctionRead(_ context.Context, d *schema.ResourceData, meta int
984984
d.Set("runtime", f.Runtime),
985985
d.Set("timeout", f.Timeout),
986986
d.Set("user_data", f.UserData),
987-
d.Set("encrypted_user_data", f.EncryptedUserData),
988987
d.Set("version", f.Version),
989988
d.Set("urn", functionUrn),
990989
d.Set("app_agency", f.AppXrole),
@@ -1424,7 +1423,7 @@ func resourceFgsFunctionCodeUpdate(fgsClient *golangsdk.ServiceClient, urn strin
14241423
for _, depend := range dependListRaw.List() {
14251424
dependList = append(dependList, depend.(string))
14261425
}
1427-
updateCodeOpts.DependList = dependList
1426+
updateCodeOpts.DependVersionList = dependList
14281427
}
14291428

14301429
if v, ok := d.GetOk("func_code"); ok {

vendor/github.com/chnsz/golangsdk/openstack/fgs/v2/function/requests.go

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ github.com/apparentlymart/go-cidr/cidr
1313
# github.com/apparentlymart/go-textseg/v13 v13.0.0
1414
## explicit; go 1.16
1515
github.com/apparentlymart/go-textseg/v13/textseg
16-
# github.com/chnsz/golangsdk v0.0.0-20250207083604-9eb3506329cf
16+
# github.com/chnsz/golangsdk v0.0.0-20250217034539-d16a3d7dc780
1717
## explicit; go 1.14
1818
github.com/chnsz/golangsdk
1919
github.com/chnsz/golangsdk/auth
@@ -187,7 +187,6 @@ github.com/chnsz/golangsdk/openstack/evs/v2/cloudvolumes
187187
github.com/chnsz/golangsdk/openstack/evs/v2/snapshots
188188
github.com/chnsz/golangsdk/openstack/evs/v5/cloudvolumes
189189
github.com/chnsz/golangsdk/openstack/fgs/v2/aliases
190-
github.com/chnsz/golangsdk/openstack/fgs/v2/application
191190
github.com/chnsz/golangsdk/openstack/fgs/v2/dependencies
192191
github.com/chnsz/golangsdk/openstack/fgs/v2/function
193192
github.com/chnsz/golangsdk/openstack/fgs/v2/trigger
@@ -360,7 +359,6 @@ github.com/chnsz/golangsdk/openstack/waf_hw/v1/whiteblackip_rules
360359
github.com/chnsz/golangsdk/openstack/workspace/v2/accesspolicies
361360
github.com/chnsz/golangsdk/openstack/workspace/v2/desktops
362361
github.com/chnsz/golangsdk/openstack/workspace/v2/groups
363-
github.com/chnsz/golangsdk/openstack/workspace/v2/jobs
364362
github.com/chnsz/golangsdk/openstack/workspace/v2/policygroups
365363
github.com/chnsz/golangsdk/openstack/workspace/v2/services
366364
github.com/chnsz/golangsdk/openstack/workspace/v2/terminals

0 commit comments

Comments
 (0)