Skip to content

Reject snapshotConfig.storageLocation without its preview gate - #3357

Merged
Tim Hockin (thockin) merged 5 commits into
agent-substrate:mainfrom
Sneha-at:per-template-snapshot-location-ifdisabled
Oct 29, 2026
Merged

Tim Hockin (thockin) merged 5 commits into
agent-substrate:mainfrom
Sneha-at:per-template-snapshot-location-ifdisabled

Conversation

@Sneha-at

@Sneha-at Sneha-at (Sneha-at) commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #2544, from review comment #2544 (comment).

snapshotConfig.storageLocation was accepted and ignored while the PerTemplateSnapshotLocation gate was off. A user could name a bucket, get a success response, and have snapshots written under the cluster --snapshot-location.

What changed?

Tested on kind with the cluster --snapshot-location=gs://ate-snapshots/. <loc> is the template's storageLocation.

Gate Case Before (7e6476cbd) This PR
ON with storageLocation, --preview created, snapshot under <loc> created, snapshot under <loc>
ON with storageLocation, no --preview rejected: Forbidden: requires a client that opts in to preview features ... rejected: Forbidden
ON without storageLocation created, snapshot under gs://ate-snapshots/ same
OFF with storageLocation, --preview created, but snapshot under gs://ate-snapshots/, not <loc> rejected: Forbidden
OFF with storageLocation, no --preview created, field ignored rejected: Forbidden
OFF without storageLocation created, snapshot under gs://ate-snapshots/ same

API validation

  • With preview off, a template that sets storageLocation is rejected with InvalidArgument. Before, it was accepted and silently ignored.
  • The old custom check is replaced by the standard ifDisabled forbidden rule that other preview fields use.

Demos and benchmarks

  • No demo or benchmark template sets storageLocation any more. They all store snapshots under the cluster --snapshot-location.
  • ${BUCKET_NAME} templating is gone from the demo rendering and the benchmark deploy scripts. The traffic-driver script loses --bucket-name.

Install (ate-setup)

  • The comments and operator docs now say that the demos, benchmarks and e2e need SNAPSHOT_LOCATION even with the gate on.

E2E fixtures and suites

  • With the gate on, the fixtures, combinedvolumes, and the demo, golden and template-update tests each set their own per-template location through e2e.SnapshotLocation. With it off, they leave the field out.
  • Templates copied from a demo also get their own location with the gate on. This brings per-template coverage back to the networkpolicy and egress suites.

Unit tests

  • Validation tests now expect Forbidden when preview is off. Length and URI checks run with preview on.
  • The control API tests no longer rely on a default storageLocation. They set the cluster default the way nearby tests do.
  • The demo manifest tests and the kubectl-ate template tests fail if a shipped manifest sets storageLocation again.

Docs

  • The API guide, operator install docs, demo READMEs, benchmarking README and the preview gate doc no longer mention bucket templating. They describe the field as preview-only.

@Sneha-at
Sneha-at (Sneha-at) marked this pull request as ready for review October 27, 2026 23:51
@zlammerts-svg

Copy link
Copy Markdown
Collaborator

Sneha-at (@Sneha-at) Please make sure that your PR passes the DCO check. : )

@Sneha-at
Sneha-at (Sneha-at) force-pushed the per-template-snapshot-location-ifdisabled branch from aa6f0ab to 2c4b385 Compare October 28, 2026 00:02

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.

This still sets StorageLocation, so the PR adds three lines that clear it in individual tests (actor_test.go:938, template_reconciler_test.go:694, :750). Removing it from the shared template would avoid that. Tests that rely on it would then set it themselves.

@ILLUM1N0X ILLUM1N0X 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.

Spots outside the diff still describe the old behavior:

  • cmd/ate-setup/internal/steps/apienv.go clusterSnapshotLocation still lets you install with PerTemplateSnapshotLocation turned on and no SNAPSHOT_LOCATION. The comment above it says that in that case "every template must set its own." No demo, benchmark or e2e fixture template sets storageLocation anymore, so all of them fail with FailedPrecondition on that install. The PR description says the cluster must have SNAPSHOT_LOCATION, but the installer doesn't require it. The fix is to always require it, or to fix the comment and the error message
  • cmd/ate-setup/internal/config/config.go Demos are no longer templated with the bucket. BucketName now only feeds BUCKET_NAME to scripts like hack/install-microvm-deps.sh, so the comment needs an update
  • cmd/ate-setup/commands.md still lists BUCKET_NAME as required
  • cmd/ate-setup/internal/steps/substrate_test.go line 44 the comment still says every installer provides ${BUCKET_NAME}, and on line 116 the test still replaces it

The field was accepted and ignored while PerTemplateSnapshotLocation was
off, so a template could name a bucket its snapshots never used. Gate it
with ifDisabled=forbidden like the other preview fields.

Templates that set it now fail without the gate, so drop it from the
demos, benchmark workloads, e2e fixtures and tests. They use
--snapshot-location instead.

Signed-off-by: Sneha Aradhey <snehaaradhey@google.com>
The golden and template-update demo tests set storageLocation again when
the gate is enabled. CreateSubstrateTemplateFrom drops a copied
storageLocation without the gate, since a source template stored earlier
may still carry one. Update the demo READMEs that said the bucket is
injected into templates.

Signed-off-by: Sneha Aradhey <snehaaradhey@google.com>
No ActorTemplate manifest uses ${BUCKET_NAME} since storageLocation was
dropped from them. Remove the substitution and the bucket parameters
from the e2e fixture helpers, ate-setup demo rendering, and the
benchmark deploy scripts, along with the BUCKET_NAME requirements that
only fed it. deploy-traffic-driver.sh loses --bucket-name.

Signed-off-by: Sneha Aradhey <snehaaradhey@google.com>
The fixture templates stopped setting storageLocation so that gate-off
lanes pass validation. Gate-on lanes lost per-template coverage as a
result. DeploySubstrateFixture and combinedvolumes now set it through
e2e.SnapshotLocation, which returns a location only with the
PerTemplateSnapshotLocation gate.

CreateSubstrateTemplateFrom no longer clears a copied storageLocation,
since gate-off sources no longer carry one.

Signed-off-by: Sneha Aradhey <snehaaradhey@google.com>
Comments and docs still described BUCKET_NAME templating and an
optional storageLocation. Fix them, and say that demos and benchmarks,
and so e2e runs, need --snapshot-location even with the
PerTemplateSnapshotLocation gate.

Templates that CreateSubstrateTemplateFrom copies now get their own
e2e.SnapshotLocation, so gate-on lanes keep per-template coverage.

The demo manifest tests and the kubectl-ate template tests fail if a
manifest sets storageLocation. validActorTemplate no longer sets it.

Signed-off-by: Sneha Aradhey <snehaaradhey@google.com>
@Sneha-at
Sneha-at (Sneha-at) force-pushed the per-template-snapshot-location-ifdisabled branch from cbcbad7 to ae371f8 Compare October 28, 2026 22:52
@thockin
Tim Hockin (thockin) added this pull request to the merge queue Oct 29, 2026
Merged via the queue into agent-substrate:main with commit d86746d Oct 29, 2026
5 checks passed
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.

5 participants