Skip to content

Commit

Permalink
fix permadiff on sample_rate (#7902) (#14590)
Browse files Browse the repository at this point in the history
* fix permadiff on sample_rate

* add a test step to cover the case

* use default value instead

* add same change to RegionBackendService

---------

Signed-off-by: Modular Magician <magic-modules@google.com>
Co-authored-by: Edward Sun <sunedward@google.com>
  • Loading branch information
modular-magician and Edward Sun committed May 12, 2023
1 parent a143c65 commit eb23928
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/7902.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
compute: fixed permadiff on `log_config.sample_rate` of `google_compute_backend_service`
```
1 change: 1 addition & 0 deletions google/resource_compute_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ If logging is enabled, logs will be exported to Stackdriver.`,
the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer
where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported.
The default value is 1.0.`,
Default: 1.0,
AtLeastOneOf: []string{"log_config.0.enable", "log_config.0.sample_rate"},
},
},
Expand Down
8 changes: 8 additions & 0 deletions google/resource_compute_backend_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,14 @@ func TestAccComputeBackendService_withLogConfig(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccComputeBackendService_withLogConfig2(serviceName, checkName, true),
},
{
ResourceName: "google_compute_backend_service.foobar",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccComputeBackendService_withLogConfig2(serviceName, checkName, false),
},
Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_region_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ If logging is enabled, logs will be exported to Stackdriver.`,
the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer
where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported.
The default value is 1.0.`,
Default: 1.0,
AtLeastOneOf: []string{"log_config.0.enable", "log_config.0.sample_rate"},
},
},
Expand Down

0 comments on commit eb23928

Please sign in to comment.