Sync images with a background context (#3537)

feat: Sync images with a background context

This means syncs/pulls will not be cancelled anymore when the requesting client disconnects.

The timeout used can be configured per registry

Signed-off-by: Lars Francke <git@lars-francke.de>
This commit is contained in:
Lars Francke
2025-11-20 17:52:27 +01:00
committed by GitHub
parent 4a03184f9c
commit 7fa53f5b0f
5 changed files with 75 additions and 16 deletions
+8 -2
View File
@@ -663,9 +663,15 @@ func applyDefaultValues(config *config.Config, viperInstance *viper.Viper, logge
config.Extensions.Sync.Enable = &defaultVal
}
for id, regCfg := range config.Extensions.Sync.Registries {
defaultSyncTimeout := 3 * time.Hour
for idx, regCfg := range config.Extensions.Sync.Registries {
if regCfg.TLSVerify == nil {
config.Extensions.Sync.Registries[id].TLSVerify = &defaultVal
config.Extensions.Sync.Registries[idx].TLSVerify = &defaultVal
}
if config.Extensions.Sync.Registries[idx].SyncTimeout == 0 {
config.Extensions.Sync.Registries[idx].SyncTimeout = defaultSyncTimeout
}
}
}