Skip to content

controlplane: an installation names a release or a channel, and the spin provider resolves it - #131

Merged
aledbf merged 2 commits into
mainfrom
spin-release-provider
Nov 18, 2026
Merged

aledbf merged 2 commits into
mainfrom
spin-release-provider

Conversation

@aledbf

@aledbf aledbf commented Nov 17, 2026

Copy link
Copy Markdown
Member

Part 4 of #130. Draft until spin-stack/terraform-provider-spin is published to the OpenTofu registry (registry.opentofu.org, which this repo's CI and installations use) and the Terraform registry. Without it, tofu init can't find spin-stack/spin, so this PR's CI fails on purpose. Once it's published, a commit here adds the provider's entries to each .terraform.lock.hcl.

What changes for an installation

  • spin_version takes a release, v<YYYYMMDD>.<N>, or a channel: edge or stable. Moving spin no longer moves the module's ref. On a channel, the next plan picks up the new release; a new revision or a revocation shows up the same way.
  • data "spin_release" (provider spin-stack/spin ~> 0.1) replaces images.json and measurements.json, and both files are deleted. The provider answers only what the release workflow signed (go-tools' catalog). Anything else fails the plan.
  • The catalog's AMI ids aren't signed (the PCRs are), so data.aws_ami.spin_os now asks for owners = [var.image_publisher] (new variable, default the publishing account 277203350136). An id owned by anyone else is not booted. Planted without owners, the test fails.
  • image_ids/image_measurements still work for images of your own, and then spin_version must be an exact release: a channel would name a release those images don't carry.

Scripts

  • propose.sh only moves the module's ref (spin_version belongs to the deployment). The workflow still accepts region, because shipset sends it (shipset#22).
  • fresh-install.sh picks the newest release that installs in its region from the catalog branch. The upgrade starts from the module's newest tag; a tag from before the catalog upgrades from what its own images.json installs.
  • release.sh's notes say spin_version = "stable".

Checked

  • tofu test on modules/controlplane: 65 passed, with the provider built from main through a local filesystem mirror. The image and revocation tests now use override_data on data.spin_release.this: a channel, no image in the region, no trusted build, a revoked release, images of your own on a channel.
  • End to end: the real provider, against the real catalog branch (created today from main's files, 21 releases, each verified), resolves v20261114.01 to the same runner AMI images.json names.

Merge together with ami's follow-up that drops images:pr and makes the catalog step a failing one: the next release then writes only the catalog. The commit says Closes #130, but #130 still has the spinbox.dev auto-apply and shipset#22 left: I'll reopen it after the merge.

🤖 Generated with Claude Code

…pin provider resolves it

spin_version is a release, v<YYYYMMDD>.<N>, or a channel - edge, stable.
data.spin_release reads the image catalog (the catalog branch) and
answers the release, each role's images by region and the builds its
release signed and has not revoked; the module reads them in place of
images.json and measurements.json, which go. Upgrading spin no longer
moves the module's ref, and a revision or a revocation reaches an
installation at its next plan.

The catalog's image ids are not what the release signs, its PCRs are,
so a released image is asked of the account that publishes Spin OS
(image_publisher). Images of your own keep naming an exact release.

propose moves the module's ref alone; fresh-install chooses its release
from the catalog, and upgrades from the module's newest tag.

Closes #130

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf marked this pull request as ready for review November 18, 2026 02:25
…l plane

The controlplane module requires spin-stack/spin, and lint inits each
configuration with -lockfile=readonly: a lock without the provider refused
the init. v0.1.0, with the registry's hashes for every platform it serves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit f0f9007 into main Nov 18, 2026
1 check passed
@aledbf
aledbf deleted the spin-release-provider branch November 18, 2026 12:13
aledbf added a commit that referenced this pull request Nov 18, 2026
A deployment inits its plan with -lockfile=readonly, so a provider the module
at the new ref requires and its lock lacks - spin's, since #131 - refused the
plan of the very pull request that proposed it. Propose inits the deployment
with the pinned OpenTofu after moving the ref: a new provider is recorded, one
already locked keeps its version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant