Skip to content

Commit

Permalink
CDM-483: fix issue with deleting secondary_hostnames (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-lukyanchyk authored Nov 29, 2023
1 parent ab2b695 commit 0857c49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gcore/resource_gcore_cdn_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ func resourceCDNResource() *schema.Resource {
"secondary_hostnames": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
DefaultFunc: func() (interface{}, error) {
return []string{}, nil
},
Expand Down Expand Up @@ -1198,6 +1197,7 @@ func resourceCDNResourceUpdate(ctx context.Context, d *schema.ResourceData, m in
req.SSLData = d.Get("ssl_data").(int)
req.OriginProtocol = resources.Protocol(d.Get("origin_protocol").(string))
req.Options = listToOptions(d.Get("options").([]interface{}))
req.SecondaryHostnames = make([]string, 0)
for _, hostname := range d.Get("secondary_hostnames").(*schema.Set).List() {
req.SecondaryHostnames = append(req.SecondaryHostnames, hostname.(string))
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/AlekSi/pointer v1.2.0
github.com/G-Core/gcore-dns-sdk-go v0.2.7-0.20230801110428-99ef24b50d4d
github.com/G-Core/gcore-storage-sdk-go v0.1.34
github.com/G-Core/gcorelabscdn-go v1.0.0
github.com/G-Core/gcorelabscdn-go v1.0.1
github.com/G-Core/gcorelabscloud-go v0.6.2
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ github.com/G-Core/gcore-storage-sdk-go v0.1.34 h1:0GPQfz1kA6mQi6fiisGsh0Um4H9PZe
github.com/G-Core/gcore-storage-sdk-go v0.1.34/go.mod h1:BUAEZZZJJt/+luRFunqziv3+JnbVMLbQXDWz9kV8Te8=
github.com/G-Core/gcorelabscdn-go v1.0.0 h1:aPjwy6UWAmi8p+Vi8OEfmDM4bOq5r+rkOi9SebbvPas=
github.com/G-Core/gcorelabscdn-go v1.0.0/go.mod h1:iSGXaTvZBzDHQW+rKFS918BgFVpONcyLEijwh8WsXpE=
github.com/G-Core/gcorelabscdn-go v1.0.1 h1:BsGnLIiH7nhvSwDLgnsaXIPIJZG6hpTsqeYPr+W6/qM=
github.com/G-Core/gcorelabscdn-go v1.0.1/go.mod h1:iSGXaTvZBzDHQW+rKFS918BgFVpONcyLEijwh8WsXpE=
github.com/G-Core/gcorelabscloud-go v0.6.2 h1:oCo3yurVnGKZLkRuQ7GVQK1LuLFEjq3mFWiX/PUI69M=
github.com/G-Core/gcorelabscloud-go v0.6.2/go.mod h1:13Z1USxlxPbDFuYQyWqfNexlk4kUvOYTXbnvV/Z1lZo=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down

0 comments on commit 0857c49

Please sign in to comment.