Skip to content

api(#1320): Add ComponentCache to ComponentSupportsConfigWhenManaged (#1320) - #1321

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
masterfrom
agent/1320-componentcache-config-support
Open

api(#1320): Add ComponentCache to ComponentSupportsConfigWhenManaged (#1320)#1321
fullsend-ai-coder[bot] wants to merge 1 commit into
masterfrom
agent/1320-componentcache-config-support

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds ComponentCache to ComponentSupportsConfigWhenManaged() to allow managed cache components to coexist with user-provided cache configuration.

PR #1314 introduced the ComponentCache feature but did not add it to the list of components that support custom config when managed (alongside ComponentRedis, ComponentMirror, and ComponentRoute). This caused reconciliation failures for users upgrading with managed Redis (which auto-adds managed cache) and custom DATA_MODEL_CACHE_CONFIG in their config bundle.

Changes

  • apis/quay/v1/quayregistry_types.go: Added || cmp.Kind == ComponentCache to ComponentSupportsConfigWhenManaged() at line 393
  • controllers/quay/quayregistry_controller_test.go: Updated test case "managed cache and redis but with provided config" to expect no error (experr: false), matching the pattern used for managed Redis

Testing

  • ✅ Unit test Test_hasNecessaryConfig now passes (previously would fail)
  • ✅ All targeted tests in ./controllers/quay/ pass
  • make fmt and make vet pass

Behavior

After this change:

  • Users with managed Redis + custom DATA_MODEL_CACHE_CONFIG can upgrade without reconciliation errors
  • Operator-generated cache config merges with user config (operator values take precedence), same as managed Redis behavior
  • No manual pre-upgrade actions required (removes need for docs workaround in docs/upgrades.md lines 22-24)

Closes #1320

Post-script verification

  • Branch is not main/master (agent/1320-componentcache-config-support)
  • Secret scan passed (gitleaks — bff5e1b5315f02bfc2373cb2e7039fb7e653a783..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

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
@openshift-ci

openshift-ci Bot commented Aug 26, 2026

Copy link
Copy Markdown

Hi @fullsend-ai-coder[bot]. Thanks for your PR.

I'm waiting for a quay member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.34%. Comparing base (bff5e1b) to head (82880f4).

Files with missing lines Patch % Lines
apis/quay/v1/quayregistry_types.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1321   +/-   ##
=======================================
  Coverage   67.34%   67.34%           
=======================================
  Files          27       27           
  Lines        4251     4251           
=======================================
  Hits         2863     2863           
  Misses       1388     1388           
Flag Coverage Δ
unit-tests 67.34% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
apis/quay/v1/quayregistry_types.go 45.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

ComponentCache not in ComponentSupportsConfigWhenManaged breaks upgrades

1 participant