From 82880f40dc842eb3ebf4676535d951649d7919e6 Mon Sep 17 00:00:00 2001 From: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 19:01:32 +0000 Subject: [PATCH] api: Add ComponentCache to ComponentSupportsConfigWhenManaged (#1320) PR #1314 added ComponentCache but did not update ComponentSupportsConfigWhenManaged() to include it alongside ComponentRedis, ComponentMirror, and ComponentRoute. This caused reconciliation to block when users upgraded with managed Redis (which auto-adds managed cache) and had custom DATA_MODEL_CACHE_CONFIG in their config bundle. This fix adds ComponentCache to the allowlist, enabling managed cache to coexist with user-provided cache configuration. The operator- generated cache config takes precedence via field-group merge in Inflate(), same behavior as managed Redis. Also updated test case at line 1070 to expect no error (experr: false) instead of error (experr: true), matching the pattern used for managed Redis at line 892. Note: pre-commit hooks could not run due to network error (HTTP 403 fetching golangci-lint from GitHub). The post-script will run authoritative pre-commit checks. Closes #1320 --- apis/quay/v1/quayregistry_types.go | 2 +- controllers/quay/quayregistry_controller_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apis/quay/v1/quayregistry_types.go b/apis/quay/v1/quayregistry_types.go index 11e3b69f8..6cd1f7563 100644 --- a/apis/quay/v1/quayregistry_types.go +++ b/apis/quay/v1/quayregistry_types.go @@ -390,7 +390,7 @@ func NeedsBundleSecret(quay *QuayRegistry) bool { // being Managed AND containing a custom user config provided through the config bundle // secret. func ComponentSupportsConfigWhenManaged(cmp Component) bool { - return cmp.Kind == ComponentRoute || cmp.Kind == ComponentMirror || cmp.Kind == ComponentRedis + return cmp.Kind == ComponentRoute || cmp.Kind == ComponentMirror || cmp.Kind == ComponentRedis || cmp.Kind == ComponentCache } func EnsureComponents(components []Component) []Component { diff --git a/controllers/quay/quayregistry_controller_test.go b/controllers/quay/quayregistry_controller_test.go index 2f7fdb60f..8b83bb252 100644 --- a/controllers/quay/quayregistry_controller_test.go +++ b/controllers/quay/quayregistry_controller_test.go @@ -1067,8 +1067,9 @@ func Test_hasNecessaryConfig(t *testing.T) { quay: quayWithUnmanagedComponents(v1.ComponentCache), }, { + // managed cache supports user config: operator overwrites infra fields anyway name: "managed cache and redis but with provided config", - experr: true, + experr: false, cfg: map[string][]byte{ "config.yaml": []byte("DATA_MODEL_CACHE_CONFIG:\n engine: redis\n redis_config:\n host: somehost\n port: 12345\n repository_blob_cache_ttl: 120s\n catalog_page_cache_ttl: 120s\n active_repo_tags_cache_ttl: 120s\n value_size_limit: 5MiB\n")}, quay: quayWithUnmanagedComponents(),