mirror of https://github.com/pulumi/pulumi.git
e47c5823c0
We want the filestate backend to support project-scoped stacks, but we can't make the change as-is because it would break old states with new CLIs. To differentiate between old and new states, we've decided to introduce the concept of state metadata. This is a file under the path .pulumi/Pulumi.yaml that tracks metadata necessary for the filestate backend to operate. Initially, this contains just one field: `version`, with the initial value of 0 representing non-project or "legacy mode". This changes the filestate layout to track such a file, creating it if it doesn't exist with the default value of 0. In a future change, we'll introduce "version 1", which adds support for project-scoped stacks. If we ever need to make breaking changes to the layout, the version in this file will help the CLI decide whether it's allowed to handle that state bucket without corrupting it. Note that this differs slightly from the initial implementation of this functionality in #12134. Particularly, this idempotently ensures that a Pulumi.yaml exists, allowing `version: 0` to indicate legacy mode, versus the original implementation that treated absence of the file in a non-empty bucket as legacy mode. This drops the bucket.IsAccessible check from filestate.New because accessibility is now verified when we try to read the metadata file. Extracted from #12437 |
||
---|---|---|
.. | ||
display | ||
filestate | ||
httpstate | ||
state | ||
apply.go | ||
backend.go | ||
backend_test.go | ||
doc.go | ||
errors.go | ||
mock.go | ||
policypack.go | ||
query.go | ||
snapshot.go | ||
snapshot_test.go | ||
stack.go | ||
updates.go | ||
watch.go |