Skip to content

Butane merge v2#2235

Draft
prestist wants to merge 1317 commits into
coreos:mainfrom
prestist:butane-merge-v2
Draft

Butane merge v2#2235
prestist wants to merge 1317 commits into
coreos:mainfrom
prestist:butane-merge-v2

Conversation

@prestist

@prestist prestist commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

The implementation is broken into six commits; reproducible via a shell script (https://gist.github.com/prestist/c3bfc2f3e2050b2d63a2ebb0f64bd066):

  1. History-preserving merge: Butane files are first moved into a butane/ subdirectory in a prep branch, then merged into Ignition via git merge --allow-unrelated-histories. This preserves full git history so git blame and git log --follow work correctly for all butane/ files.
  2. Cleanup: Butane's repo-level files are removed (go.mod, go.sum, vendor/, .github/, .copr/, linter configs) since these are now handled by Ignition's equivalents.
  3. Import path rewrite: All Go imports across ~150 files are rewritten from github.com/coreos/butane/ to github.com/coreos/ignition/v2/butane/ to work under Ignition's single Go module. Butane's unique dependencies (clarketm/json, go-systemd v22.7.0) are added to go.mod. A license header typo in Butane files is also fixed.
  4. Re-vendor: A single unified vendor/ directory replaces the two separate ones.
  5. config.Parse() integration: Ignition's config.Parse() function -- the single entry point used by all 30+ cloud providers, ignition-validate, ignition-apply, and referenced/merged configs -- is modified to try Ignition JSON first, then fall back to Butane YAML transpilation via butane/config.TranslateBytes(). On both failures, the original Ignition error is returned for backward compatibility. Unit tests cover JSON parsing, Butane YAML parsing (with and without content), invalid input, and source: local failure. The deprecated unit.Deserialize call is updated to unit.DeserializeOptions for the go-systemd v22.7.0 bump.
  6. Build and CI updates: The top-level ./build script sources butane/build to produce the butane binary and restores CGO_ENABLED=1 afterward (Butane sets it to 0, but Ignition requires cgo for libblkid). butane/build is updated to use the new module path. The ./test script adds butane/ to license header checks. The Makefile installs the butane binary. Eight errcheck lint issues in Butane code are fixed. Butane's TMT tests are removed to avoid conflicts with Ignition's TMT plan discovery.

yasminvalim and others added 30 commits September 20, 2024 12:32
- Use "layout" in the context path for errors related to the layout
  entry in the boot_device  configuration.
- Add tests for those error cases.
- Refactor mirror boot_device check for s390x.

Fixes: coreos/butane#484
For fcos 1.6.0-exp & openshift 4.18.0-exp specs, expected to be based on
stable 3.5.0 spec.

See: coreos#1693
See: coreos/fedora-coreos-tracker#1708
add: Support LUKS encryption using IBM CEX secure keys on s390x
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…-tests

*/translate_test: Do not pre-compute compressed data
Revert v4_22 to base/v0_6 (Ignition 3.5.0). Fix generated docs for storage.trees on openshift 4.21–4.22 and adjust setuid transform bounds for the 4.23 experimental spec.
OCP 4.22 MCO does not support Ignition spec 3.6.0 produced by Butane openshift 4.22.0
This reverts commit 10436b9, reversing changes made to 5d1a6d7.
@PeaceRebel

Copy link
Copy Markdown

So far LGTM. No changes in CI jobs? How does the packaging change with this?

yasminvalim and others added 6 commits June 29, 2026 19:42
Extended permissions for `storage.trees` were added in
coreos/butane#644 to the base 0.7-exp spec.

The openshift 4.21 spec was stabilized on the fcos 1.6 & base 0.6 spec,
thus it did not include support for those. Unfortunately, we missed that
in coreos/butane#674.
OpenShift 4.22's Machine Config Operator does not fully support Ignition
3.6.0 yet (OCPBUGS-90256).

Move v4_22 back to base/v0_6 and fcos/v1_6 and ignition/v3_5.

We are doing this breaking change in a minor release as the stabilized
spec that was released was unfortunately not working and thus there
should be no configuration from this spec in use so far.

What was moved back:
- Permissions for `storage.trees` not available in openshift 4.22
  (depends on base/v0_7 & fcos/v1_7, see:
  coreos/butane#644)
- Remove support for special mode bits (ignition/v3_6, see
  https://coreos.github.io/ignition/migrating-configs/#from-version-350-to-360)

Fixes: coreos/butane#704
Fixes: https://redhat.atlassian.net/browse/OCPBUGS-90256
- Note dependency on base 0.7 for storage.trees permissions
- Note dependency on external MCO support for GRUB config

See: coreos/butane#719
Revert "Merge pull request coreos#717 from coreos/update-4.22"
docs/release-notes: update for release v0.29.0
@prestist

prestist commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

So far LGTM. No changes in CI jobs? How does the packaging change with this?

We discussed this in the last fcos meeting, the details can be seen in the change request.

prestist added 7 commits July 13, 2026 16:01
Move all Butane source code, docs, tests, build scripts, and CI
configuration into a butane/ subdirectory in preparation for merging
into the Ignition repository via git merge --allow-unrelated-histories.

Related: coreos/fedora-coreos-tracker#2006
Merge the full Butane repository (github.com/coreos/butane) into the
butane/ subdirectory via git merge --allow-unrelated-histories, after
moving all Butane files into a butane/ subdirectory in the source repo.
This preserves complete Git history with proper rename tracking, so
git blame and git log --follow work correctly for all butane/ files.

Related: coreos/fedora-coreos-tracker#2006
Remove files from the butane/ subtree that are repo-level concerns
now handled by ignition: go.mod, go.sum, vendor/, CI workflows,
packaging configs, linter configs, and AI agent files. The actual
source code, docs, build scripts, tests, and opencode skills are
preserved.
Rewrite all internal Butane import paths from github.com/coreos/butane/
to github.com/coreos/ignition/v2/butane/ so that Butane's code is part
of the single Ignition Go module. Add github.com/clarketm/json as a
new dependency required by Butane, and bump go-systemd to v22.7.0.
Also fix stray ')' in license headers across Butane files.
Teach Ignition's config parser to accept Butane YAML configs in
addition to Ignition JSON. Parse() now tries Ignition JSON first and,
on failure, attempts to transpile the input as a Butane config using
the integrated butane/ library. This allows users to provide Butane
configs directly to instances without a separate transpilation step.

Key design decisions:
- JSON is tried first for zero behavioral change on existing configs
- On both failures, the original Ignition error is returned
- source: local properly errors since FilesDir is unavailable at boot
- OpenShift variant configs produce MachineConfig YAML which fails
  Ignition parsing, as those configs go through MCO

Related: coreos/fedora-coreos-tracker#2006
- build: Source butane/build to produce butane binary, restore CGO_ENABLED=1
- butane/build: Use module path, accept VERSION from parent
- test: Add butane/ to license header check paths
- Makefile: Install butane binary to /usr/bin
- config: Add unit tests for Butane YAML parsing
- config: Use DeserializeOptions (go-systemd v22.7.0)
- butane: Fix errcheck lint issues
- butane: Remove TMT tests (conflict with ignition TMT discovery)
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: c5102862-8848-4cd7-821f-ddb6e1f0010c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Binary size report (bin/amd64/ignition)

Size
Base (main) 21MiB
PR (#2235) 33MiB
Delta +13MiB (61.00%)

Remove Butane test cases that reference ErrZeroesWithShouldNotExist,
a validation that was deliberately removed from Ignition in commit
76f869a (stages/disks: Allow deleting a partition while creating
number 0). The validation was originally present in Ignition but was
removed because partition numbers are now resolved to their final
values, making the check unnecessary.

Butane's vendored copy of Ignition still had this validation, but
after merging into Ignition proper, the test cases reference the
real errors package which no longer defines this constant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.