The Config Merger is a controller that takes multiple configurations and merges them together.
It requires a list of configurations to merge together.
|
list, err := merger.ParseAndCheck(file) |
It then periodically reads those configs and merges them together. Changes in the config are picked up in this loop, but changes to the config list are not.
|
updateOnce := func(ctx context.Context) { |
|
start := time.Now() |
|
ctx, cancel := context.WithTimeout(ctx, 10*time.Minute) |
|
defer cancel() |
|
log.Info("Starting MergeAndUpdate") |
|
err := merger.MergeAndUpdate(ctx, client, list, opt.skipValidate, opt.confirm) |
|
cycle.Set(int64(time.Since(start).Seconds()), "config_merger") |
|
if err != nil { |
|
log.WithError(err).Error("Update failed") |
|
errors.Add(1, "config_merger") |
|
return |
|
} |
|
successes.Add(1, "config_merger") |
|
log.Info("Update successful") |
|
} |
This has caused issues when the config is changed, and Config Merger silently ignores those changes until it's rebooted. See GoogleCloudPlatform/oss-test-infra#919
Additional logic to determine if the config list has changed and to either log this event or do less work if it hasn't changed would also be nice.
The Config Merger is a controller that takes multiple configurations and merges them together.
It requires a list of configurations to merge together.
testgrid/cmd/config_merger/main.go
Line 93 in 651499d
It then periodically reads those configs and merges them together. Changes in the config are picked up in this loop, but changes to the config list are not.
testgrid/cmd/config_merger/main.go
Lines 111 to 125 in 651499d
This has caused issues when the config is changed, and Config Merger silently ignores those changes until it's rebooted. See GoogleCloudPlatform/oss-test-infra#919
Additional logic to determine if the config list has changed and to either log this event or do less work if it hasn't changed would also be nice.