-
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.
[blocked] Cloudrun beta implementation on alpha KNative
Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
aa532e7
commit 8bcf33a
Showing
2 changed files
with
96 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// ---------------------------------------------------------------------------- | ||
// | ||
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** | ||
// | ||
// ---------------------------------------------------------------------------- | ||
// | ||
// This file is automatically generated by Magic Modules and manual | ||
// changes will be clobbered when the file is regenerated. | ||
// | ||
// Please read more about how to change this file in | ||
// .github/CONTRIBUTING.md. | ||
// | ||
// ---------------------------------------------------------------------------- | ||
|
||
package google | ||
|
||
import "github.com/hashicorp/terraform/helper/schema" | ||
|
||
// If the base path has changed as a result of your PR, make sure to update | ||
// the provider_reference page! | ||
var TestDefaultBasePath = "http://localhost:5000/" | ||
var TestCustomEndpointEntryKey = "test_custom_endpoint" | ||
var TestCustomEndpointEntry = &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: validateCustomEndpoint, | ||
DefaultFunc: schema.MultiEnvDefaultFunc([]string{ | ||
"GOOGLE_TEST_CUSTOM_ENDPOINT", | ||
}, TestDefaultBasePath), | ||
} | ||
|
||
var GeneratedTestResourcesMap = map[string]*schema.Resource{} |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package google | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccCloudrunService_cloudrunServiceUpdate(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_cloudrunServiceUpdate(name, project, "10"), | ||
}, | ||
{ | ||
ResourceName: "google_cloudrun_service.default", | ||
ImportStateId: "us-central1/" + name, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"}, | ||
}, | ||
{ | ||
Config: testAccCloudrunService_cloudrunServiceUpdate(name, project, "50"), | ||
}, | ||
{ | ||
ResourceName: "google_cloudrun_service.default", | ||
ImportStateId: "us-central1/" + name, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccCloudrunService_cloudrunServiceUpdate(name, project, concurrency string) string { | ||
return fmt.Sprintf(` | ||
resource "google_cloudrun_service" "default" { | ||
name = "%s" | ||
location = "us-central1" | ||
metadata { | ||
namespace = "%s" | ||
} | ||
spec { | ||
container { | ||
image = "gcr.io/cloudrun/hello" | ||
args = ["arrgs"] | ||
} | ||
container_concurrency = %s | ||
} | ||
} | ||
`, name, project, concurrency) | ||
} |