fix: sync should be disabled when enable is false (#3579)

Signed-off-by: Matthieu Mottet <m.mottet@outlook.com>
This commit is contained in:
mottetm
2025-11-24 15:51:56 +01:00
committed by GitHub
parent 7bc6637380
commit 6f0e05e676
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -126,7 +126,8 @@ func (e *ExtensionConfig) IsSyncEnabled() bool {
// 1. Explicitly enabled (Enable == true), OR
// 2. There are registries configured (enabled by default when registries exist)
// This matches the behavior in root.go where Sync.Enable defaults to true when registries are present
return e.Sync != nil && ((e.Sync.Enable != nil && *e.Sync.Enable) || len(e.Sync.Registries) > 0)
return e.Sync != nil && ((e.Sync.Enable != nil && *e.Sync.Enable) ||
(e.Sync.Enable == nil && len(e.Sync.Registries) > 0))
}
// IsScrubEnabled checks if scrub is enabled in this extensions config.
+5
View File
@@ -57,6 +57,11 @@ func buildSyncConfig(enabled bool) *config.ExtensionConfig {
ext := &config.ExtensionConfig{}
ext.Sync = &sync.Config{
Enable: &enabled,
Registries: []sync.RegistryConfig{
{
URLs: []string{"localhost"},
},
},
}
return ext