This commit is contained in:
Caleb Doxsey 2023-10-30 15:31:41 -06:00 committed by GitHub
parent 70d77b283b
commit a18ef67be9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 865 additions and 775 deletions

View file

@ -114,6 +114,7 @@ func NewFileOrEnvironmentSource(
cfg := &Config{
Options: options,
EnvoyVersion: envoyVersion,
Version: 1,
}
ports, err := netutil.AllocatePorts(6)
@ -151,6 +152,7 @@ func (src *FileOrEnvironmentSource) check(ctx context.Context) {
options, err := newOptionsFromConfig(src.configFile)
if err == nil {
cfg = cfg.Clone()
cfg.Version++
cfg.Options = options
metrics.SetConfigInfo(ctx, cfg.Options.Services, "local", cfg.Checksum(), true)
} else {
@ -160,6 +162,8 @@ func (src *FileOrEnvironmentSource) check(ctx context.Context) {
src.config = cfg
src.mu.Unlock()
log.Info(ctx).Int64("config-version", cfg.Version).Msg("config: loaded configuration")
src.Trigger(ctx, cfg)
}