Skip to content

Commit

Permalink
Bump go-fastly to v5 (#477)
Browse files Browse the repository at this point in the history
* switch references from v3 to v5

* update vendor directory

* update the code to use the new v4/v5 breaking interface changes

* update the tests to use the new breaking v4/v5 interface changes

* update backend description
  • Loading branch information
Integralist authored Sep 27, 2021
1 parent 4162fd3 commit 94d17d5
Show file tree
Hide file tree
Showing 219 changed files with 381 additions and 165 deletions.
2 changes: 1 addition & 1 deletion docs/resources/service_compute.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Optional:
- **ssl_ca_cert** (String) CA certificate attached to origin.
- **ssl_cert_hostname** (String) Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all
- **ssl_check_cert** (Boolean) Be strict about checking SSL certs. Default `true`
- **ssl_ciphers** (String) Comma separated list of OpenSSL Ciphers to try when negotiating to the backend
- **ssl_ciphers** (String) Cipher list consisting of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used.
- **ssl_client_cert** (String, Sensitive) Client certificate attached to origin. Used when connecting to the backend
- **ssl_client_key** (String, Sensitive) Client key attached to origin. Used when connecting to the backend
- **ssl_hostname** (String, Deprecated) Used for both SNI during the TLS handshake and to validate the cert
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/service_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Optional:
- **ssl_ca_cert** (String) CA certificate attached to origin.
- **ssl_cert_hostname** (String) Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all
- **ssl_check_cert** (Boolean) Be strict about checking SSL certs. Default `true`
- **ssl_ciphers** (String) Comma separated list of OpenSSL Ciphers to try when negotiating to the backend
- **ssl_ciphers** (String) Cipher list consisting of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used.
- **ssl_client_cert** (String, Sensitive) Client certificate attached to origin. Used when connecting to the backend
- **ssl_client_key** (String, Sensitive) Client key attached to origin. Used when connecting to the backend
- **ssl_hostname** (String, Deprecated) Used for both SNI during the TLS handshake and to validate the cert
Expand Down
2 changes: 1 addition & 1 deletion fastly/base_fastly_service_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
11 changes: 5 additions & 6 deletions fastly/block_fastly_service_v1_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"fmt"
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down Expand Up @@ -123,7 +122,7 @@ func (h *BackendServiceAttributeHandler) GetSchema() *schema.Schema {
Type: schema.TypeString,
Optional: true,
Default: "",
Description: "Comma separated list of OpenSSL Ciphers to try when negotiating to the backend",
Description: "Cipher list consisting of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used.",
},
"ssl_check_cert": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -285,7 +284,7 @@ func (h *BackendServiceAttributeHandler) buildCreateBackendInput(service string,
SSLClientCert: df["ssl_client_cert"].(string),
MaxTLSVersion: df["max_tls_version"].(string),
MinTLSVersion: df["min_tls_version"].(string),
SSLCiphers: strings.Split(df["ssl_ciphers"].(string), ","),
SSLCiphers: df["ssl_ciphers"].(string),
Shield: df["shield"].(string),
Port: uint(df["port"].(int)),
BetweenBytesTimeout: uint(df["between_bytes_timeout"].(int)),
Expand Down Expand Up @@ -390,7 +389,7 @@ func (h *BackendServiceAttributeHandler) buildUpdateBackendInput(serviceID strin
opts.MaxTLSVersion = gofastly.String(v.(string))
}
if v, ok := modified["ssl_ciphers"]; ok {
opts.SSLCiphers = strings.Split(v.(string), ",")
opts.SSLCiphers = v.(string)
}

return opts
Expand Down Expand Up @@ -420,7 +419,7 @@ func flattenBackend(backendList []*gofastly.Backend, sa ServiceMetadata) []map[s
"ssl_client_cert": b.SSLClientCert,
"max_tls_version": b.MaxTLSVersion,
"min_tls_version": b.MinTLSVersion,
"ssl_ciphers": strings.Join(b.SSLCiphers, ","),
"ssl_ciphers": b.SSLCiphers,
"use_ssl": b.UseSSL,
"ssl_cert_hostname": b.SSLCertHostname,
"ssl_sni_hostname": b.SSLSNIHostname,
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_bigquerylogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_bigquerylogging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_blobstoragelogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_blobstoragelogging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_cachesetting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_cachesetting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_dictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_dictionary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_director.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_director_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_dynamicsnippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_dynamicsnippet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_gcslogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_gcslogging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_gzip.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_gzip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_httpslogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_httpslogging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logentries.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logentries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logging_cloudfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logging_cloudfiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logging_datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logging_datadog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logging_digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"testing"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down
2 changes: 1 addition & 1 deletion fastly/block_fastly_service_v1_logging_elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

gofastly "github.com/fastly/go-fastly/v3/fastly"
gofastly "github.com/fastly/go-fastly/v5/fastly"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
Loading

0 comments on commit 94d17d5

Please sign in to comment.