Skip to content

Conversation

@grandeit
Copy link

@grandeit grandeit commented Dec 7, 2025

Add the new controller ConfigMapRevisionPruneController that prunes old revisioned ConfigMaps no longer in use by operand pods. This complements the existing SecretRevisionPruneController.

Key features:

  • Prunes ConfigMaps by prefix (e.g., revision-status-, installer-status-)
  • Preserves the 5 most recent revisions per prefix independently
  • Only prunes revisions below the minimum pod revision in use

Also adds WithRevisionPruneController to APIServerControllerSet, allowing API server operators to configure ConfigMap revision pruning alongside the existing secret pruning capability.

With this, it will be possible to add revision pruning to the openshift-apiserver and oauth-apiserver in the future. As described in RFE-3492 and RFE-4143.

Add the new controller ConfigMapRevisionPruneController that prunes old
revisioned ConfigMaps no longer in use by operand pods. This complements
the existing SecretRevisionPruneController.

Key features:
- Prunes ConfigMaps by prefix (e.g., revision-status-, installer-status-)
- Preserves the 5 most recent revisions per prefix independently
- Only prunes revisions below the minimum pod revision in use

Also adds WithRevisionPruneController to APIServerControllerSet, allowing
API server operators to configure ConfigMap revision pruning alongside
the existing secret pruning capability.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 7, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 7, 2025

@grandeit: This pull request references OCPSTRAT-485 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Add the new controller ConfigMapRevisionPruneController that prunes old revisioned ConfigMaps no longer in use by operand pods. This complements the existing SecretRevisionPruneController.

Key features:

  • Prunes ConfigMaps by prefix (e.g., revision-status-, installer-status-)
  • Preserves the 5 most recent revisions per prefix independently
  • Only prunes revisions below the minimum pod revision in use

Also adds WithRevisionPruneController to APIServerControllerSet, allowing API server operators to configure ConfigMap revision pruning alongside the existing secret pruning capability.

With this, it will be possible to add revision pruning to the openshift-apiserver and oauth-apiserver in the future. As described in RFE-3492 and RFE-4143.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: grandeit
Once this PR has been reviewed and has the lgtm label, please assign bertinatto for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 7, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 7, 2025

Hi @grandeit. Thanks for your PR.

I'm waiting for a github.com 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.

Copy link
Member

@bertinatto bertinatto left a comment

Choose a reason for hiding this comment

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

Hey @grandeit, thanks a lot for this PR!

The changes here seem OK, but I’d be in favor of consolidating this controller with the secretspruner controller. Both controllers share the same pruning criteria for secrets and ConfigMaps, so having a single pruner would eliminate duplicated logic. The only real difference between the controller introduced in this PR and the secretpruner controller is the resource type being pruned (Secret vs. ConfigMap); the rest of the logic is the same.

Additionally, both ConfigMap and Secret revisions are created by the same controller (revisioncontroller), so it would be more consistent to also have a single controller responsible for pruning them.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Since the other package is called secretspruner, probably a better name here would be configmappruner

@bertinatto
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 2, 2026
@bertinatto
Copy link
Member

@grandeit

Hey @grandeit, thanks a lot for this PR!

The changes here seem OK, but I’d be in favor of consolidating this controller with the secretspruner controller. Both controllers share the same pruning criteria for secrets and ConfigMaps, so having a single pruner would eliminate duplicated logic. The only real difference between the controller introduced in this PR and the secretpruner controller is the resource type being pruned (Secret vs. ConfigMap); the rest of the logic is the same.

Additionally, both ConfigMap and Secret revisions are created by the same controller (revisioncontroller), so it would be more consistent to also have a single controller responsible for pruning them.

Thoughts?

@grandeit also, if you can, please create a proof PR pointing the library-go dependency in one of our operators to use the version that you have here (see an example here).

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 2, 2026

@grandeit: all tests passed!

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.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants