Skip to content

Commit

Permalink
Rename resources in container_node_pool_test to use sweeper prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
c2thorn authored and modular-magician committed Dec 11, 2019
1 parent 3d8c561 commit 9a39cfe
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
62 changes: 31 additions & 31 deletions google/resource_container_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
func TestAccContainerNodePool_basic(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -35,8 +35,8 @@ func TestAccContainerNodePool_basic(t *testing.T) {
func TestAccContainerNodePool_maxPodsPerNode(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -58,7 +58,7 @@ func TestAccContainerNodePool_maxPodsPerNode(t *testing.T) {
func TestAccContainerNodePool_namePrefix(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -81,7 +81,7 @@ func TestAccContainerNodePool_namePrefix(t *testing.T) {
func TestAccContainerNodePool_noName(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -103,8 +103,8 @@ func TestAccContainerNodePool_noName(t *testing.T) {
func TestAccContainerNodePool_withNodeConfig(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
nodePool := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
nodePool := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -160,8 +160,8 @@ func TestAccContainerNodePool_withGPU(t *testing.T) {
func TestAccContainerNodePool_withManagement(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
nodePool := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
nodePool := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))
management := `
management {
auto_repair = "true"
Expand Down Expand Up @@ -233,8 +233,8 @@ func TestAccContainerNodePool_withNodeConfigScopeAlias(t *testing.T) {
func TestAccContainerNodePool_regionalAutoscaling(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -287,8 +287,8 @@ func TestAccContainerNodePool_regionalAutoscaling(t *testing.T) {
func TestAccContainerNodePool_autoscaling(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -341,8 +341,8 @@ func TestAccContainerNodePool_autoscaling(t *testing.T) {
func TestAccContainerNodePool_resize(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -378,8 +378,8 @@ func TestAccContainerNodePool_resize(t *testing.T) {
func TestAccContainerNodePool_version(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -417,8 +417,8 @@ func TestAccContainerNodePool_version(t *testing.T) {
func TestAccContainerNodePool_regionalClusters(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -440,8 +440,8 @@ func TestAccContainerNodePool_regionalClusters(t *testing.T) {
func TestAccContainerNodePool_012_ConfigModeAttr(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -471,8 +471,8 @@ func TestAccContainerNodePool_012_ConfigModeAttr(t *testing.T) {
func TestAccContainerNodePool_EmptyGuestAccelerator(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -516,8 +516,8 @@ func TestAccContainerNodePool_EmptyGuestAccelerator(t *testing.T) {
func TestAccContainerNodePool_shieldedInstanceConfig(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10))
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(10))
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(10))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -591,7 +591,7 @@ resource "google_container_node_pool" "np" {
func testAccContainerNodePool_maxPodsPerNode(cluster, np string) string {
return fmt.Sprintf(`
resource "google_compute_network" "container_network" {
name = "container-net-%s"
name = "tf-test-container-net-%s"
auto_create_subnetworks = false
}
Expand Down Expand Up @@ -922,15 +922,15 @@ data "google_container_engine_versions" "central1c" {
}
resource "google_container_cluster" "cluster" {
name = "tf-cluster-nodepool-test-%s"
name = "tf-test-cluster-%s"
location = "us-central1-c"
initial_node_count = 1
node_version = data.google_container_engine_versions.central1c.latest_node_version
min_master_version = data.google_container_engine_versions.central1c.latest_master_version
}
resource "google_container_node_pool" "np_with_gpu" {
name = "tf-nodepool-test-%s"
name = "tf-test-nodepool-%s"
location = "us-central1-c"
cluster = google_container_cluster.cluster.name
Expand Down Expand Up @@ -965,13 +965,13 @@ resource "google_container_node_pool" "np_with_gpu" {
func testAccContainerNodePool_withNodeConfigScopeAlias() string {
return fmt.Sprintf(`
resource "google_container_cluster" "cluster" {
name = "tf-cluster-nodepool-test-%s"
name = "tf-test-cluster-%s"
location = "us-central1-a"
initial_node_count = 1
}
resource "google_container_node_pool" "np_with_node_config_scope_alias" {
name = "tf-nodepool-test-%s"
name = "tf-test-nodepool-%s"
location = "us-central1-a"
cluster = google_container_cluster.cluster.name
initial_node_count = 1
Expand Down
6 changes: 4 additions & 2 deletions google/resource_google_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"google.golang.org/api/iam/v1"
)

Expand Down Expand Up @@ -42,8 +43,9 @@ func resourceGoogleServiceAccount() *schema.Resource {
Optional: true,
},
"description": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringLenBetween(0, 256),
},
"project": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion google/resource_google_service_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccServiceAccount_basic(t *testing.T) {
displayName := "Terraform Test"
displayName2 := "Terraform Test Update"
desc := "test description"
desc2 := "test description update"
desc2 := ""
project := getTestProjectFromEnv()
expectedEmail := fmt.Sprintf("%s@%s.iam.gserviceaccount.com", accountId, project)
resource.Test(t, resource.TestCase{
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/google_service_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The following arguments are supported:
Can be updated without creating a new resource.

* `description` - (Optional) A text description of the service account.
Must be less than or equal to 256 UTF-8 bytes.

* `project` - (Optional) The ID of the project that the service account will be created in.
Defaults to the provider project configuration.
Expand Down

0 comments on commit 9a39cfe

Please sign in to comment.