-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
b848d23
commit 67f0e81
Showing
4 changed files
with
123 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,29 +40,6 @@ func TestAccCloudRunService_cloudRunServiceUpdate(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccCloudRunService_cloudRunServiceSql(t *testing.T) { | ||
t.Parallel() | ||
|
||
project := getTestProjectFromEnv() | ||
name := "tftest-cloudrun-" + acctest.RandString(6) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccCloudRunService_cloudRunServiceSql(name, project), | ||
}, | ||
{ | ||
ResourceName: "google_cloud_run_service.default", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "status.0.conditions"}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccCloudRunService_cloudRunServiceUpdate(name, project, concurrency string) string { | ||
return fmt.Sprintf(` | ||
resource "google_cloud_run_service" "default" { | ||
|
@@ -90,61 +67,3 @@ resource "google_cloud_run_service" "default" { | |
} | ||
`, name, project, concurrency) | ||
} | ||
|
||
func testAccCloudRunService_cloudRunServiceSql(name, project string) string { | ||
return fmt.Sprintf(` | ||
data "google_project" "project" {} | ||
resource "google_sql_database_instance" "instance" { | ||
name = "tf-test-%s" | ||
region = "us-east1" | ||
settings { | ||
tier = "D0" | ||
} | ||
} | ||
resource "google_cloud_run_service" "default" { | ||
location = "us-east1" | ||
name = "%s" | ||
metadata { | ||
namespace = "%s" | ||
labels = { | ||
"cloud.googleapis.com/location" = "us-east1" | ||
"foo" = "bar" | ||
} | ||
} | ||
template { | ||
metadata { | ||
annotations = { | ||
"autoscaling.knative.dev/maxScale" = "1000" | ||
"run.googleapis.com/cloudsql-instances" = "%s:us-east1:${google_sql_database_instance.instance.name}" | ||
"run.googleapis.com/client-name" = "cloud-console" | ||
} | ||
} | ||
spec { | ||
service_account_name = "${data.google_project.project.number}[email protected]" | ||
containers { | ||
image = "gcr.io/cloudrun/hello" | ||
args = ["arrg2", "pirate"] | ||
resources { | ||
limits = { | ||
cpu = "1000m" | ||
memory = "256Mi" | ||
} | ||
} | ||
} | ||
container_concurrency = 10 | ||
} | ||
} | ||
traffic { | ||
percent = 100 | ||
latest_revision = true | ||
} | ||
} | ||
`, acctest.RandString(6), name, project, project) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters