Conversation
…raint
Shrink the minimum valid Talos image build config so authors can omit
the entire `output:` block when the lab defaults are appropriate, and
tighten `output.dir` to share the same #RelativePath constraint already
applied to file inputs.
- output.dir defaults to ".state/images" and is now #RelativePath, so
absolute paths and `..` segments are rejected at validation time the
same way userData.path already is.
- output.bootArtifactName defaults to "talos-boot.img".
- output.configArtifactName defaults to "talos-cidata.img".
- output is now optional on #ImageBuild because every nested field has
a default. The minimal example in README.md drops down to name +
source.version + config.userData.path + config.metaData.localHostname.
The generated Go types lose their NonEmptyString/ArtifactName
constraints because CUE renders `*default | type` disjunctions as the
underlying Go string. The cast removals in tools/labctl service.go
follow from that — the validator still enforces the constraint at YAML
parse time.
Tests cover the new defaults via a minimal-config validator test and a
new minimal-config txtar case asserting artifacts land at
.state/images/talos-{boot,cidata}.img with no overrides.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f26e029 to
a4e8e51
Compare
This was referenced May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Shrink the minimum valid Talos image build config so authors can omit the entire
output:block when lab defaults are appropriate, and bringoutput.dirinto the same#RelativePathconstraint already applied to file inputs. The minimal example in the schema README drops to four fields; everything else defaults.This is PR 3 of 5 from the session 057 plan. Independent of PR 1 (#65) and PR 2 (#66) — different files entirely. Triggers a
schemas/labrelease cycle.What changed
output.dirdefaults to.state/imagesand is now#RelativePath. Absolute paths and..segments are rejected at validation time, matchinguserData.path.output.bootArtifactNamedefaults totalos-boot.img.output.configArtifactNamedefaults totalos-cidata.img.outputitself is now optional on#ImageBuildbecause every nested field has a default. The minimal example inschemas/lab/talos/README.mddrops toname + source.version + config.userData.path + config.metaData.localHostname.The generated Go types lose their
NonEmptyString/ArtifactNamenamed-string constraints because CUE renders*default | typedisjunctions as the underlying Go string. The cast removals intools/labctl/internal/app/talosimage/service.gofollow from that — the validator still enforces the constraints at YAML parse time, the Go type system just no longer carries them.Why now
Session 057's review flagged that the existing
output.dirwas looser (#NonEmptyString) than the analogous#FileInput.path(#RelativePath), and that several output fields were required when they had stable, unsurprising defaults. Authors can now write a four-field config to build a default lab image.Out of scope
Release machinery
After merge, Release Please will open a
chore(master): release schemas/lab X.Y.ZPR. Following session 056's pattern: merge that, then manually publish the CUE module (cue mod publish) until thePublish Lab Schemasworkflow's GHCR auth is fixed, then bump labctl'sgo.modif needed in a follow-up. Local labctl tests pass viago.workresolving to the local schemas dir, so master CI stays green during the release cycle.Test plan
go test ./...fromtools/labctl/andschemas/lab/— full suites pass.moon run schemas:check labctl:check --summary minimal— all green.moon ci --summary minimalfromplatform/— all 14 actions pass.talosconfig.TestValidateYAMLAppliesOutputDefaults) confirms the four defaults render whenoutput:is omitted.talos-minimal.yamlconfirms a config with nooutput:block produces artifacts at.state/images/talos-boot.imgand.state/images/talos-cidata.img.#FileInput.path) continues to enforce#RelativePathrejection — covers the same constraint type now applied tooutput.dir.🤖 Generated with Claude Code