Skip to content

Commit

Permalink
Force send Enable field for LogConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
skmatti committed May 26, 2020
1 parent 4c0e352 commit babffa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/backends/features/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func EnsureLogging(sp utils.ServicePort, be *composite.BackendService) bool {
if be.LogConfig == nil || expectedLogConfig.Enable != be.LogConfig.Enable ||
expectedLogConfig.SampleRate != be.LogConfig.SampleRate {
be.LogConfig = expectedLogConfig
klog.V(2).Infof("Updated Logging settings for service %s(Enable: %t, SampleRate: %f)", svcKey, be.LogConfig.Enable, be.LogConfig.SampleRate)
klog.V(2).Infof("Updated Logging settings for service %s and port %d (Enable: %t, SampleRate: %f)", svcKey, sp.Port, be.LogConfig.Enable, be.LogConfig.SampleRate)
return true
}
return false
Expand Down
3 changes: 3 additions & 0 deletions pkg/composite/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,9 @@ func (backendService *BackendService) ToGA() (*compute.BackendService, error) {
if ga.Iap != nil {
ga.Iap.ForceSendFields = []string{"Enabled", "Oauth2ClientId", "Oauth2ClientSecret"}
}
if ga.LogConfig != nil {
ga.LogConfig.ForceSendFields = []string{"Enable"}
}

return ga, nil
}
Expand Down

0 comments on commit babffa2

Please sign in to comment.