Skip to content

THREESCALE-14267 Add 3 status conditions; Use new status for requeue#1155

Open
urbanikb wants to merge 2 commits into3scale:masterfrom
urbanikb:THREESCALE-14267
Open

THREESCALE-14267 Add 3 status conditions; Use new status for requeue#1155
urbanikb wants to merge 2 commits into3scale:masterfrom
urbanikb:THREESCALE-14267

Conversation

@urbanikb
Copy link
Copy Markdown
Contributor

@urbanikb urbanikb commented Apr 6, 2026

Fix:

What

Previously, APIManager exposed a single Available condition that collapsed three independent system checks into one opaque signal. When Available=False there was no way to tell from the CR alone whether the problem was with deployments, routes, or secrets.

New conditions

Three independent sub-conditions are now present in .status.conditions:

Condition True when
DeploymentsAvailable All expected deployments have at least one available replica
RoutesReady All expected routes are admitted by the router
SecretsAvailable All externally-referenced secrets (Redis, database, custom policies, etc.) exist in the cluster

Available remains a roll-up: True if all above sub-conditions are True.

Change in status reporting

Before: On a broken install you would see:

  - type: Available
    status: "False"

After: The root cause is visible without inspecting cluster resources:

  - type: Available
    status: "False"
  - type: DeploymentsAvailable
    status: "False"
    reason: DeploymentsNotAvailable
    message: "The following deployment(s) are not available: backend-listener, backend-worker"
  - type: RoutesReady
    status: "True"
  - type: SecretsAvailable
    status: "True"

Backwards compatibility

The Available condition continues to surface Reason and Message from SecretsAvailable when secrets are missing, preserving existing automation that reads those fields from Available.

Verification

Tested that the status behaves as expected (namespace 3scale-abc below).

Also verified that if a different version of operator (earlier 2.16 from public bundle) is installed in a different namespace (namespace 3scale-parallel), it will be able to set status on the CR in that namespace.

borisurbanik@Boriss-MacBook-Pro 3scale-operator % oc get apimanager -n 3scale-parallel 3scale -o yaml | yq '.status.conditions'
- lastTransitionTime: "2026-04-08T14:52:05Z"
  status: "False"
  type: Available
- message: All requirements for the current version are met
  reason: PreflightsPass
  status: "True"
  type: Preflights
borisurbanik@Boriss-MacBook-Pro 3scale-operator % oc get apimanager -n 3scale-abc 3scale -o yaml | yq '.status.conditions'
- lastTransitionTime: "2026-04-08T14:55:50Z"
  status: "False"
  type: Available
- lastTransitionTime: "2026-04-08T14:55:50Z"
  message: 'The following deployment(s) are not available: apicast-staging, apicast-production, backend-listener, backend-worker, system-memcache, system-app, system-sidekiq, system-searchd, zync, zync-que, zync-database'
  reason: DeploymentsNotAvailable
  status: "False"
  type: DeploymentsAvailable
- lastTransitionTime: "2026-04-08T14:55:50Z"
  message: 'The following route(s) are not yet admitted: backend-3scale.apps.burbanik.cp.fyre.ibm.com, api-3scale-apicast-production.apps.burbanik.cp.fyre.ibm.com, api-3scale-apicast-staging.apps.burbanik.cp.fyre.ibm.com, master.apps.burbanik.cp.fyre.ibm.com, 3scale.apps.burbanik.cp.fyre.ibm.com, 3scale-admin.apps.burbanik.cp.fyre.ibm.com'
  reason: RoutesNotReady
  status: "False"
  type: RoutesReady
- lastTransitionTime: "2026-04-08T14:55:50Z"
  status: "True"
  type: SecretsAvailable
borisurbanik@Boriss-MacBook-Pro 3scale-operator % oc get apimanager -n 3scale-abc 3scale -o yaml | yq '.status.conditions'
- lastTransitionTime: "2026-04-08T14:55:50Z"
  status: "False"
  type: Available
- lastTransitionTime: "2026-04-08T15:02:33Z"
  status: "True"
  type: DeploymentsAvailable
- lastTransitionTime: "2026-04-08T14:55:50Z"
  message: 'The following route(s) are not yet admitted: backend-3scale.apps.burbanik.cp.fyre.ibm.com'
  reason: RoutesNotReady
  status: "False"
  type: RoutesReady
- lastTransitionTime: "2026-04-08T14:55:50Z"
  status: "True"
  type: SecretsAvailable
borisurbanik@Boriss-MacBook-Pro 3scale-operator % oc get apimanager -n 3scale-parallel 3scale -o yaml | yq '.status.conditions'
- lastTransitionTime: "2026-04-08T14:52:05Z"
  status: "False"
  type: Available
- message: All requirements for the current version are met
  reason: PreflightsPass
  status: "True"
  type: Preflights
borisurbanik@Boriss-MacBook-Pro 3scale-operator % oc get apimanager -n 3scale-parallel 3scale -o yaml | yq '.status.conditions'
- lastTransitionTime: "2026-04-08T16:08:24Z"
  status: "True"
  type: Available
- message: All requirements for the current version are met
  reason: PreflightsPass
  status: "True"
  type: Preflights

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 6, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 89.58333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.16%. Comparing base (4963add) to head (3e09410).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
controllers/apps/apimanager_status_reconciler.go 89.28% 5 Missing and 4 partials ⚠️
pkg/helper/route.go 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1155      +/-   ##
==========================================
+ Coverage   41.84%   43.16%   +1.31%     
==========================================
  Files         203      203              
  Lines       20859    20885      +26     
==========================================
+ Hits         8729     9015     +286     
+ Misses      11350    11056     -294     
- Partials      780      814      +34     
Flag Coverage Δ
unit 43.16% <89.58%> (+1.31%) ⬆️

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

Components Coverage Δ
apis/apps/v1alpha1 (u) 62.45% <ø> (+3.90%) ⬆️
apis/capabilities/v1alpha1 (u) 3.50% <ø> (ø)
apis/capabilities/v1beta1 (u) 20.21% <ø> (ø)
controllers (i) 12.08% <89.28%> (+2.76%) ⬆️
pkg (u) 62.38% <91.66%> (+0.67%) ⬆️
Files with missing lines Coverage Δ
apis/apps/v1alpha1/apimanager_types.go 63.60% <ø> (+4.02%) ⬆️
pkg/helper/route.go 89.47% <91.66%> (+89.47%) ⬆️
controllers/apps/apimanager_status_reconciler.go 74.01% <89.28%> (+74.01%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@urbanikb urbanikb force-pushed the THREESCALE-14267 branch 2 times, most recently from e9384ab to a1878ac Compare April 7, 2026 20:56
@urbanikb urbanikb marked this pull request as ready for review April 7, 2026 20:57
@urbanikb urbanikb requested a review from a team as a code owner April 7, 2026 20:57
@urbanikb urbanikb force-pushed the THREESCALE-14267 branch 3 times, most recently from 08bb744 to 3f10de5 Compare April 14, 2026 20:55
Comment thread controllers/subscription/subscription_controller.go Outdated
Comment thread controllers/apps/apimanager_status_reconciler.go Outdated
Comment thread controllers/apps/apimanager_status_reconciler.go Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tkan145
tkan145 previously approved these changes Apr 17, 2026
Copy link
Copy Markdown
Contributor

@tkan145 tkan145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with both fresh installations and upgrades, the code works perfectly.

/lgtm
/approve

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants