Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed min_required_replicas #3203

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/4738.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
compute: fixed the failure when `min_required_replicas` is set to 0 on `google_compute_autoscaler `
compute: fixed the failure when `min_required_replicas` is set to 0 on `google_compute_region_autoscaler`
```
2 changes: 1 addition & 1 deletion google-beta/resource_compute_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ func expandComputeAutoscalerAutoscalingPolicyScalingSchedules(v interface{}, d T
transformedMinRequiredReplicas, err := expandComputeAutoscalerAutoscalingPolicyScalingSchedulesMinRequiredReplicas(original["min_required_replicas"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedMinRequiredReplicas); val.IsValid() && !isEmptyValue(val) {
} else {
transformed["minRequiredReplicas"] = transformedMinRequiredReplicas
}

Expand Down
2 changes: 1 addition & 1 deletion google-beta/resource_compute_autoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ resource "google_compute_autoscaler" "foobar" {
scaling_schedules {
name = "every-weekday-morning"
description = "Increase to 2 every weekday at 7AM for 6 hours."
min_required_replicas = 2
min_required_replicas = 0
schedule = "0 7 * * MON-FRI"
time_zone = "America/New_York"
duration_sec = 21600
Expand Down
2 changes: 1 addition & 1 deletion google-beta/resource_compute_region_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ func expandComputeRegionAutoscalerAutoscalingPolicyScalingSchedules(v interface{
transformedMinRequiredReplicas, err := expandComputeRegionAutoscalerAutoscalingPolicyScalingSchedulesMinRequiredReplicas(original["min_required_replicas"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedMinRequiredReplicas); val.IsValid() && !isEmptyValue(val) {
} else {
transformed["minRequiredReplicas"] = transformedMinRequiredReplicas
}

Expand Down
2 changes: 1 addition & 1 deletion google-beta/resource_compute_region_autoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ resource "google_compute_region_autoscaler" "foobar" {
scaling_schedules {
name = "every-weekday-morning"
description = "Increase to 2 every weekday at 7AM for 6 hours."
min_required_replicas = 2
min_required_replicas = 0
schedule = "0 7 * * MON-FRI"
time_zone = "America/New_York"
duration_sec = 21600
Expand Down
2 changes: 1 addition & 1 deletion google-beta/resource_dataflow_flex_template_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
compute "google.golang.org/api/compute/v1"
"google.golang.org/api/compute/v1"
)

func TestAccDataflowFlexTemplateJob_basic(t *testing.T) {
Expand Down