Description
Before implementing issue #11 (Ignition config generation), verify that github.com/coreos/butane can be used as an embedded Go library to compile Butane YAML → Ignition JSON.
Why This Is a Spike
The Butane project's Go embedding API is not well-documented. There's a risk it's CLI-only or has an unstable internal API. We need to confirm this BEFORE issue #11 begins.
Acceptance Criteria
Fallback
If Butane cannot be cleanly used as a Go library:
- Plan B: Shell out to the
butane binary via Runner (requires butane in PATH or embedded)
- Plan C: Generate Ignition JSON directly (skip Butane layer — more work, less validation)
Spike Output
func TestButaneSpike_CompilesFlatcar(t *testing.T) {
butaneYAML := []byte(`
variant: flatcar
version: 1.1.0
storage:
disks:
- device: /dev/disk/by-id/test
wipe_table: true
`)
// Attempt compilation via Butane Go API
ignJSON, err := /* butane compile call */
require.NoError(t, err)
assert.Contains(t, string(ignJSON), `"ignition"`)
}
Notes
Pin Butane spec version. For Flatcar variant, the current spec is likely 1.1.0 or 1.2.0. Check https://coreos.github.io/butane/config-flatcar-v1_1/ for the latest.
Description
Before implementing issue #11 (Ignition config generation), verify that
github.com/coreos/butanecan be used as an embedded Go library to compile Butane YAML → Ignition JSON.Why This Is a Spike
The Butane project's Go embedding API is not well-documented. There's a risk it's CLI-only or has an unstable internal API. We need to confirm this BEFORE issue #11 begins.
Acceptance Criteria
internal/ignition/butane_spike_test.gogithub.com/coreos/butane/configorgithub.com/coreos/butane/config/common)Fallback
If Butane cannot be cleanly used as a Go library:
butanebinary via Runner (requires butane in PATH or embedded)Spike Output
Notes
Pin Butane spec version. For Flatcar variant, the current spec is likely
1.1.0or1.2.0. Check https://coreos.github.io/butane/config-flatcar-v1_1/ for the latest.