mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Delete unused methods (#905)
This commit is contained in:
parent
fa58e0aa66
commit
283c8f89e3
@ -233,16 +233,6 @@ func testAccCheckComputeHealthCheckExists(n string, healthCheck *compute.HealthC
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckErrorCreating(n string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
_, ok := s.RootModule().Resources[n]
|
||||
if ok {
|
||||
return fmt.Errorf("HealthCheck %s created successfully with bad config", n)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckComputeHealthCheckThresholds(healthy, unhealthy int64, healthCheck *compute.HealthCheck) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
if healthCheck.HealthyThreshold != healthy {
|
||||
|
@ -687,18 +687,3 @@ func resourceComputeUrlMapImportState(d *schema.ResourceData, meta interface{})
|
||||
d.Set("name", d.Id())
|
||||
return []*schema.ResourceData{d}, nil
|
||||
}
|
||||
|
||||
func validateHostRules(v interface{}, k string) (ws []string, es []error) {
|
||||
pathMatchers := make(map[string]bool)
|
||||
hostRules := v.([]interface{})
|
||||
for _, hri := range hostRules {
|
||||
hr := hri.(map[string]interface{})
|
||||
pm := hr["path_matcher"].(string)
|
||||
if pathMatchers[pm] {
|
||||
es = append(es, fmt.Errorf("Multiple host_rule entries with the same path_matcher are not allowed. Please collapse all hosts with the same path_matcher into one host_rule"))
|
||||
return
|
||||
}
|
||||
pathMatchers[pm] = true
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -362,17 +362,3 @@ func getVpnTunnelLink(config *Config, project string, region string, tunnel stri
|
||||
return tunnel, nil
|
||||
|
||||
}
|
||||
|
||||
func getVpnTunnelName(vpntunnel string) (string, error) {
|
||||
|
||||
if strings.HasPrefix(vpntunnel, "https://www.googleapis.com/compute/") {
|
||||
// extract the VPN tunnel name from SelfLink URL
|
||||
vpntunnelName := vpntunnel[strings.LastIndex(vpntunnel, "/")+1:]
|
||||
if vpntunnelName == "" {
|
||||
return "", fmt.Errorf("VPN tunnel url not valid")
|
||||
}
|
||||
return vpntunnelName, nil
|
||||
}
|
||||
|
||||
return vpntunnel, nil
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import (
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
"google.golang.org/api/servicemanagement/v1"
|
||||
)
|
||||
|
||||
// Test that services can be enabled and disabled on a project
|
||||
@ -281,11 +280,3 @@ func testStringsToString(s []string) string {
|
||||
log.Printf("[DEBUG]: Converted list of strings to %s", r)
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func testManagedServicesToString(svcs []*servicemanagement.ManagedService) string {
|
||||
var b bytes.Buffer
|
||||
for _, s := range svcs {
|
||||
b.WriteString(s.ServiceName)
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ func TestAccGoogleSqlDatabase_basic(t *testing.T) {
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
|
||||
CheckDestroy: testAccGoogleSqlDatabaseDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: fmt.Sprintf(
|
||||
@ -46,7 +46,7 @@ func TestAccGoogleSqlDatabase_update(t *testing.T) {
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
|
||||
CheckDestroy: testAccGoogleSqlDatabaseDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: fmt.Sprintf(
|
||||
|
@ -298,14 +298,6 @@ func convertStringSet(set *schema.Set) []string {
|
||||
return s
|
||||
}
|
||||
|
||||
func convertArrToMap(ifaceArr []interface{}) map[string]struct{} {
|
||||
sm := make(map[string]struct{})
|
||||
for _, s := range ifaceArr {
|
||||
sm[s.(string)] = struct{}{}
|
||||
}
|
||||
return sm
|
||||
}
|
||||
|
||||
func mergeSchemas(a, b map[string]*schema.Schema) map[string]*schema.Schema {
|
||||
merged := make(map[string]*schema.Schema)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user