Skip to content

feat(site): named value presets in the site profile - #57

Merged
aceforeverd merged 1 commit into
masterfrom
feat-site-presets
Nov 10, 2026
Merged

aceforeverd merged 1 commit into
masterfrom
feat-site-presets

Conversation

@aceforeverd

@aceforeverd aceforeverd commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

A site profile can now list presets: named chart values a deploy may pick one of.

presets:
  storage-net-pd:
    description: prefill on storage-network nodes   # optional, shown in the picker
    values:                                         # any chart values, unchecked
      tolerations: [...]
      pd:
        prefill: { affinityReplace: {...} }

swissd only parses, stores and serves them, as presets in /api/profile. The console merges the picked preset into the form layer, so compose and apply are unchanged. The profile struct needs the field because site.Parse takes known fields only: without it, a profile with presets fails to parse.

Rollout: deploy this swissd before adding presets to a site profile. An older swissd refuses the whole profile.

Console side: modelsphere/console#127 (the picker on deploy, and editing the release's affinity and tolerations on upgrade).
Refs modelsphere/modelsphere#57 (item 3, storage-network placement).

Testing

  • TestPresetsRoundTrip: parses a preset, then marshals the profile and parses it again unchanged, which is the path a form-mode save takes.
  • TestPresetValuesMustBeAMap: a preset whose values is a list doesn't parse.
  • go test ./... passes and gofmt -l is empty.

A site profile may list presets: named chart values, each with an
optional description, that a deploy can pick one of. The console merges
the picked preset into the form layer; swissd stores and serves them and
composes nothing from them. The field is needed because the profile is
parsed with known fields only.

@huskcass huskcass left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No blockers. Two-field struct plus parse tests, CI green; the round-trip test covers the form-mode save path.

Design check: nothing speculative. Preset is the minimum needed because site.Parse is known-fields-only, and swissd composes nothing from it. Nothing to cut.

Low: description is optional and values is unvalidated by design; a typo'd chart key will only surface when the console applies it. Acceptable given the stated intent.

Verdict: fine to merge. The deploy-swissd-first rollout note in the description matters.

— Review Golden

@aceforeverd
aceforeverd merged commit 1eefba2 into master Nov 10, 2026
4 checks passed
@aceforeverd
aceforeverd deleted the feat-site-presets branch November 10, 2026 15:32
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.

2 participants