Skip to content

CNF-22194 Core: ensure one copy of MachineConfigs in Core RDS#825

Open
kchennag wants to merge 2 commits into
openshift-kni:mainfrom
kchennag:core-install-extra-manifests
Open

CNF-22194 Core: ensure one copy of MachineConfigs in Core RDS#825
kchennag wants to merge 2 commits into
openshift-kni:mainfrom
kchennag:core-install-extra-manifests

Conversation

@kchennag

@kchennag kchennag commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Core of CNF-22194.

  • Move reference MachineConfigs to telco-core/install/extra-manifests/ and remove duplicates from configuration/reference-crs/
  • Add install/kustomization.yaml ConfigMap example for ClusterInstance extraManifestsRefs
  • Add compare.sh --check-extra-manifests to make check (install vs kube-compare alignment)
  • Keep MCP copies under reference-crs/custom-manifests/ for PolicyGenerator path constraints

@openshift-ci openshift-ci Bot requested review from lack and yanirq June 22, 2026 18:35
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kchennag
Once this PR has been reviewed and has the lgtm label, please assign irinamihai 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 Jun 22, 2026
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

Hi @kchennag. Thanks for your PR.

I'm waiting for a openshift-kni 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

MachineConfig CRs are relocated from reference-crs/optional to telco-core/install/extra-manifests as the canonical source. Three new MachineConfigPool manifests (worker-1/2/3, paused, maxUnavailable 100%) are added there. A new Kustomize kustomization.yaml packages these into an extra-manifests-configmap. A new --check-extra-manifests mode is added to compare.sh and wired into the check Makefile target to validate alignment between the two locations. kube-compare metadata.yaml, compare_ignore, and documentation are updated accordingly.

Changes

MachineConfig CR Relocation and Validation

Layer / File(s) Summary
Canonical install/extra-manifests: new MCPs and updated sctp MachineConfig
telco-core/install/extra-manifests/mcp-worker-*.yaml, telco-core/install/extra-manifests/sctp_module_mc.yaml, telco-core/install/kustomization.yaml, telco-core/install/example-standard-clusterinstance.yaml
Three new MachineConfigPool YAMLs (worker-1/2/3) are added with paused: true and maxUnavailable: 100%. sctp_module_mc.yaml is updated from Ignition v2.2.0 to v3.2.0 with rewritten storage.files entries. A new kustomization.yaml generates the extra-manifests-configmap ConfigMap; the ClusterInstance example is updated to reference the new ConfigMap name.
Remove MachineConfig CRs from reference-crs and update MCP specs
telco-core/configuration/reference-crs/custom-manifests/mcp-worker-*.yaml, telco-core/configuration/reference-crs-kube-compare/optional/...
MachineConfig manifests are deleted from reference-crs/optional/other (sctp, kernel modules, kdump, mount namespace) and reference-crs/optional/networking (tap CNI SELinux). The reference-crs/custom-manifests MCP specs are updated to paused: true and maxUnavailable: 100% to match the new install/extra-manifests copies. Minor whitespace fixes are applied to retained kube-compare template files.
kube-compare metadata, ignore list, and overlay updates
telco-core/configuration/reference-crs-kube-compare/metadata.yaml, telco-core/configuration/reference-crs-kube-compare/compare_ignore, telco-core/configuration/core-overlay.yaml
metadata.yaml removes optional MachineConfig CR paths from the other component group and moves mc_rootless_pods_selinux.yaml out of optional-networking anyOf. compare_ignore is expanded with those MachineConfig paths and annotates MCP worker entries as canonical copies in install/extra-manifests. core-overlay.yaml replaces the inline MachineConfig manifest list with comments pointing to install/extra-manifests.
compare.sh --check-extra-manifests mode and Makefile target
telco-core/configuration/compare.sh, telco-core/configuration/Makefile
Four new functions are added: compare_install_extra_manifests diffs MachineConfig YAMLs against reference-crs-kube-compare and validates sctp_module_mc.yaml content constraints; compare_install_custom_manifests_mcp diffs MCP worker YAMLs against reference-crs/custom-manifests; check_no_machineconfig_in_reference_crs asserts no MachineConfig CRs remain in reference-crs; run_extra_manifest_checks orchestrates all three. The Makefile check target gains compare_extra_manifests as a prerequisite.
Documentation updates
telco-core/install/README.md, telco-core/install/custom-manifests/README.md, telco-core/configuration/reference-crs/custom-manifests/README.md
install/README.md is expanded with a ClusterInstance and extra-manifests ConfigMap section, explicit manifest file lists, and an MCP duplication explanation. custom-manifests/README.md is rewritten to instruct ConfigMap-based inclusion and note MCP relocation. reference-crs/custom-manifests/README.md is replaced with MachineConfigPool examples guidance and the compare.sh --check-extra-manifests sync check reference.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the changes, objectives, and rationale for restructuring MachineConfigs and adding the compare.sh validation.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: ensuring only one copy of MachineConfigs exists in the Core RDS installation, which aligns with the changeset's focus on moving MachineConfigs to extra-manifests and adding validation checks.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

🧹 Nitpick comments (1)
telco-core/configuration/compare.sh (1)

117-158: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Maintenance contract is implicit in hardcoded pairs array.

The pairs array (lines 122-130) acts as an explicit contract: all MachineConfig files under install/extra-manifests that require validation must be listed here and have corresponding entries in reference-crs-kube-compare/. If a new file is added to install/extra-manifests/, it must be:

  1. Added to reference-crs-kube-compare/
  2. Added to the pairs array

Without this update, the new file won't be diff-validated (though check_no_machineconfig_in_reference_crs will still catch strays in reference-crs). This is reasonable for a controlled migration, but document this maintenance contract in a comment or the README to avoid future confusion.

For now, the validation logic itself is solid: lines 145–151 positively assert version 3.2.0 and data:,sctp, while lines 153–155 negatively assert no 2.2.0 or legacy filesystem fields.

Add comment documenting the pairs array contract
  local -a pairs=(
+   # Contract: All MachineConfig files in install/extra-manifests that require
+   # validation against kube-compare-reference must be listed here.
+   # New files added to install/extra-manifests/ must be added to this list,
+   # reference-crs-kube-compare/, and reference-crs/custom-manifests/ (MCPs only).
    "control-plane-load-kernel-modules.yaml:optional/other/control-plane-load-kernel-modules.yaml"
🤖 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 `@telco-core/configuration/compare.sh` around lines 117 - 158, The hardcoded
pairs array in the compare_install_extra_manifests() function implements an
implicit maintenance contract that is not documented. Add a comment above the
pairs array declaration explaining that this array defines the validation
contract: any new MachineConfig files added to install/extra-manifests/ must be
explicitly added to the pairs array with their corresponding path in
reference-crs-kube-compare/, otherwise they will not be diff-validated by this
comparison function.
🤖 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.

Nitpick comments:
In `@telco-core/configuration/compare.sh`:
- Around line 117-158: The hardcoded pairs array in the
compare_install_extra_manifests() function implements an implicit maintenance
contract that is not documented. Add a comment above the pairs array declaration
explaining that this array defines the validation contract: any new
MachineConfig files added to install/extra-manifests/ must be explicitly added
to the pairs array with their corresponding path in reference-crs-kube-compare/,
otherwise they will not be diff-validated by this comparison function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: efa75f82-4a15-45cd-8a8f-ef965a66aa22

📥 Commits

Reviewing files that changed from the base of the PR and between 8da6552 and 7c2e3d1.

📒 Files selected for processing (28)
  • telco-core/configuration/Makefile
  • telco-core/configuration/compare.sh
  • telco-core/configuration/core-overlay.yaml
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/reference-crs-kube-compare/metadata.yaml
  • telco-core/configuration/reference-crs-kube-compare/optional/networking/multus/tap_cni/mc_rootless_pods_selinux.yaml
  • telco-core/configuration/reference-crs-kube-compare/optional/other/control-plane-load-kernel-modules.yaml
  • telco-core/configuration/reference-crs-kube-compare/optional/other/worker-load-kernel-modules.yaml
  • telco-core/configuration/reference-crs/custom-manifests/README.md
  • telco-core/configuration/reference-crs/custom-manifests/mcp-worker-1.yaml
  • telco-core/configuration/reference-crs/custom-manifests/mcp-worker-2.yaml
  • telco-core/configuration/reference-crs/custom-manifests/mcp-worker-3.yaml
  • telco-core/configuration/reference-crs/optional/networking/multus/tap_cni/mc_rootless_pods_selinux.yaml
  • telco-core/configuration/reference-crs/optional/other/control-plane-load-kernel-modules.yaml
  • telco-core/configuration/reference-crs/optional/other/kdump-master.yaml
  • telco-core/configuration/reference-crs/optional/other/kdump-worker.yaml
  • telco-core/configuration/reference-crs/optional/other/mount_namespace_config_master.yaml
  • telco-core/configuration/reference-crs/optional/other/mount_namespace_config_worker.yaml
  • telco-core/configuration/reference-crs/optional/other/sctp_module_mc.yaml
  • telco-core/configuration/reference-crs/optional/other/worker-load-kernel-modules.yaml
  • telco-core/install/README.md
  • telco-core/install/custom-manifests/README.md
  • telco-core/install/example-standard-clusterinstance.yaml
  • telco-core/install/extra-manifests/mcp-worker-1.yaml
  • telco-core/install/extra-manifests/mcp-worker-2.yaml
  • telco-core/install/extra-manifests/mcp-worker-3.yaml
  • telco-core/install/extra-manifests/sctp_module_mc.yaml
  • telco-core/install/kustomization.yaml
💤 Files with no reviewable changes (9)
  • telco-core/configuration/reference-crs/optional/other/mount_namespace_config_master.yaml
  • telco-core/install/example-standard-clusterinstance.yaml
  • telco-core/configuration/reference-crs/optional/networking/multus/tap_cni/mc_rootless_pods_selinux.yaml
  • telco-core/configuration/reference-crs/optional/other/kdump-master.yaml
  • telco-core/configuration/reference-crs/optional/other/sctp_module_mc.yaml
  • telco-core/configuration/reference-crs/optional/other/kdump-worker.yaml
  • telco-core/configuration/reference-crs/optional/other/worker-load-kernel-modules.yaml
  • telco-core/configuration/reference-crs/optional/other/mount_namespace_config_worker.yaml
  • telco-core/configuration/reference-crs/optional/other/control-plane-load-kernel-modules.yaml

@MarSik

MarSik commented Jun 23, 2026

Copy link
Copy Markdown
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 Jun 23, 2026

@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 `@telco-core/configuration/compare.sh`:
- Around line 142-147: The grep commands on lines checking for 'version: 3.2.0'
and 'path: /etc/modules-load.d/kernel-load.conf' are using regex semantics where
the dot (.) character acts as a wildcard matching any character, which allows
incorrect versions or paths to pass validation. Fix this by either using grep -F
flag for fixed string matching instead of regex, or by escaping the dot
characters in the patterns with backslashes (e.g., 3\.2\.0 and
/etc/modules-load\.d/kernel-load\.conf) to ensure they match literal dots only.
🪄 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: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 2bd232a3-8d36-42a1-ace0-41a73699c58a

📥 Commits

Reviewing files that changed from the base of the PR and between 7c2e3d1 and 57c42ae.

📒 Files selected for processing (1)
  • telco-core/configuration/compare.sh

Comment on lines +142 to +147
if ! grep -q 'version: 3.2.0' "${install}/${inst}"; then
echo "ERROR: ${install}/${inst} must use ignition version 3.2.0" >&2
fail=1
fi
if ! grep -q 'path: /etc/modules-load.d/kernel-load.conf' "${install}/${inst}"; then
echo "ERROR: ${install}/${inst} must configure kernel-load.conf" >&2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Harden invariant checks to avoid regex false positives.

On Line 142 and Line 146, grep -q is using regex semantics, so . acts as a wildcard. That can let malformed manifest values pass this check gate.

Proposed fix
-      if ! grep -q 'version: 3.2.0' "${install}/${inst}"; then
+      if ! grep -Eq '^[[:space:]]*version:[[:space:]]*3\.2\.0([[:space:]]|$)' "${install}/${inst}"; then
         echo "ERROR: ${install}/${inst} must use ignition version 3.2.0" >&2
         fail=1
       fi
-      if ! grep -q 'path: /etc/modules-load.d/kernel-load.conf' "${install}/${inst}"; then
+      if ! grep -Eq '^[[:space:]]*path:[[:space:]]*/etc/modules-load\.d/kernel-load\.conf([[:space:]]|$)' "${install}/${inst}"; then
         echo "ERROR: ${install}/${inst} must configure kernel-load.conf" >&2
         fail=1
       fi
📝 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
if ! grep -q 'version: 3.2.0' "${install}/${inst}"; then
echo "ERROR: ${install}/${inst} must use ignition version 3.2.0" >&2
fail=1
fi
if ! grep -q 'path: /etc/modules-load.d/kernel-load.conf' "${install}/${inst}"; then
echo "ERROR: ${install}/${inst} must configure kernel-load.conf" >&2
if ! grep -Eq '^[[:space:]]*version:[[:space:]]*3\.2\.0([[:space:]]|$)' "${install}/${inst}"; then
echo "ERROR: ${install}/${inst} must use ignition version 3.2.0" >&2
fail=1
fi
if ! grep -Eq '^[[:space:]]*path:[[:space:]]*/etc/modules-load\.d/kernel-load\.conf([[:space:]]|$)' "${install}/${inst}"; then
echo "ERROR: ${install}/${inst} must configure kernel-load.conf" >&2
🤖 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 `@telco-core/configuration/compare.sh` around lines 142 - 147, The grep
commands on lines checking for 'version: 3.2.0' and 'path:
/etc/modules-load.d/kernel-load.conf' are using regex semantics where the dot
(.) character acts as a wildcard matching any character, which allows incorrect
versions or paths to pass validation. Fix this by either using grep -F flag for
fixed string matching instead of regex, or by escaping the dot characters in the
patterns with backslashes (e.g., 3\.2\.0 and
/etc/modules-load\.d/kernel-load\.conf) to ensure they match literal dots only.

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

Labels

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