Skip to content

NO-JIRA: docs(kubevirt): add how-to for configuring VMs with JSON patches - #8473

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
qinqon:docs-kubevirt-jsonpatch-node-affinity
May 11, 2026
Merged

NO-JIRA: docs(kubevirt): add how-to for configuring VMs with JSON patches#8473
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
qinqon:docs-kubevirt-jsonpatch-node-affinity

Conversation

@qinqon

@qinqon qinqon commented May 11, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds a new how-to documentation page for the hypershift.openshift.io/kubevirt-vm-jsonpatch annotation, which was previously undocumented. The doc focuses on configuring node affinity for KubeVirt VMs but also covers the general JSON patch mechanism.

Content includes:

  • Overview of the JSON patch annotation (RFC 6902 format, HostedCluster vs NodePool scope, precedence rules)
  • Required node affinity configuration with full NodePool YAML and oc annotate examples
  • Preferred node affinity configuration
  • Combining required and preferred rules
  • HostedCluster-level patches for applying rules to all NodePools
  • Additional examples (CPU cores replacement, secondary Multus network)
  • Important considerations (validation, preserving default affinity, path syntax)

Which issue(s) this PR fixes:

N/A — this is net-new documentation for an existing but undocumented feature.

Special notes for your reviewer:

  • The JSON patch feature has been available since the JSONPatchAnnotation constant was introduced but had no user-facing documentation.
  • The examples are derived from the unit tests in hypershift-operator/controllers/nodepool/kubevirt/kubevirt_test.go and the implementation in kubevirt.go.
  • The doc explicitly warns users not to replace the entire affinity object to avoid removing default pod anti-affinity / topology spread constraints.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Documentation
    • Added guide for customizing KubeVirt VMs via a JSON Patch annotation (RFC 6902).
    • Documents valid JSON Pointer targets and add behavior (auto-creation of intermediate paths).
    • Includes examples: node affinity (required/preferred/combined), CPU core changes, and adding a secondary network.
    • Clarifies NodePool vs HostedCluster patch scope and precedence; covers validation/admission and operational considerations.

@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

Copy link
Copy Markdown

@qinqon: This pull request explicitly references no jira issue.

Details

In response to this:

What this PR does / why we need it:

Adds a new how-to documentation page for the hypershift.openshift.io/kubevirt-vm-jsonpatch annotation, which was previously undocumented. The doc focuses on configuring node affinity for KubeVirt VMs but also covers the general JSON patch mechanism.

Content includes:

  • Overview of the JSON patch annotation (RFC 6902 format, HostedCluster vs NodePool scope, precedence rules)
  • Required node affinity configuration with full NodePool YAML and oc annotate examples
  • Preferred node affinity configuration
  • Combining required and preferred rules
  • HostedCluster-level patches for applying rules to all NodePools
  • Additional examples (CPU cores replacement, secondary Multus network)
  • Important considerations (validation, preserving default affinity, path syntax)

Which issue(s) this PR fixes:

N/A — this is net-new documentation for an existing but undocumented feature.

Special notes for your reviewer:

  • The JSON patch feature has been available since the JSONPatchAnnotation constant was introduced but had no user-facing documentation.
  • The examples are derived from the unit tests in hypershift-operator/controllers/nodepool/kubevirt/kubevirt_test.go and the implementation in kubevirt.go.
  • The doc explicitly warns users not to replace the entire affinity object to avoid removing default pod anti-affinity / topology spread constraints.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 11, 2026
@openshift-ci

openshift-ci Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

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

@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area labels May 11, 2026
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

A new documentation page explains how to customize KubeVirt VirtualMachineTemplateSpec using the hypershift.openshift.io/kubevirt-vm-jsonpatch annotation. It describes RFC 6902 JSON Patch fields and JSON Pointer targets, notes that add auto-creates intermediate path elements, and provides examples for node affinity (required, preferred, combined), replacing CPU cores, and adding a secondary Multus network. It documents applying the annotation on NodePool and HostedCluster (precedence rules), admission-time validation, operational considerations, and adds the page to the MkDocs Kubevirt navigation.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding documentation for KubeVirt VM configuration via JSON patches, which matches the addition of a new how-to guide file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 This documentation-only PR modifies no test files and adds no Ginkgo test definitions. The custom check for stable test names is not applicable.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test structure is not applicable. PR contains only documentation changes (new markdown file and YAML config update). No test code is present in this PR.
Microshift Test Compatibility ✅ Passed PR is documentation-only with no Ginkgo e2e tests added. MicroShift Test Compatibility check does not apply to documentation-only changes.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR adds only documentation (how-to guide and MkDocs config). No Ginkgo e2e tests are added. The SNO test compatibility check is not applicable to documentation-only changes.
Topology-Aware Scheduling Compatibility ✅ Passed This PR is documentation-only (new doc file and mkdocs.yml entry). The custom check applies to deployment manifests, operator code, and controllers—none modified here.
Ote Binary Stdout Contract ✅ Passed PR adds only documentation files (Markdown and YAML). No source code or test code changes. OTE Binary Stdout Contract check does not apply.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds only documentation files. No Ginkgo e2e tests are being added, so the IPv6/disconnected network compatibility check is not applicable.

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

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

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

@openshift-ci openshift-ci Bot added area/documentation Indicates the PR includes changes for documentation area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform and removed do-not-merge/needs-area labels May 11, 2026

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

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 `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md`:
- Around line 32-34: Clarify that HyperShift's JSON Patch `add` differs from RFC
6902 by auto-creating parent paths: update the paragraph describing the `add`
operation to state that HyperShift sets EnsurePathExistsOnAdd=true in the
evanphx/json-patch library, so intermediate path elements will be created
automatically (unlike RFC 6902 where parent paths must exist), and warn readers
that patches relying on this behavior are HyperShift-specific and may not be
portable to other implementations.
🪄 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: 8a6285e2-f5b8-4fd1-a9e4-c31bc5089d7a

📥 Commits

Reviewing files that changed from the base of the PR and between bded456 and 2b67c78.

📒 Files selected for processing (2)
  • docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md
  • docs/mkdocs.yml

Comment thread docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md Outdated
@qinqon
qinqon force-pushed the docs-kubevirt-jsonpatch-node-affinity branch 2 times, most recently from f0428d8 to 9c61db2 Compare May 11, 2026 08:30
@qinqon
qinqon marked this pull request as ready for review May 11, 2026 08:31
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 11, 2026
@openshift-ci
openshift-ci Bot requested review from awels and jparrill May 11, 2026 08:32

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

♻️ Duplicate comments (1)
docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md (1)

32-34: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify this add behavior as HyperShift-specific, not generic RFC 6902.

Current wording reads like standard JSON Patch behavior, but portability depends on HyperShift’s patch apply options. Please call out that intermediate-path auto-creation is implementation-specific.

💡 Suggested wording update
-    The `add` operation automatically creates intermediate path elements if they
-    do not exist. This means you can add deeply nested fields without worrying
-    about whether parent objects are already present.
+    In HyperShift, the `add` operation can automatically create intermediate path
+    elements when they do not exist. This is implementation-specific behavior and
+    differs from strict RFC 6902 expectations where parent paths must already
+    exist. Patches that rely on this convenience may not be portable to other
+    JSON Patch implementations.

To verify against implementation and tests:

#!/bin/bash
set -euo pipefail

# Verify patch-apply options in KubeVirt patching code.
fd -i "kubevirt.go" | xargs -r rg -n -C3 "EnsurePathExistsOnAdd|ApplyWithOptions|NewApplyOptions|json-patch|jsonpatch"

# Verify coverage/expectations in KubeVirt tests.
fd -i "kubevirt_test.go" | xargs -r rg -n -C3 "EnsurePathExistsOnAdd|jsonpatch|intermediate|requiredDuringSchedulingIgnoredDuringExecution|/spec/template/spec/affinity"
🤖 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 `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md` around lines
32 - 34, Update the sentence about the JSON Patch "add" operation to clearly
state this intermediate-path auto-creation is HyperShift/KubeVirt-specific
(driven by patch-apply options) and not guaranteed by RFC 6902; mention the
relevant implementation knobs such as EnsurePathExistsOnAdd,
ApplyWithOptions/NewApplyOptions and jsonpatch so readers know where to verify
behavior and link to tests that assert it (e.g., references in kubevirt.go and
kubevirt_test.go).
🤖 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.

Duplicate comments:
In `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md`:
- Around line 32-34: Update the sentence about the JSON Patch "add" operation to
clearly state this intermediate-path auto-creation is
HyperShift/KubeVirt-specific (driven by patch-apply options) and not guaranteed
by RFC 6902; mention the relevant implementation knobs such as
EnsurePathExistsOnAdd, ApplyWithOptions/NewApplyOptions and jsonpatch so readers
know where to verify behavior and link to tests that assert it (e.g., references
in kubevirt.go and kubevirt_test.go).

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: e1771fd5-4474-4eac-9ccf-eecd07afa0cd

📥 Commits

Reviewing files that changed from the base of the PR and between 2b67c78 and f0428d8.

📒 Files selected for processing (2)
  • docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md
  • docs/mkdocs.yml
✅ Files skipped from review due to trivial changes (1)
  • docs/mkdocs.yml

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

Actionable comments posted: 2

🤖 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 `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md`:
- Line 62: Replace the fenced code blocks (instances of the marker ```yaml
linenums="1" and similar fenced backtick blocks) with indented code block style
to satisfy markdownlint MD046; locate occurrences where the doc uses fenced
blocks (the example marker and the other flagged occurrences noted) and convert
them to the project’s expected indented format, ensuring language/linenumber
metadata is preserved or removed per project style so CI linting no longer flags
MD046.
- Around line 17-24: The table of patch operation fields is missing the required
"from" field used by the RFC 6902 "move" and "copy" operations; update the
fields table in configuring-vm-with-jsonpatch.md to add a row for `from` that
explains it is a JSON Pointer referencing the source location within the
VirtualMachineTemplateSpec and mark it as "Required" for `move`/`copy`
operations (not required otherwise), matching RFC 6902 semantics and clarifying
how to construct valid `move`/`copy` patches alongside the existing `op`,
`path`, and `value` descriptions.
🪄 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: 11035656-9a3b-4921-a39e-094b71d1484d

📥 Commits

Reviewing files that changed from the base of the PR and between f0428d8 and 9c61db2.

📒 Files selected for processing (2)
  • docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md
  • docs/mkdocs.yml
✅ Files skipped from review due to trivial changes (1)
  • docs/mkdocs.yml

Comment thread docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md
`node-type=kubevirt-worker`. This uses `requiredDuringSchedulingIgnoredDuringExecution`
to enforce strict placement.

```yaml linenums="1"

@coderabbitai coderabbitai Bot May 11, 2026

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Address markdownlint MD046 warnings for code block style.

These fenced blocks are currently flagged by markdownlint (Expected: indented; Actual: fenced). If docs lint is enforced in CI, this will keep warning/failing until aligned with project markdown style config.

Also applies to: 106-106, 118-118, 166-166, 214-214, 252-252, 267-267

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 62-62: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)

🤖 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 `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md` at line 62,
Replace the fenced code blocks (instances of the marker ```yaml linenums="1" and
similar fenced backtick blocks) with indented code block style to satisfy
markdownlint MD046; locate occurrences where the doc uses fenced blocks (the
example marker and the other flagged occurrences noted) and convert them to the
project’s expected indented format, ensuring language/linenumber metadata is
preserved or removed per project style so CI linting no longer flags MD046.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skipping this one. All existing KubeVirt docs in this project use fenced code blocks with linenums="1" (e.g., gpu-devices.md, performance-tuning.md, configuring-storage.md). This is the established project style for MkDocs Material. The MD046 warning is a false positive from markdownlint's default config not matching the project conventions -- markdownlint is not enforced in CI for this repo.

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.

@qinqon, understood — thanks for the context. Since the entire KubeVirt docs section consistently uses fenced code blocks with linenums="1" as the MkDocs Material project convention, and markdownlint is not enforced in CI, this warning can be safely ignored. I'll remember this for future reviews.


📝 Learnings were identified and not saved (knowledge base disabled). Enable

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

/approve

@openshift-ci

openshift-ci Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jparrill, qinqon

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2026
@jparrill

Copy link
Copy Markdown
Contributor

You will need to execute the make aggregate-docs and push again

@qinqon
qinqon force-pushed the docs-kubevirt-jsonpatch-node-affinity branch from 9c61db2 to 9f30291 Compare May 11, 2026 11:42
@qinqon
qinqon requested a review from jparrill May 11, 2026 11:42

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

♻️ Duplicate comments (1)
docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md (1)

19-23: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

move/copy patch schema is still incomplete in the field table.

Line 21 includes move and copy, but the table still omits from and overstates when value is required. This can lead to invalid patch examples for those operations.

Suggested doc fix
 | Field   | Description                                                         | Required               |
 |---------|---------------------------------------------------------------------|------------------------|
 | `op`    | The operation to perform: `add`, `replace`, `remove`, `move`, `copy`, `test` | Yes                    |
 | `path`  | A JSON Pointer path into the `VirtualMachineTemplateSpec`           | Yes                    |
-| `value` | The value to use for the operation                                  | Yes (except `remove`)  |
+| `from`  | Source JSON Pointer path (used by `move` and `copy`)                | Yes (`move`, `copy`)   |
+| `value` | The value to use for the operation                                  | Yes (`add`, `replace`, `test`) |
🤖 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 `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md` around lines
19 - 23, Update the table describing JSONPatch fields so it correctly documents
the `move` and `copy` operations: add a `from` row/column describing the JSON
Pointer source used by `move` and `copy`, and adjust the `value` requirement to
state that `value` is required for `add`, `replace`, and `test` but not for
`remove`, `move`, or `copy`; ensure the `op`, `path`, `value`, and newly
documented `from` entries in the table match the JSON Patch spec and the
behavior expected by VirtualMachineTemplateSpec.
🤖 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.

Duplicate comments:
In `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md`:
- Around line 19-23: Update the table describing JSONPatch fields so it
correctly documents the `move` and `copy` operations: add a `from` row/column
describing the JSON Pointer source used by `move` and `copy`, and adjust the
`value` requirement to state that `value` is required for `add`, `replace`, and
`test` but not for `remove`, `move`, or `copy`; ensure the `op`, `path`,
`value`, and newly documented `from` entries in the table match the JSON Patch
spec and the behavior expected by VirtualMachineTemplateSpec.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 59a46c7f-c97b-400c-b22b-ef909b635aae

📥 Commits

Reviewing files that changed from the base of the PR and between 9c61db2 and 9f30291.

⛔ Files ignored due to path filters (1)
  • docs/content/reference/aggregated-docs.md is excluded by !docs/content/reference/aggregated-docs.md
📒 Files selected for processing (2)
  • docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md
  • docs/mkdocs.yml
✅ Files skipped from review due to trivial changes (1)
  • docs/mkdocs.yml

@qinqon
qinqon force-pushed the docs-kubevirt-jsonpatch-node-affinity branch from 9f30291 to 23ecc13 Compare May 11, 2026 11:57
@qinqon

qinqon commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/verified by e2e(build docs)

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

♻️ Duplicate comments (1)
docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md (1)

63-63: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Resolve markdownlint MD046 code block style warnings.

markdownlint-cli2 reports fenced code blocks where indented style is expected at these lines. Please align these examples with the repo’s configured markdown style to avoid recurring lint warnings/failures.

Also applies to: 107-107, 119-119, 167-167, 215-215, 253-253, 268-268

🤖 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 `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md` at line 63,
The markdown uses fenced code blocks like ```yaml linenums="1" which triggers
markdownlint MD046; replace each fenced block with the repository's expected
indented code-block style by removing the backtick fences and attributes (e.g.,
```yaml linenums="1") and indenting every line of the example by four spaces
(ensure a blank line before and after the indented block); update all
occurrences of these fenced YAML examples in this document (the blocks starting
with the ```yaml linenums="1" markers and the other instances noted in the
review) so they use the indented style and no fenced-language or linenums
attributes.
🤖 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.

Duplicate comments:
In `@docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md`:
- Line 63: The markdown uses fenced code blocks like ```yaml linenums="1" which
triggers markdownlint MD046; replace each fenced block with the repository's
expected indented code-block style by removing the backtick fences and
attributes (e.g., ```yaml linenums="1") and indenting every line of the example
by four spaces (ensure a blank line before and after the indented block); update
all occurrences of these fenced YAML examples in this document (the blocks
starting with the ```yaml linenums="1" markers and the other instances noted in
the review) so they use the indented style and no fenced-language or linenums
attributes.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: f01421fe-c7b2-481d-ab79-653582157a5d

📥 Commits

Reviewing files that changed from the base of the PR and between 9f30291 and 23ecc13.

📒 Files selected for processing (2)
  • docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md
  • docs/mkdocs.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/mkdocs.yml

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@qinqon: This PR has been marked as verified by e2e(build docs).

Details

In response to this:

/verified by e2e(build docs)

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.

@orenc1

orenc1 commented May 11, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/thanks 👍

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

@hypershift-jira-solve-ci

Copy link
Copy Markdown
Contributor

Test Failure Analysis Complete

Job Information

Test Failure Analysis

Error

docs/content/reference/aggregated-docs.md: needs update

Summary

The PR adds a new documentation file (docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md) but does not include the regenerated docs/content/reference/aggregated-docs.md. The CI verify job runs make generate update, which invokes the docs-aggregator tool (hack/tools/docs-aggregator/main.go). This tool recursively scans all .md files under docs/content/ and concatenates them into a single aggregated-docs.md. Because the new file was added without regenerating this aggregated output, the post-generation dirty-tree check (git diff --exit-code HEAD) detects uncommitted changes and fails.

Root Cause

The repository contains an automated docs aggregation tool at hack/tools/docs-aggregator/main.go that recursively walks docs/content/, collects every .md file (excluding aggregated-docs.md itself), sorts them alphabetically, and writes them into docs/content/reference/aggregated-docs.md.

When PR #8473 added docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md, this new file became part of the aggregation input. The CI verify workflow runs make generate update which regenerates aggregated-docs.md with the new file included — but the PR does not contain the updated aggregated-docs.md. The final CI step runs git update-index --refresh && git diff --exit-code HEAD to verify the working tree is clean after regeneration. Since aggregated-docs.md was modified by the generation step but not committed in the PR, the diff check fails with exit code 1.

This is a standard "generated file not committed" failure — the PR author needs to run make generate update locally and commit the resulting changes to aggregated-docs.md.

Recommendations
  1. Run make generate update locally in the repo root to regenerate docs/content/reference/aggregated-docs.md with the new documentation file included.
  2. Commit the updated aggregated-docs.md alongside the existing PR changes.
  3. Push the updated commit — the verify job should then pass since the tree will be clean after generation.

The fix is a single command:

make generate update
git add docs/content/reference/aggregated-docs.md
git commit -m "docs: regenerate aggregated-docs.md"
Evidence
Evidence Detail
Failed step git update-index --refresh (dirty-tree check after make generate update)
Error output docs/content/reference/aggregated-docs.md: needs update
Files in PR docs/content/how-to/kubevirt/configuring-vm-with-jsonpatch.md (new), docs/mkdocs.yml (modified)
Missing file docs/content/reference/aggregated-docs.md (not included in PR, but modified by generation)
Aggregator tool hack/tools/docs-aggregator/main.go — scans all .md under docs/content/ recursively
Generation log Successfully aggregated 284 documentation files to docs/content/reference/aggregated-docs.md (should be 285 with new file)
Preceding steps passed make generate update, make staticcheck, make fmt, make vet all succeeded

Document the hypershift.openshift.io/kubevirt-vm-jsonpatch annotation
for advanced VM customization, focusing on node affinity configuration.
Covers required and preferred affinity rules, HostedCluster vs NodePool
scope, precedence behavior, and additional examples for CPU and network
patches.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
@qinqon

qinqon commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

CI check verify / Verify was failing on commit 23ecc13. Pushed a fix.

@qinqon
qinqon force-pushed the docs-kubevirt-jsonpatch-node-affinity branch from 23ecc13 to 938cef5 Compare May 11, 2026 12:12
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label May 11, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 11, 2026
@orenc1

orenc1 commented May 11, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

@qinqon

qinqon commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/verified by e2e(build docs)

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@qinqon: This PR has been marked as verified by e2e(build docs).

Details

In response to this:

/verified by e2e(build docs)

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

openshift-ci Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

@qinqon: 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

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/documentation Indicates the PR includes changes for documentation area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants