Skip to content

Commit

Permalink
Merge pull request #1119 from skmatti/log-fix
Browse files Browse the repository at this point in the history
Force send Enable field for LogConfig
  • Loading branch information
k8s-ci-robot authored May 26, 2020
2 parents 311d713 + 12a7618 commit a294488
Show file tree
Hide file tree
Showing 3 changed files with 13 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
9 changes: 9 additions & 0 deletions pkg/composite/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3182,6 +3182,9 @@ func (backendService *BackendService) ToAlpha() (*computealpha.BackendService, e
if alpha.Iap != nil {
alpha.Iap.ForceSendFields = []string{"Enabled", "Oauth2ClientId", "Oauth2ClientSecret"}
}
if alpha.LogConfig != nil {
alpha.LogConfig.ForceSendFields = []string{"Enable"}
}

return alpha, nil
}
Expand All @@ -3201,6 +3204,9 @@ func (backendService *BackendService) ToBeta() (*computebeta.BackendService, err
if beta.Iap != nil {
beta.Iap.ForceSendFields = []string{"Enabled", "Oauth2ClientId", "Oauth2ClientSecret"}
}
if beta.LogConfig != nil {
beta.LogConfig.ForceSendFields = []string{"Enable"}
}

return beta, nil
}
Expand All @@ -3220,6 +3226,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
3 changes: 3 additions & 0 deletions pkg/composite/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,9 @@ func ({{$type.VarName}} *{{$type.Name}}) To{{$version}}() (*compute{{$extension}
if {{$lower}}.Iap != nil {
{{$lower}}.Iap.ForceSendFields = []string{"Enabled", "Oauth2ClientId", "Oauth2ClientSecret"}
}
if {{$lower}}.LogConfig != nil {
{{$lower}}.LogConfig.ForceSendFields = []string{"Enable"}
}
{{- end}}
return {{$lower}}, nil
Expand Down

0 comments on commit a294488

Please sign in to comment.