Skip to content

ROX-28151: custom registry cleanup#16176

Merged
parametalol merged 7 commits intomasterfrom
michael/ROX-28151-registry-cleanup
Sep 26, 2025
Merged

ROX-28151: custom registry cleanup#16176
parametalol merged 7 commits intomasterfrom
michael/ROX-28151-registry-cleanup

Conversation

@parametalol
Copy link
Copy Markdown
Contributor

@parametalol parametalol commented Jul 28, 2025

Description

The unused registries are not freed, which may lead to a memory leak.

This PR introduces a cleanup procedure to delete registries not being accessed for 2 days.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

CI

Current dependencies on/for this PR:

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jul 28, 2025

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

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Jul 28, 2025

Images are ready for the commit at 5a7fec1.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-886-g5a7fec10f3.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 91.11111% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.78%. Comparing base (eae6868) to head (5a7fec1).
⚠️ Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
central/metrics/custom/tracker/tracker_base.go 87.50% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16176      +/-   ##
==========================================
- Coverage   48.80%   48.78%   -0.03%     
==========================================
  Files        2696     2701       +5     
  Lines      201493   201905     +412     
==========================================
+ Hits        98340    98497     +157     
- Misses      95394    95644     +250     
- Partials     7759     7764       +5     
Flag Coverage Δ
go-unit-tests 48.78% <91.11%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@parametalol parametalol force-pushed the michael/ROX-28151-cached-user-registry branch from 5f63d54 to 8f83cd6 Compare August 18, 2025 16:10
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from 3f49f22 to 05066b1 Compare August 18, 2025 16:44
parametalol added a commit that referenced this pull request Sep 1, 2025
@parametalol parametalol force-pushed the michael/ROX-28151-cached-user-registry branch from 8f83cd6 to 15ab479 Compare September 1, 2025 09:43
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from 05066b1 to eade0bb Compare September 1, 2025 09:50
@parametalol parametalol marked this pull request as ready for review September 1, 2025 09:51
parametalol added a commit that referenced this pull request Sep 4, 2025
@parametalol parametalol force-pushed the michael/ROX-28151-cached-user-registry branch from 15ab479 to 1e3cc73 Compare September 4, 2025 15:25
parametalol added a commit that referenced this pull request Sep 5, 2025
fix rebase

mention #16176

nil check
@parametalol parametalol force-pushed the michael/ROX-28151-cached-user-registry branch from d1e3217 to 19b236f Compare September 5, 2025 12:27
@stehessel
Copy link
Copy Markdown
Collaborator

This PR needs to be rebased

@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from eade0bb to 371ec5e Compare September 8, 2025 08:53
@parametalol parametalol force-pushed the michael/ROX-28151-cached-user-registry branch from 19b236f to bd20b8f Compare September 8, 2025 19:20
@parametalol parametalol requested a review from a team as a code owner September 8, 2025 19:20
Base automatically changed from michael/ROX-28151-cached-user-registry to master September 9, 2025 18:27
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from 371ec5e to a88508c Compare September 9, 2025 19:37
Copy link
Copy Markdown
Contributor

@janisz janisz left a comment

Choose a reason for hiding this comment

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

How about extracting maximum number of registries kept in memory, to a separated PR to make it easier to review

@parametalol parametalol marked this pull request as draft September 11, 2025 13:36
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from a88508c to d9d376a Compare September 11, 2025 14:18
@parametalol parametalol changed the base branch from master to michael/refactor-custom-registry September 11, 2025 14:20
@parametalol parametalol marked this pull request as ready for review September 11, 2025 14:22
Base automatically changed from michael/refactor-custom-registry to master September 12, 2025 14:08
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from f4ae8f9 to dc7da70 Compare September 15, 2025 15:27
@parametalol parametalol requested a review from janisz September 19, 2025 14:00
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from dc7da70 to 3511616 Compare September 22, 2025 16:00
style: minor logging formatting

fix rebase

rebase fixes

fix rebase

remove max registries guard
@parametalol parametalol force-pushed the michael/ROX-28151-registry-cleanup branch from 3511616 to 57c7d2d Compare September 24, 2025 20:43
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Sep 24, 2025

@parametalol: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp-4-12-operator-e2e-tests 371ec5e link false /test ocp-4-12-operator-e2e-tests
ci/prow/ocp-4-19-qa-e2e-tests 371ec5e link false /test ocp-4-19-qa-e2e-tests
ci/prow/ocp-4-19-scanner-v4-install-tests 371ec5e link false /test ocp-4-19-scanner-v4-install-tests
ci/prow/ocp-4-19-ui-e2e-tests 371ec5e link false /test ocp-4-19-ui-e2e-tests
ci/prow/ocp-4-19-operator-e2e-tests 371ec5e link false /test ocp-4-19-operator-e2e-tests
ci/prow/gke-operator-e2e-tests 371ec5e link false /test gke-operator-e2e-tests
ci/prow/ocp-4-12-qa-e2e-tests 371ec5e link false /test ocp-4-12-qa-e2e-tests
ci/prow/ocp-4-12-scanner-v4-install-tests 371ec5e link false /test ocp-4-12-scanner-v4-install-tests
ci/prow/gke-scanner-v4-install-tests 371ec5e link false /test gke-scanner-v4-install-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@parametalol
Copy link
Copy Markdown
Contributor Author

/retest

@red-hat-konflux
Copy link
Copy Markdown
Contributor

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
central-db-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
main-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
operator-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
operator-bundle-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-collector CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner-db-slim CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner-db CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner-slim CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
roxctl-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
scanner-v4-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
scanner-v4-db-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request

Copy link
Copy Markdown
Collaborator

@stehessel stehessel left a comment

Choose a reason for hiding this comment

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

LGTM

@parametalol parametalol enabled auto-merge (squash) September 26, 2025 14:10
@parametalol parametalol merged commit 3e3dc71 into master Sep 26, 2025
88 of 90 checks passed
@parametalol parametalol deleted the michael/ROX-28151-registry-cleanup branch September 26, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants