Skip to content

Commit

Permalink
CDI-567: remove the webp legacy option (#78)
Browse files Browse the repository at this point in the history
* CDI-567: remove deprecated webp option
  • Loading branch information
andrei-lukyanchyk authored Feb 22, 2024
1 parent 4766aa5 commit 1d0ce69
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 96 deletions.
19 changes: 0 additions & 19 deletions docs/resources/cdn_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ resource "gcore_cdn_resource" "cdn_example_com" {
rewrite {
body = "/(.*) /$1"
}
webp {
jpg_quality = 55
png_quality = 66
}
tls_versions {
enabled = true
Expand Down Expand Up @@ -149,7 +145,6 @@ Optional:
- `use_rsa_le_cert` (Block List, Max: 1) The option allows choosing the RSA Let's Encrypt certificate type for the resource. (see [below for nested schema](#nestedblock--options--use_rsa_le_cert))
- `user_agent_acl` (Block List, Max: 1) User agents policy option allows to control access to the content for specified user-agent. (see [below for nested schema](#nestedblock--options--user_agent_acl))
- `waf` (Block List, Max: 1) Option allows to enable Basic WAF to protect you against the most common threats. (see [below for nested schema](#nestedblock--options--waf))
- `webp` (Block List, Max: 1) Legacy option. Use the image_stack option instead. (see [below for nested schema](#nestedblock--options--webp))
- `websockets` (Block List, Max: 1) WebSockets option allows WebSockets connections to an origin server. (see [below for nested schema](#nestedblock--options--websockets))

<a id="nestedblock--options--allowed_http_methods"></a>
Expand Down Expand Up @@ -680,20 +675,6 @@ Optional:
- `enabled` (Boolean)


<a id="nestedblock--options--webp"></a>
### Nested Schema for `options.webp`

Required:

- `jpg_quality` (Number)
- `png_quality` (Number)

Optional:

- `enabled` (Boolean)
- `png_lossless` (Boolean)


<a id="nestedblock--options--websockets"></a>
### Nested Schema for `options.websockets`

Expand Down
19 changes: 0 additions & 19 deletions docs/resources/cdn_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ resource "gcore_cdn_rule" "cdn_example_com_rule_1" {
rewrite {
body = "/(.*) /$1"
}
webp {
jpg_quality = 55
png_quality = 66
}
ignore_query_string {
value = true
}
Expand Down Expand Up @@ -183,7 +179,6 @@ Optional:
- `static_response_headers` (Block List, Max: 1) Specify custom HTTP Headers that a CDN server adds to a response. (see [below for nested schema](#nestedblock--options--static_response_headers))
- `user_agent_acl` (Block List, Max: 1) User agents policy option allows to control access to the content for specified user-agent. (see [below for nested schema](#nestedblock--options--user_agent_acl))
- `waf` (Block List, Max: 1) Option allows to enable Basic WAF to protect you against the most common threats. (see [below for nested schema](#nestedblock--options--waf))
- `webp` (Block List, Max: 1) Legacy option. Use the image_stack option instead. (see [below for nested schema](#nestedblock--options--webp))
- `websockets` (Block List, Max: 1) WebSockets option allows WebSockets connections to an origin server. (see [below for nested schema](#nestedblock--options--websockets))

<a id="nestedblock--options--allowed_http_methods"></a>
Expand Down Expand Up @@ -714,20 +709,6 @@ Optional:
- `enabled` (Boolean)


<a id="nestedblock--options--webp"></a>
### Nested Schema for `options.webp`

Required:

- `jpg_quality` (Number)
- `png_quality` (Number)

Optional:

- `enabled` (Boolean)
- `png_lossless` (Boolean)


<a id="nestedblock--options--websockets"></a>
### Nested Schema for `options.websockets`

Expand Down
5 changes: 0 additions & 5 deletions examples/resources/gcore_cdn_resource/example_2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ resource "gcore_cdn_resource" "cdn_example_com" {
use_rsa_le_cert {
value = true
}
webp {
enabled = false
jpg_quality = 55
png_quality = 66
}
websockets {
value = true
}
Expand Down
4 changes: 0 additions & 4 deletions examples/resources/gcore_cdn_resource/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ resource "gcore_cdn_resource" "cdn_example_com" {
rewrite {
body = "/(.*) /$1"
}
webp {
jpg_quality = 55
png_quality = 66
}

tls_versions {
enabled = true
Expand Down
5 changes: 0 additions & 5 deletions examples/resources/gcore_cdn_rule/example_2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,6 @@ resource "gcore_cdn_rule" "cdn_example_com_rule_1" {
"UserAgent"
]
}
webp {
enabled = false
jpg_quality = 55
png_quality = 66
}
websockets {
value = true
}
Expand Down
4 changes: 0 additions & 4 deletions examples/resources/gcore_cdn_rule/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ resource "gcore_cdn_rule" "cdn_example_com_rule_1" {
rewrite {
body = "/(.*) /$1"
}
webp {
jpg_quality = 55
png_quality = 66
}
ignore_query_string {
value = true
}
Expand Down
28 changes: 0 additions & 28 deletions gcore/resource_gcore_cdn_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,34 +903,6 @@ var (
},
},
},
"webp": { // deprecated in favor of image_stack
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Legacy option. Use the image_stack option instead.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Optional: true,
Default: true,
},
"jpg_quality": {
Type: schema.TypeInt,
Required: true,
},
"png_quality": {
Type: schema.TypeInt,
Required: true,
},
"png_lossless": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
},
},
},
"websockets": {
Type: schema.TypeList,
MaxItems: 1,
Expand Down
12 changes: 0 additions & 12 deletions gcore/resource_gcore_cdn_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,6 @@ func listToOptions(l []interface{}) *gcdn.Options {
Value: opt["value"].(bool),
}
}
if opt, ok := getOptByName(fields, "webp"); ok {
opts.Webp = &gcdn.Webp{
Enabled: opt["enabled"].(bool),
JPGQuality: opt["jpg_quality"].(int),
PNGQuality: opt["png_quality"].(int),
PNGLossless: opt["png_lossless"].(bool),
}
}
if opt, ok := getOptByName(fields, "websockets"); ok {
opts.WebSockets = &gcdn.WebSockets{
Enabled: opt["enabled"].(bool),
Expand Down Expand Up @@ -773,10 +765,6 @@ func optionsToList(options *gcdn.Options) []interface{} {
m := structToMap(options.WAF)
result["waf"] = []interface{}{m}
}
if options.Webp != nil {
m := structToMap(options.Webp)
result["webp"] = []interface{}{m}
}
if options.WebSockets != nil {
m := structToMap(options.WebSockets)
result["websockets"] = []interface{}{m}
Expand Down

0 comments on commit 1d0ce69

Please sign in to comment.