Skip to content

MON-4607: add zoneinfo to NodeExporterCollectorConfig CRD types#2948

Open
midu16 wants to merge 1 commit into
openshift:masterfrom
midu16:node-exporter-collector-zoneinfo
Open

MON-4607: add zoneinfo to NodeExporterCollectorConfig CRD types#2948
midu16 wants to merge 1 commit into
openshift:masterfrom
midu16:node-exporter-collector-zoneinfo

Conversation

@midu16

@midu16 midu16 commented Jul 23, 2026

Copy link
Copy Markdown

Add NodeExporterCollectorZoneinfoConfig with a collectionPolicy-only struct (matching the softirqs pattern) and the Zoneinfo field to NodeExporterCollectorConfig. Regenerated CRDs, deepcopy, and OpenAPI.

Add NodeExporterCollectorZoneinfoConfig with a collectionPolicy-only
struct (matching the softirqs pattern) and the Zoneinfo field to
NodeExporterCollectorConfig. Regenerated CRDs, deepcopy, and OpenAPI.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@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 23, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 23, 2026

Copy link
Copy Markdown

@midu16: This pull request references MON-4607 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 sub-task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Add NodeExporterCollectorZoneinfoConfig with a collectionPolicy-only struct (matching the softirqs pattern) and the Zoneinfo field to NodeExporterCollectorConfig. Regenerated CRDs, deepcopy, and OpenAPI.

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 commented Jul 23, 2026

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: da4d3d51-66e1-402e-8e01-2568bc4d4254

📥 Commits

Reviewing files that changed from the base of the PR and between 581cfdf and 302b80b.

⛔ Files ignored due to path filters (7)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1alpha1/zz_generated.model_name.go is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • openapi/openapi.json is excluded by !openapi/**
📒 Files selected for processing (2)
  • config/v1alpha1/types_cluster_monitoring.go
  • payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml
✨ 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 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Hello @midu16! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@qodo-for-rh-openshift

Copy link
Copy Markdown

PR Summary by Qodo

Add zoneinfo collector config to ClusterMonitoringConfig node-exporter types

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add a Zoneinfo collector configuration block to NodeExporterCollectorConfig.
• Introduce NodeExporterCollectorZoneinfoConfig with collectionPolicy semantics matching other
 collectors.
• Regenerate CRD manifests, deepcopy methods, and OpenAPI/Swagger artifacts to expose the new field.
Diagram

graph TD
  A["ClusterMonitoringConfig CR"] --> B["NodeExporterCollectorConfig"] --> C["Zoneinfo config"]
  C --> D["CRD manifests"]
  C --> E["Go codegen"] --> F["OpenAPI JSON"]
Loading
High-Level Assessment

The approach (dedicated Zoneinfo config struct with collectionPolicy, mirroring existing collector patterns like softirqs) is consistent with the API style, keeps the CRD schema explicit, and fits existing codegen pipelines. A more generic shared collector-config type could reduce duplication, but would be a broader API refactor with higher compatibility risk than warranted for a single new collector.

Files changed (9) +176 / -1

Enhancement (1) +22 / -0
types_cluster_monitoring.goAdd Zoneinfo collector field and config type to node-exporter API +22/-0

Add Zoneinfo collector field and config type to node-exporter API

• Adds a new Zoneinfo field to NodeExporterCollectorConfig with descriptive API docs. Introduces NodeExporterCollectorZoneinfoConfig containing only collectionPolicy, matching the established collector config pattern.

config/v1alpha1/types_cluster_monitoring.go

Documentation (1) +10 / -0
zz_generated.swagger_doc_generated.goAdd Swagger docs for zoneinfo field and Zoneinfo config type +10/-0

Add Swagger docs for zoneinfo field and Zoneinfo config type

• Extends the NodeExporterCollectorConfig SwaggerDoc map with the zoneinfo field description. Adds a SwaggerDoc map/function for NodeExporterCollectorZoneinfoConfig and its collectionPolicy field.

config/v1alpha1/zz_generated.swagger_doc_generated.go

Other (7) +144 / -1
0000_10_config-operator_01_clustermonitorings.crd.yamlExpose zoneinfo under node-exporter collectors in generated CRD schema +23/-0

Expose zoneinfo under node-exporter collectors in generated CRD schema

• Regenerates the ClusterMonitoringConfig CRD manifest to include the zoneinfo property. Adds validation/enum for collectionPolicy and marks it required within the zoneinfo object.

config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml

zz_generated.deepcopy.goRegenerate deepcopy for Zoneinfo config and collector config struct +17/-0

Regenerate deepcopy for Zoneinfo config and collector config struct

• Updates NodeExporterCollectorConfig DeepCopyInto to copy the new Zoneinfo field. Adds autogenerated DeepCopy/DeepCopyInto methods for NodeExporterCollectorZoneinfoConfig.

config/v1alpha1/zz_generated.deepcopy.go

ClusterMonitoringConfig.yamlRegenerate feature-gated CRD schema with zoneinfo collector config +23/-0

Regenerate feature-gated CRD schema with zoneinfo collector config

• Updates the feature-gated CRD manifest to include the zoneinfo property and its collectionPolicy enum/required constraint, mirroring the main CRD schema.

config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml

zz_generated.model_name.goRegister OpenAPI model name for Zoneinfo config type +5/-0

Register OpenAPI model name for Zoneinfo config type

• Adds OpenAPIModelName() for NodeExporterCollectorZoneinfoConfig so it can be referenced in generated OpenAPI definitions.

config/v1alpha1/zz_generated.model_name.go

zz_generated.openapi.goRegenerate OpenAPI Go definitions to include zoneinfo schema +31/-1

Regenerate OpenAPI Go definitions to include zoneinfo schema

• Registers NodeExporterCollectorZoneinfoConfig in GetOpenAPIDefinitions and adds it as a dependency of NodeExporterCollectorConfig. Introduces the schema generator function for the new type and adds the zoneinfo property to the collector config schema.

openapi/generated_openapi/zz_generated.openapi.go

openapi.jsonRegenerate OpenAPI JSON with zoneinfo property and definition +22/-0

Regenerate OpenAPI JSON with zoneinfo property and definition

• Adds the zoneinfo field to the NodeExporterCollectorConfig definition with a reference to the new type. Introduces the NodeExporterCollectorZoneinfoConfig schema definition requiring collectionPolicy with the Collect/DoNotCollect enum.

openapi/openapi.json

0000_10_config-operator_01_clustermonitorings.crd.yamlUpdate payload CRD manifest to include zoneinfo collector config +23/-0

Update payload CRD manifest to include zoneinfo collector config

• Regenerates the shipped CRD payload manifest to include the zoneinfo property and its validation, keeping payload CRDs aligned with the API type changes.

payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml

@openshift-ci openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 23, 2026
@qodo-for-rh-openshift

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 29 rules
✅ Skills: api-review

Grey Divider


Informational

1. No zoneinfo CRD tests 🐞 Bug ⚙ Maintainability
Description
The CRD validation tests for node-exporter collectors don’t exercise the new
spec.nodeExporterConfig.collectors.zoneinfo field, so regressions in its required/enum validation
(e.g., missing collectionPolicy) could ship without test coverage. This is a
maintainability/regression-risk gap rather than a current schema defect.
Code

config/v1alpha1/types_cluster_monitoring.go[R469-476]

+	// zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts,
+	// watermarks, and protection thresholds from /proc/zoneinfo.
+	// zoneinfo is optional.
+	// When omitted, this means no opinion and the platform is left to choose a reasonable default,
+	// which is subject to change over time. The current default is disabled.
+	// Enable when you need visibility into kernel memory zone allocation and pressure.
+	// +optional
+	Zoneinfo NodeExporterCollectorZoneinfoConfig `json:"zoneinfo,omitempty,omitzero"`
Relevance

⭐ Low

Similar requests to add extra v1alpha1 CRD integration test cases were rejected previously in this
repo.

PR-#2855

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The API adds the new collectors.zoneinfo field, but the existing collector test case enumerates
several collectors without including zoneinfo, so it won’t catch schema regressions specific to
that field.

config/v1alpha1/types_cluster_monitoring.go[461-476]
config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml[1976-2024]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The collector validation tests cover several existing collectors but do not include the newly added `collectors.zoneinfo` field. This reduces confidence that the new schema (required `collectionPolicy`, enum values) will remain correct over time.

### Issue Context
`Zoneinfo` was added to `NodeExporterCollectorConfig` and a new `NodeExporterCollectorZoneinfoConfig` type was introduced.

### Fix Focus Areas
- config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml[1976-2024]
- config/v1alpha1/types_cluster_monitoring.go[461-476]

### What to change
- Extend the existing “Should be able to create NodeExporterConfig with collectors” test to include:
 - `zoneinfo:
     collectionPolicy: Collect`
- Add a negative test to reject `zoneinfo: {}` (missing required `collectionPolicy`).
- (Optional) Add a negative test for an invalid enum value under `zoneinfo.collectionPolicy`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@openshift-ci
openshift-ci Bot requested review from JoelSpeed and everettraven July 23, 2026 16:30
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelspeed 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

midu16 added a commit to midu16/cluster-monitoring-operator that referenced this pull request Jul 23, 2026
Add optional nodeExporter.collectors.zoneinfo toggle (disabled by default).
Wire --collector.zoneinfo/--no-collector.zoneinfo in updateNodeExporterArgs,
extend unit/e2e tests, and add zoneinfo to telemeter collector success matcher.

CRD merge (config_merge.go) will be added once openshift/api#2948 merges
and the vendor is updated with the NodeExporterCollectorZoneinfoConfig type.
midu16 added a commit to midu16/cluster-monitoring-operator that referenced this pull request Jul 23, 2026
Add optional nodeExporter.collectors.zoneinfo toggle (disabled by default).
Wire --collector.zoneinfo/--no-collector.zoneinfo in updateNodeExporterArgs,
extend unit/e2e tests, and add zoneinfo to telemeter collector success matcher.

Update jsonnet/versions.yaml to match upstream component versions.

CRD merge (config_merge.go) will be added once openshift/api#2948 merges
and the vendor is updated with the NodeExporterCollectorZoneinfoConfig type.
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@midu16: 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/verify-client-go 302b80b link true /test verify-client-go
ci/prow/verify-hypershift-integration 302b80b link true /test verify-hypershift-integration

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants