Skip to content

Commit

Permalink
zuul: fix service rollout after logLevel change
Browse files Browse the repository at this point in the history
Sometime the service are not rolout. I guess that's a race condition
because we check the configMap content that have been just updated.

Instead relying on the computed data from the controller loop is more
solid.

Change-Id: I3f2f143bfe6a9fd1ed78cc03418d1fd9a4774130
  • Loading branch information
morucci committed Aug 19, 2024
1 parent d1426d0 commit f5d391d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 5 additions & 9 deletions controllers/zuul.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func mkZuulVolumes(service string, r *SFController, corporateCMExists bool) []ap
})

// Install the logging settings config map resource
r.ensureZuulLoggingConfigMap()
r.EnsureConfigMap("zuul-logging", r.computeLoggingConfig())

volumes := []apiv1.Volume{
base.MkVolumeSecret("ca-cert"),
Expand Down Expand Up @@ -348,7 +348,7 @@ func (r *SFController) getTenantsEnvs() []apiv1.EnvVar {
}
}

func (r *SFController) ensureZuulLoggingConfigMap() {
func (r *SFController) computeLoggingConfig() map[string]string {
loggingData := make(map[string]string)

zuulExecutorLogLevel := sfv1.InfoLogLevel
Expand Down Expand Up @@ -407,16 +407,12 @@ func (r *SFController) ensureZuulLoggingConfigMap() {
BaseURL: inputBaseURL,
})

r.EnsureConfigMap("zuul-logging", loggingData)

return loggingData
}

func (r *SFController) getZuulLoggingString(service string) string {
var loggingcm apiv1.ConfigMap
if !r.GetM("zuul-logging-config-map", &loggingcm) {
return ""
}
return loggingcm.Data[service+"-logging.yaml"]
loggingData := r.computeLoggingConfig()
return loggingData[service+"-logging.yaml"]
}

func (r *SFController) EnsureZuulScheduler(cfg *ini.File) bool {
Expand Down
3 changes: 3 additions & 0 deletions doc/reference/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ All notable changes to this project will be documented in this file.
### Deprecated
### Removed
### Fixed

- zuul: fix services not rollout after log level change

### Security

## [v0.0.36] - 2024-08-14
Expand Down

0 comments on commit f5d391d

Please sign in to comment.