Skip to content

MCO-154: Default MCS-served Ignition to the latest spec for unversioned requests - #6796

Open
ptalgulk01 wants to merge 1 commit into
openshift:mainfrom
ptalgulk01:ppt/mco_154
Open

ptalgulk01 wants to merge 1 commit into
openshift:mainfrom
ptalgulk01:ppt/mco_154

Conversation

@ptalgulk01

@ptalgulk01 ptalgulk01 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: MCO-154 Epic: MCO-2640

- What I did
The MCS served Ignition spec v2.2 to any request without a versioned Accept header (plain curl, no header, or Ignition header without version=) — a 2020 back-compat choice. Current boot images reject spec v2, and producing it requires a lossy v3.6→v3.2→v2.2 down-conversion.

This changes the default in detectSpecVersionFromAcceptHeader (pkg/server/api.go) to the latest supported spec (ign3types.MaxVersion, 3.6.0). Explicit version requests are untouched: version=2.x still serves 2.2.0, version=3.x behaves as before.

Tests: updated the three default-path cases in TestAcceptHeaders and added a TestAPIHandler scenario asserting an Accept-header-less request returns {"ignition":{"version":"3.6.0"}}.

- How to verify it
Unit tests: go test ./pkg/server/ -run "TestAcceptHeaders|TestAPIHandler" -v

On a cluster:
unversioned curl now gets the current spec (previously 2.2.0)

oc debug node/<node> -- chroot /host curl -sk https://localhost:22623/config/worker | jq -r .ignition.version
expect: 3.6.0

explicit v2 must still be honored

oc debug node/<node> -- chroot /host curl -sk -H "Accept: application/vnd.coreos.ignition+json; version=2.4.0" https://localhost:22623/config/worker | jq -r .ignition.version
expect: 2.2.0

Node provisioning is unaffected: Ignition clients always send a versioned. Accept header and never hit the default (verified by scaling a pool and confirming the node joins).

- Description for the changelog

MCS now serves the latest supported Ignition spec (3.6.0) instead of spec 2.2 when a client requests a config without a versioned Ignition Accept header; explicit version requests continue to be honored as before.

Summary by CodeRabbit

  • Bug Fixes
    • Requests without a valid, versioned Ignition media type in the Accept header now receive Ignition spec version 3.6.0 by default, instead of 2.2.0.
    • Requests with supported, versioned Ignition media types continue to use the existing version-selection behavior.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Walkthrough

The server now selects Ignition’s latest supported spec when the Accept header does not specify a versioned Ignition media type. Tests cover these header cases and a GET request without an Accept header.

Changes

Accept Header Default

Layer / File(s) Summary
Default spec selection and API coverage
pkg/server/api.go, pkg/server/api_test.go
The parser returns ign3types.MaxVersion when no versioned Ignition media type is selected. Tests expect 3.6.0 for the affected Accept-header cases and for a GET request without an Accept header.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: lorbuschris, pablintino

Merge Risk: Minimal · up to d0d6a

Requests without a versioned Ignition Accept header now receive spec 3.6.0 instead of 2.2.0. Explicit version requests are unchanged. The updated tests cover the new default, and no merge-blocking risk was identified.

Pre-merge checks: Passed 14

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: MCS-served Ignition now defaults to the latest spec (3.6.0) for requests without a versioned Accept header. The raw summary confirms that detectSpecVersionFromAcceptHe…
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 check applies to Ginkgo test titles (It, Describe, Context, When, and similar). This PR does not use Ginkgo. The changed files are pkg/server/api.go and pkg/server/api_test.go. The diff adds no It…
Test Structure And Quality Passed The "Test Structure and Quality" check applies to Ginkgo test code (It blocks, BeforeEach/AfterEach, ote.Informing). The PR changes two files: pkg/server/api.go and pkg/server/api_test.go. The diff fo…
Microshift Test Compatibility Passed The MicroShift Test Compatibility check applies only when new Ginkgo e2e tests (It, Describe, Context, When) are added. The reviewed range changes two files: pkg/server/api.go and pkg/server/api_test.…
Single Node Openshift (Sno) Test Compatibility Passed The check applies only when new Ginkgo e2e tests (It/Describe/Context/When) are added. The reviewed range (refs/coderabbit/pre-merge-check/base..head) changes only two files: pkg/server/api.go and pkg…
Topology-Aware Scheduling Compatibility Passed The check applies to changes to deployment manifests, operator code, or controllers that add or modify scheduling constraints. This PR changes only two files: pkg/server/api.go and pkg/server/api_test…
Ote Binary Stdout Contract Passed The check is not applicable to this pull request, so it passes. The "OTE Binary Stdout Contract" applies to process-level stdout writes in OpenShift Tests Extension binaries (main, init, TestMain, sui…
Ipv6 And Disconnected Network Test Compatibility Passed The check applies only when new Ginkgo e2e tests (It, Describe, Context, When) are added. The PR changes two files: pkg/server/api.go (default Ignition spec version changed from 2.2.0 to ign3types.Max…
No-Weak-Crypto Passed The no-weak-crypto check flags MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB use, custom crypto implementations, and non-constant-time comparison of secrets or tokens. The PR (openshift/machine-config-oper…
Container-Privileges Passed The container-privileges check covers container and Kubernetes manifests. The PR changes only two Go files: pkg/server/api.go (default Ignition spec version in detectSpecVersionFromAcceptHeader) and p…
No-Sensitive-Data-In-Logs Passed The check looks for logging that may expose secrets, PII, session IDs, internal hostnames, or customer data. The changed-file inventory is pkg/server/api.go and pkg/server/api_test.go. The diff in api…
Full details: Title check

Explanation

The title names the main change: MCS-served Ignition now defaults to the latest spec (3.6.0) for requests without a versioned Accept header. The raw summary confirms that detectSpecVersionFromAcceptHeader now falls back to ign3types.MaxVersion instead of v2.2.0, and that the tests expect 3.6.0 for the default path. The MCO-154 ticket prefix is extra context and does not affect relevance.

Full details: Stable And Deterministic Test Names

Explanation

The check applies to Ginkgo test titles (It, Describe, Context, When, and similar). This PR does not use Ginkgo. The changed files are pkg/server/api.go and pkg/server/api_test.go. The diff adds no It/Describe/Context/When/DescribeTable/Entry calls, and neither file imports onsi/ginkgo. The repository uses standard Go testing (func TestXxx(t *testing.T)). The PR changes existing TestAcceptHeaders cases and adds one table-driven case named "get config path that exists with no accept header" to TestAPIHandler. That name is static. It contains no pod names, timestamps, UUIDs, node names, IPs, or legacy openshift-tests-private metadata prefixes. The check is therefore inapplicable to this change and passes.

Full details: Test Structure And Quality

Explanation

The "Test Structure and Quality" check applies to Ginkgo test code (It blocks, BeforeEach/AfterEach, ote.Informing). The PR changes two files: pkg/server/api.go and pkg/server/api_test.go. The diff for api_test.go contains no Ginkgo, Gomega, or ote markers. The file imports only the standard testing package with testify, and its tests are plain Go functions (TestAcceptHeaders, TestAPIHandler). The changed tests are therefore outside the scope of this Ginkgo-specific check, so the check is inapplicable and passes. Ginkgo-style criteria such as It() single responsibility, cleanup hooks, and Informing do not map onto these standard Go unit tests. The primary PR is #6796 by ptalgulk01.

Full details: Microshift Test Compatibility

Explanation

The MicroShift Test Compatibility check applies only when new Ginkgo e2e tests (It, Describe, Context, When) are added. The reviewed range changes two files: pkg/server/api.go and pkg/server/api_test.go. Both are standard Go unit-test sources in the MCS server package. A search of the diff for added Ginkgo constructs (g.It, g.Describe, g.Context, g.When, and the bare It/Describe/Context/When forms) found no matches. The new TestAPIHandler case and the updated TestAcceptHeaders cases are plain Go tests, not Ginkgo specs. The check is therefore inapplicable to this PR, and it passes. The PR changes the default Ignition spec version from 2.2.0 to 3.6.0 for unversioned Accept headers. That change does not add an e2e test or touch any OpenShift API.

Full details: Single Node Openshift (Sno) Test Compatibility

Explanation

The check applies only when new Ginkgo e2e tests (It/Describe/Context/When) are added. The reviewed range (refs/coderabbit/pre-merge-check/base..head) changes only two files: pkg/server/api.go and pkg/server/api_test.go. Searches of the full diff for g.It(, g.Describe(, g.Context(, bare It(/Describe( additions, and "ginkgo"/"e2e" references found no matches. The added tests in api_test.go are standard Go unit tests (TestAcceptHeaders and a TestAPIHandler scenario) for the Accept-header default in the MCS server. No new e2e tests exist, so no SNO topology assumption can be introduced. The check is inapplicable and passes.

Full details: Topology-Aware Scheduling Compatibility

Explanation

The check applies to changes to deployment manifests, operator code, or controllers that add or modify scheduling constraints. This PR changes only two files: pkg/server/api.go and pkg/server/api_test.go. Neither is a deployment manifest, and neither is a controller. The change sets the default Ignition spec version served by the Machine Config Server (MCS) for requests without a versioned Accept header, from 2.2.0 to ign3types.MaxVersion (3.6.0). It adds no pod affinity, anti-affinity, topology spread, tolerations, nodeSelectors, replica counts, PodDisruptionBudgets, or node role logic. A scan of the diff for scheduling-related terms (affinity, toleration, nodeSelector, topology, maxUnavailable, PodDisruptionBudget, control-plane, master, arbiter, replicas, spread) found only a test request path string "/config/master", which is an Ignition config path and not a scheduling constraint. The check does not apply, so it passes.

Full details: Ote Binary Stdout Contract

Explanation

The check is not applicable to this pull request, so it passes. The "OTE Binary Stdout Contract" applies to process-level stdout writes in OpenShift Tests Extension binaries (main, init, TestMain, suite setup, top-level initializers). The reviewed range changes only two files: pkg/server/api.go and pkg/server/api_test.go in the MCO codebase. The change switches the default Ignition spec returned by detectSpecVersionFromAcceptHeader from v2.2.0 to ign3types.MaxVersion, and it updates Accept-header tests. A search of all added lines in the diff found no fmt.Print*, os.Stdout, klog, log.SetOutput, func main, func init, TestMain, BeforeSuite, or RunSpecs matches. The change does not touch any OTE binary entry point or suite setup code.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

The check applies only when new Ginkgo e2e tests (It, Describe, Context, When) are added. The PR changes two files: pkg/server/api.go (default Ignition spec version changed from 2.2.0 to ign3types.MaxVersion) and pkg/server/api_test.go (standard Go unit tests: TestAcceptHeaders expectations and a new TestAPIHandler case). A search of the added lines found no Ginkgo constructs (g.It, g.Describe, g.Context, g.When, or ginkgo imports). The check is therefore inapplicable. The new test uses hardcoded localhost-style httptest URLs in a unit test, but the check's IPv4 and external-connectivity rules cover only Ginkgo e2e tests, so they do not apply here.

Full details: No-Weak-Crypto

Explanation

The no-weak-crypto check flags MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB use, custom crypto implementations, and non-constant-time comparison of secrets or tokens. The PR (openshift/machine-config-operator #6796, author ptalgulk01) changes only pkg/server/api.go and pkg/server/api_test.go. The diff changes the default Ignition config spec version in detectSpecVersionFromAcceptHeader from v2.2.0 to ign3types.MaxVersion (3.6.0). It also updates comments and test expectations, and adds a test case with an unversioned Accept header. I searched the added lines for hash, cipher, mode, and comparison keywords (md5, sha1, des, rc4, blowfish, ecb, crypto, hmac, subtle, bytes.Equal, secret, token, password, ==) and found no matches. The change introduces no weak cipher, weak hash, custom crypto, or secret comparison, so no failure condition applies.

Full details: Container-Privileges

Explanation

The container-privileges check covers container and Kubernetes manifests. The PR changes only two Go files: pkg/server/api.go (default Ignition spec version in detectSpecVersionFromAcceptHeader) and pkg/server/api_test.go. The diff contains no YAML, JSON, Dockerfile, Containerfile, or manifest files. A keyword search of the two changed files for privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, and runAsUser returned no matches. The check does not apply to this change, and no privilege-related setting was introduced.

Full details: No-Sensitive-Data-In-Logs

Explanation

The check looks for logging that may expose secrets, PII, session IDs, internal hostnames, or customer data. The changed-file inventory is pkg/server/api.go and pkg/server/api_test.go. The diff in api.go only changes the default Ignition spec version returned by detectSpecVersionFromAcceptHeader (v2.2.0 to ign3types.MaxVersion) and updates comments. A grep of all added lines under pkg/server/ for klog, log., glog, logger, Printf, and Errorf found no added logging statements. The change adds no log output, so it cannot introduce sensitive data into logs.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b2b82e8 and d0d6aa9.

Files selected for processing: 2

  • pkg/server/api.go
  • pkg/server/api_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@ptalgulk01 ptalgulk01 changed the title Add fix for MCO-154 MCO-154: Default MCS-served Ignition to the latest spec for unversioned requests Nov 27, 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 Nov 27, 2026
@openshift-ci-robot

openshift-ci-robot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

@ptalgulk01: This pull request references MCO-154 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 story to target the "5.2.0" version, but no target version was set.

Details

In response to this:

Fixes: MCO-154 Epic: MCO-2640

- What I did
The MCS served Ignition spec v2.2 to any request without a versioned Accept header (plain curl, no header, or Ignition header without version=) — a 2020 back-compat choice. Current boot images reject spec v2, and producing it requires a lossy v3.6→v3.2→v2.2 down-conversion.

This changes the default in detectSpecVersionFromAcceptHeader (pkg/server/api.go) to the latest supported spec (ign3types.MaxVersion, 3.6.0). Explicit version requests are untouched: version=2.x still serves 2.2.0, version=3.x behaves as before.

Tests: updated the three default-path cases in TestAcceptHeaders and added a TestAPIHandler scenario asserting an Accept-header-less request returns {"ignition":{"version":"3.6.0"}}.

- How to verify it
Unit tests: go test ./pkg/server/ -run "TestAcceptHeaders|TestAPIHandler" -v

On a cluster:
unversioned curl now gets the current spec (previously 2.2.0)

oc debug node/<node> -- chroot /host curl -sk https://localhost:22623/config/worker | jq -r .ignition.version
expect: 3.6.0

explicit v2 must still be honored

oc debug node/<node> -- chroot /host curl -sk -H "Accept: application/vnd.coreos.ignition+json; version=2.4.0" https://localhost:22623/config/worker | jq -r .ignition.version
expect: 2.2.0

Node provisioning is unaffected: Ignition clients always send a versioned. Accept header and never hit the default (verified by scaling a pool and confirming the node joins).

- Description for the changelog

MCS now serves the latest supported Ignition spec (3.6.0) instead of spec 2.2 when a client requests a config without a versioned Ignition Accept header; explicit version requests continue to be honored as before.

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 Nov 27, 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 yuqi-zhang 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

@redhat-chai-bot

Copy link
Copy Markdown
Contributor

Chai risk assessment for d0d6aa983bfa6006c58823ee7faa3e9f46550020 → main

Tier: Critical
Assessed: Critical
Minimum: Low
Signals: 2 files, +39/-11 lines outside vendored and generated code; no API type changes; no CRD schema changes; full diff read.
Rubric: https://github.com/openshift-eng/ai-helpers/tree/5dabac2e93bec75ff35c09deac7e39220ce1e9ff/plugins/openshift-developer/skills/pr-risk-assessment

Reason: The change makes the Machine Config Server serve a different config to some clients. When a request to /config/ has no versioned Ignition Accept header (no header, a non-Ignition header, an Ignition header without version=, or an unparseable header), the server now returns Ignition spec 3.6.0 (ign3types.MaxVersion) instead of the 2.2.0 it has returned for these requests since 2020. Requests that name a version are handled as before. This changes what the MCS API returns by default on every existing cluster once it runs the new MCO, so it meets the Critical criteria for API changes existing clients consume and for defaults applied to existing installations. If the change is wrong, the impact falls on node provisioning: any client that fetches pool config without a versioned header and expects spec v2 will get a config it cannot parse, and if that client is used to bring up nodes, those nodes fail to join. Ignition, the assisted-installer and the assisted-installer-agent all send versioned headers, so the main install paths I checked are not affected, and I found no Windows Machine Config Operator code that calls the endpoint. A code search cannot rule out unversioned clients in customer UPI or bare-metal tooling, scripts, or components outside the indexed repos, and that uncertainty pushed the tier up. Signals: 2 files, +39/-11, one production function plus unit tests, no API type or CRD changes, full diff read; the repository has no AGENTS.md on main.

Change it with @redhat-chai-bot /risk-tier <low|moderate|critical>: anyone can raise the tier; lowering it needs two OWNERS approvers and lasts until the next push.

/label chai-risk-assessment/critical

@openshift-ci openshift-ci Bot added the chai-risk-assessment/critical Chai risk assessment of the latest commit: critical (may disrupt clusters if wrong). label Nov 27, 2026
@openshift-ci

openshift-ci Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@ptalgulk01: The following test 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/e2e-gcp-mco-upgrade d0d6aa9 link false /test e2e-gcp-mco-upgrade

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

chai-risk-assessment/critical Chai risk assessment of the latest commit: critical (may disrupt clusters if wrong). jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants