Skip to content

OCPBUGS-105226: secrets and configmap revisions count gathering - #1316

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift:masterfrom
opokornyy:CCXDEV-15210-secrets-configmap-data
Jul 29, 2026
Merged

OCPBUGS-105226: secrets and configmap revisions count gathering#1316
openshift-merge-bot[bot] merged 3 commits into
openshift:masterfrom
opokornyy:CCXDEV-15210-secrets-configmap-data

Conversation

@opokornyy

@opokornyy opokornyy commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Add new gatherer to count ConfigMap and Secret revisions in openshift-kube-apiserver namespace. Groups objects by base name and reports version counts to identify objects with excessive historical revisions (>20 or >50) for cleanup recommendations.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • docs/insights-archive-sample/config/revisioned_objects.json

Documentation

  • docs/gathered-data.md

Unit Tests

  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://redhat.atlassian.net/browse/CCXDEV-15210

Summary by CodeRabbit

  • New Features

    • Added reporting for revisioned ConfigMap and Secret objects.
    • Revision counts are grouped by base object name and namespace to help identify excessive historical revisions.
    • Added sample archived output for revision-count metrics.
  • Documentation

    • Documented the new gathered-data entry, configuration identifier, archive location, and API references.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e28f5968-8f7e-422e-ae37-bb727f5fe6f3

📥 Commits

Reviewing files that changed from the base of the PR and between 91352a7 and f19f2f7.

📒 Files selected for processing (6)
  • docs/gathered-data.md
  • docs/insights-archive-sample/config/versioned_object_revision_counts.json
  • pkg/gatherers/clusterconfig/clusterconfig_gatherer.go
  • pkg/gatherers/clusterconfig/const.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/gatherers/clusterconfig/clusterconfig_gatherer.go
  • docs/gathered-data.md
  • pkg/gatherers/clusterconfig/const.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go

📝 Walkthrough

Walkthrough

Adds a clusterconfig gatherer for counting revisioned ConfigMaps and Secrets by base name, registers it, tests its filtering and aggregation behavior, and documents the resulting archive record with sample JSON.

Changes

Revisioned object counts

Layer / File(s) Summary
Count contract and gatherer wiring
pkg/gatherers/clusterconfig/const.go, pkg/gatherers/clusterconfig/gather_revisioned_objects.go, pkg/gatherers/clusterconfig/clusterconfig_gatherer.go
Configures monitored namespaces, defines the JSON count structure, and registers the revisioned_objects gathering function.
Revisioned object aggregation
pkg/gatherers/clusterconfig/gather_revisioned_objects.go
Lists ConfigMaps and Secrets, filters revision-status- owners, strips numeric revision suffixes, aggregates counts, and emits config/versioned_object_revision_counts.
Validation and archive contract
pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go, docs/insights-archive-sample/config/versioned_object_revision_counts.json, docs/gathered-data.md
Tests filtering, grouping, and owner detection, and documents the archive format and sample data.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GatherRevisionedObjectCounts
  participant KubernetesAPI
  participant ArchiveRecord
  GatherRevisionedObjectCounts->>KubernetesAPI: List ConfigMaps and Secrets
  KubernetesAPI-->>GatherRevisionedObjectCounts: Return revision-owned objects
  GatherRevisionedObjectCounts->>ArchiveRecord: Store JSON revision counts
Loading
🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the new gatherer for revision counts of secrets and configmaps in CCXDEV-15210.
Description check ✅ Passed The description follows the template and includes the key sections: summary, categories, sample archive, docs, tests, privacy, and references.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The new tests use static t.Run names and contain no Ginkgo titles or dynamic values like timestamps, UUIDs, or generated suffixes.
Test Structure And Quality ✅ Passed PASS: The new tests are self-contained table-driven unit tests, use isolated fake clients, have no waits, and match local assertion/fixture patterns.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the new test file is a plain Go unit test using testing/fake client, so MicroShift compatibility rules don’t apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new test is a plain Go unit test with a fake client; no Ginkgo/e2e code or multi-node/HA assumptions were added, so the SNO check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed No deployment, controller, or pod-scheduling logic was added; the PR only adds a clusterconfig gatherer plus docs/sample data.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes were added; the new klog calls are inside a helper, and the binary entrypoint already initializes logs separately.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Added tests are plain Go unit tests using a fake client; no Ginkgo/e2e constructs, IPv4 literals, or external connectivity were found.
No-Weak-Crypto ✅ Passed No weak-crypto APIs, hashes, ciphers, or secret/token comparisons appear in the changed files; the new code only checks owner-ref prefixes.
Container-Privileges ✅ Passed No changed container/K8s manifests; scan of added files found no privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed New logs only report list failures for hardcoded namespace names; no passwords, tokens, PII, or customer data are logged.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested a review from ncaak July 9, 2026 11:23
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2026
@opokornyy opokornyy changed the title Ccxdev 15210 secrets configmap data CCXDEV-15210: secrets and configmap revisions count gathering Jul 9, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 9, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@opokornyy: This pull request references CCXDEV-15210 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 task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Add new gatherer to count ConfigMap and Secret revisions in openshift-kube-apiserver namespace. Groups objects by base name and reports version counts to identify objects with excessive historical revisions (>20 or >50) for cleanup recommendations.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • docs/insights-archive-sample/config/revisioned_objects.json

Documentation

  • docs/gathered-data.md

Unit Tests

  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://redhat.atlassian.net/browse/CCXDEV-15210

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/gatherers/clusterconfig/gather_revisioned_objects.go`:
- Around line 62-110: gatherRevisionedObjectCounts currently logs
ConfigMaps/Secrets List failures at klog.V(2) and still returns a nil error
slice, which hides partial data collection failures. Update the function to
collect list errors from coreClient.ConfigMaps(namespace).List and
coreClient.Secrets(namespace).List, preserve any successful counts, and return
those errors in the second result so callers can detect incomplete output. Keep
the existing record assembly in gatherRevisionedObjectCounts and adjust the
return path to include the accumulated errors alongside the
config/revisioned_objects record.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 047a4af8-2f28-4e3c-a5e4-f9a73b01fe19

📥 Commits

Reviewing files that changed from the base of the PR and between 22b7d1f and 91352a7.

📒 Files selected for processing (6)
  • docs/gathered-data.md
  • docs/insights-archive-sample/config/revisioned_objects.json
  • pkg/gatherers/clusterconfig/clusterconfig_gatherer.go
  • pkg/gatherers/clusterconfig/const.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go

Comment on lines +62 to +110
func gatherRevisionedObjectCounts(ctx context.Context, coreClient corev1client.CoreV1Interface) ([]record.Record, []error) {
namespaceCounts := make(map[string]*NamespaceRevisionCounts)

for _, namespace := range revisionedObjectNamespaces {
nsCounts := &NamespaceRevisionCounts{
ConfigMaps: make(map[string]int),
Secrets: make(map[string]int),
}

// Gather ConfigMap counts
configMaps, err := coreClient.ConfigMaps(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("Unable to read ConfigMaps in namespace %s: %v", namespace, err)
} else {
for i := range configMaps.Items {
cm := &configMaps.Items[i]
if hasRevisionStatusOwner(cm.OwnerReferences) {
baseName := extractBaseName(cm.Name)
nsCounts.ConfigMaps[baseName]++
}
}
}

// Gather Secret counts
secrets, err := coreClient.Secrets(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("Unable to read Secrets in namespace %s: %v", namespace, err)
} else {
for i := range secrets.Items {
secret := &secrets.Items[i]
if hasRevisionStatusOwner(secret.OwnerReferences) {
baseName := extractBaseName(secret.Name)
nsCounts.Secrets[baseName]++
}
}
}

// Only add namespace to output if it has any revisioned objects
if len(nsCounts.ConfigMaps) > 0 || len(nsCounts.Secrets) > 0 {
namespaceCounts[namespace] = nsCounts
}
}

// Return single record with all counts
return []record.Record{{
Name: "config/revisioned_objects",
Item: record.JSONMarshaller{Object: namespaceCounts},
}}, nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

List errors are silently swallowed instead of being returned.

When ConfigMaps(namespace).List(...) or Secrets(namespace).List(...) fails (RBAC issue, API server hiccup, namespace missing, etc.), the error is only logged at klog.V(2) (verbose, off by default) and the function proceeds as if the namespace had zero revisioned objects. The function's second return value []error is always nil (Line 109), so callers/archive tooling never learn that data is incomplete or missing for that namespace — this silently produces misleading "0 revisions" output instead of surfacing a gathering failure.

Consider collecting these errors and returning them alongside the record, consistent with how other gatherers propagate partial failures.

🐛 Proposed fix to propagate list errors
 func gatherRevisionedObjectCounts(ctx context.Context, coreClient corev1client.CoreV1Interface) ([]record.Record, []error) {
 	namespaceCounts := make(map[string]*NamespaceRevisionCounts)
+	var errs []error
 
 	for _, namespace := range revisionedObjectNamespaces {
 		nsCounts := &NamespaceRevisionCounts{
 			ConfigMaps: make(map[string]int),
 			Secrets:    make(map[string]int),
 		}
 
 		// Gather ConfigMap counts
 		configMaps, err := coreClient.ConfigMaps(namespace).List(ctx, metav1.ListOptions{})
 		if err != nil {
 			klog.V(2).Infof("Unable to read ConfigMaps in namespace %s: %v", namespace, err)
+			errs = append(errs, err)
 		} else {
 			for i := range configMaps.Items {
 				cm := &configMaps.Items[i]
 				if hasRevisionStatusOwner(cm.OwnerReferences) {
 					baseName := extractBaseName(cm.Name)
 					nsCounts.ConfigMaps[baseName]++
 				}
 			}
 		}
 
 		// Gather Secret counts
 		secrets, err := coreClient.Secrets(namespace).List(ctx, metav1.ListOptions{})
 		if err != nil {
 			klog.V(2).Infof("Unable to read Secrets in namespace %s: %v", namespace, err)
+			errs = append(errs, err)
 		} else {
 			for i := range secrets.Items {
 				secret := &secrets.Items[i]
 				if hasRevisionStatusOwner(secret.OwnerReferences) {
 					baseName := extractBaseName(secret.Name)
 					nsCounts.Secrets[baseName]++
 				}
 			}
 		}
 
 		// Only add namespace to output if it has any revisioned objects
 		if len(nsCounts.ConfigMaps) > 0 || len(nsCounts.Secrets) > 0 {
 			namespaceCounts[namespace] = nsCounts
 		}
 	}
 
 	// Return single record with all counts
 	return []record.Record{{
 		Name: "config/revisioned_objects",
 		Item: record.JSONMarshaller{Object: namespaceCounts},
-	}}, nil
+	}}, errs
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func gatherRevisionedObjectCounts(ctx context.Context, coreClient corev1client.CoreV1Interface) ([]record.Record, []error) {
namespaceCounts := make(map[string]*NamespaceRevisionCounts)
for _, namespace := range revisionedObjectNamespaces {
nsCounts := &NamespaceRevisionCounts{
ConfigMaps: make(map[string]int),
Secrets: make(map[string]int),
}
// Gather ConfigMap counts
configMaps, err := coreClient.ConfigMaps(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("Unable to read ConfigMaps in namespace %s: %v", namespace, err)
} else {
for i := range configMaps.Items {
cm := &configMaps.Items[i]
if hasRevisionStatusOwner(cm.OwnerReferences) {
baseName := extractBaseName(cm.Name)
nsCounts.ConfigMaps[baseName]++
}
}
}
// Gather Secret counts
secrets, err := coreClient.Secrets(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("Unable to read Secrets in namespace %s: %v", namespace, err)
} else {
for i := range secrets.Items {
secret := &secrets.Items[i]
if hasRevisionStatusOwner(secret.OwnerReferences) {
baseName := extractBaseName(secret.Name)
nsCounts.Secrets[baseName]++
}
}
}
// Only add namespace to output if it has any revisioned objects
if len(nsCounts.ConfigMaps) > 0 || len(nsCounts.Secrets) > 0 {
namespaceCounts[namespace] = nsCounts
}
}
// Return single record with all counts
return []record.Record{{
Name: "config/revisioned_objects",
Item: record.JSONMarshaller{Object: namespaceCounts},
}}, nil
}
func gatherRevisionedObjectCounts(ctx context.Context, coreClient corev1client.CoreV1Interface) ([]record.Record, []error) {
namespaceCounts := make(map[string]*NamespaceRevisionCounts)
var errs []error
for _, namespace := range revisionedObjectNamespaces {
nsCounts := &NamespaceRevisionCounts{
ConfigMaps: make(map[string]int),
Secrets: make(map[string]int),
}
// Gather ConfigMap counts
configMaps, err := coreClient.ConfigMaps(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("Unable to read ConfigMaps in namespace %s: %v", namespace, err)
errs = append(errs, err)
} else {
for i := range configMaps.Items {
cm := &configMaps.Items[i]
if hasRevisionStatusOwner(cm.OwnerReferences) {
baseName := extractBaseName(cm.Name)
nsCounts.ConfigMaps[baseName]++
}
}
}
// Gather Secret counts
secrets, err := coreClient.Secrets(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("Unable to read Secrets in namespace %s: %v", namespace, err)
errs = append(errs, err)
} else {
for i := range secrets.Items {
secret := &secrets.Items[i]
if hasRevisionStatusOwner(secret.OwnerReferences) {
baseName := extractBaseName(secret.Name)
nsCounts.Secrets[baseName]++
}
}
}
// Only add namespace to output if it has any revisioned objects
if len(nsCounts.ConfigMaps) > 0 || len(nsCounts.Secrets) > 0 {
namespaceCounts[namespace] = nsCounts
}
}
// Return single record with all counts
return []record.Record{{
Name: "config/revisioned_objects",
Item: record.JSONMarshaller{Object: namespaceCounts},
}}, errs
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/gatherers/clusterconfig/gather_revisioned_objects.go` around lines 62 -
110, gatherRevisionedObjectCounts currently logs ConfigMaps/Secrets List
failures at klog.V(2) and still returns a nil error slice, which hides partial
data collection failures. Update the function to collect list errors from
coreClient.ConfigMaps(namespace).List and coreClient.Secrets(namespace).List,
preserve any successful counts, and return those errors in the second result so
callers can detect incomplete output. Keep the existing record assembly in
gatherRevisionedObjectCounts and adjust the return path to include the
accumulated errors alongside the config/revisioned_objects record.

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

Add new gatherer to count ConfigMap and Secret
revisions in openshift-kube-apiserver namespace.
Groups objects by base name and reports version
counts to identify objects with excessive historical
revisions (>20 or >50) for cleanup recommendations.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@opokornyy
opokornyy force-pushed the CCXDEV-15210-secrets-configmap-data branch from 91352a7 to 948ecd0 Compare July 14, 2026 12:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
pkg/gatherers/clusterconfig/gather_revisioned_objects.go (1)

62-110: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

List errors are silently swallowed instead of being returned.

coreClient.ConfigMaps(namespace).List and coreClient.Secrets(namespace).List failures are only logged at klog.V(2) (Lines 74, 88) and the function always returns nil for errors (Line 109), so callers never learn that data is incomplete for a namespace — this was already flagged in a previous review and remains unresolved.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/gatherers/clusterconfig/gather_revisioned_objects.go` around lines 62 -
110, Update gatherRevisionedObjectCounts to collect and return errors from the
ConfigMaps and Secrets List calls instead of only logging them. Preserve
processing for other namespaces and the existing record output, but return the
accumulated errors in the function’s []error result so callers can detect
incomplete data.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/gatherers/clusterconfig/gather_revisioned_objects.go`:
- Around line 39-46: Update the emitted record name in the gatherer’s
record-construction logic to match the documented and sampled archive location
`config/revisioned_objects.json`; change the value currently identifying
`config/versioned_object_revision_counts` while preserving the existing data
collection behavior and `clusterconfig/revisioned_objects` configuration
identity.

---

Duplicate comments:
In `@pkg/gatherers/clusterconfig/gather_revisioned_objects.go`:
- Around line 62-110: Update gatherRevisionedObjectCounts to collect and return
errors from the ConfigMaps and Secrets List calls instead of only logging them.
Preserve processing for other namespaces and the existing record output, but
return the accumulated errors in the function’s []error result so callers can
detect incomplete data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 87723d86-8f0a-498b-a4f5-937fb8762cbc

📥 Commits

Reviewing files that changed from the base of the PR and between 91352a7 and 948ecd0.

📒 Files selected for processing (6)
  • docs/gathered-data.md
  • docs/insights-archive-sample/config/revisioned_objects.json
  • pkg/gatherers/clusterconfig/clusterconfig_gatherer.go
  • pkg/gatherers/clusterconfig/const.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects.go
  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • docs/insights-archive-sample/config/revisioned_objects.json
  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go
  • pkg/gatherers/clusterconfig/const.go
  • docs/gathered-data.md

Comment on lines +39 to +46
// ### Sample data
// - docs/insights-archive-sample/config/revisioned_objects.json
//
// ### Location in archive
// - `config/revisioned_objects.json`
//
// ### Config ID
// `clusterconfig/revisioned_objects`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Record name mismatched with documented archive location and sample data.

The doc comment states the archive location is config/revisioned_objects.json (Lines 40-43), matching the PR's sample archive file docs/insights-archive-sample/config/revisioned_objects.json, but the actual emitted record uses Name: "config/versioned_object_revision_counts" (Line 107). This mismatch means the gathered data will land at a different archive path than what's documented and sampled, breaking the cross-file contract between this gatherer, the docs, and the sample archive.

🐛 Proposed fix
 	return []record.Record{{
-		Name: "config/versioned_object_revision_counts",
+		Name: "config/revisioned_objects",
 		Item: record.JSONMarshaller{Object: namespaceCounts},
 	}}, nil

Also applies to: 106-109

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/gatherers/clusterconfig/gather_revisioned_objects.go` around lines 39 -
46, Update the emitted record name in the gatherer’s record-construction logic
to match the documented and sampled archive location
`config/revisioned_objects.json`; change the value currently identifying
`config/versioned_object_revision_counts` while preserving the existing data
collection behavior and `clusterconfig/revisioned_objects` configuration
identity.

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

4 similar comments
@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread pkg/gatherers/clusterconfig/gather_revisioned_objects.go
Rename the sample JSON file and update code
comments to reflect the correct archive path
after the gatherer rename.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/override ci/prow/insights-operator-e2e-tests

Failures related to missing opentelemetry operator

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

@opokornyy: Overrode contexts on behalf of opokornyy: ci/prow/insights-operator-e2e-tests

Details

In response to this:

/override ci/prow/insights-operator-e2e-tests

Failures related to missing opentelemetry operator

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.

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@ncaak ncaak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncaak, opokornyy

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

The pull request process is described 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

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/verified later @opokornyy

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Jul 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@opokornyy: This PR has been marked to be verified later by @opokornyy.

Details

In response to this:

/verified later @opokornyy

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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD c475f8a and 2 for PR HEAD f19f2f7 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 139e3d3 and 1 for PR HEAD f19f2f7 in total

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

@opokornyy: 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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 0227848 into openshift:master Jul 29, 2026
13 checks passed
@opokornyy

Copy link
Copy Markdown
Contributor Author

/retitle OCPBUGS-105226: secrets and configmap revisions count gathering

@openshift-ci openshift-ci Bot changed the title CCXDEV-15210: secrets and configmap revisions count gathering OCPBUGS-105226: secrets and configmap revisions count gathering Aug 6, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@opokornyy: Jira Issue OCPBUGS-105226: All pull requests linked via external trackers have merged:

This pull request has the verified-later tag and will need to be manually moved to VERIFIED after testing. Jira Issue OCPBUGS-105226 has been moved to the MODIFIED state.

Details

In response to this:

Add new gatherer to count ConfigMap and Secret revisions in openshift-kube-apiserver namespace. Groups objects by base name and reports version counts to identify objects with excessive historical revisions (>20 or >50) for cleanup recommendations.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • docs/insights-archive-sample/config/revisioned_objects.json

Documentation

  • docs/gathered-data.md

Unit Tests

  • pkg/gatherers/clusterconfig/gather_revisioned_objects_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://redhat.atlassian.net/browse/CCXDEV-15210

Summary by CodeRabbit

  • New Features

  • Added reporting for revisioned ConfigMap and Secret objects.

  • Revision counts are grouped by base object name and namespace to help identify excessive historical revisions.

  • Added sample archived output for revision-count metrics.

  • Documentation

  • Documented the new gathered-data entry, configuration identifier, archive location, and API references.

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.

@opokornyy

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.22

@openshift-cherrypick-robot

Copy link
Copy Markdown

@opokornyy: new pull request created: #1339

Details

In response to this:

/cherry-pick release-4.22

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants