pulumi/cmd
Sean Gillespie 1a1ba03925 Add per-resource states
Fixes pulumi/pulumi#1626. This commit obviates the need to invalidate
and re-validate snapshots as they are mutated, which in turn allows for
correctness when there are multiple snapshot mutations active at a time.

The crux of this commit is that the SnapshotManager will, at the start
of a mutating operation, write the resource into the snapshot before the
operation has begun, but with a non-empty "status". At the end of the
operation, the SnapshotManager will (depending on the outcome of the
step) remove the "status" field. The general idea here is that a
resource will have a non-empty "status" field if there is a resource
operation currently in-flight.

The precise semantics here are different for each kind of step:

* `CreateStep` - SnapshotManager inserts a new node into the snapshot
containing the inputs of the resource being created. This node has
status "creating". If the step succeeds, the "status" field is cleared.
If the step fails, the entire resource is removed from the snapshot.

* `UpdateStep` - SnapshotManager inserts a new node into the snapshot
containing the inputs of the resource being updated. This node has
status "updating". If the step succeeds, the "status" field is cleared
on the new resource and the old resource is removed from the snapshot.
If the tep fails, the entire new resource is removed from the snapshot.

* `ReadStep` - SnapshotManager inserts a new node into the snapshot
containing the search inputs to `read`. This node has status "reading".
If the step succeeds, the existing resource being read over is removed
(if one exists) and the new resource's "status" field is cleared. If the
step fails, the entire new resource is removed from the snapshot.

* `DeleteStep` - SnapshotManager sets the "status" field of the resource
being deleted to "deleting". If the step suceeds, the resource is
removed from the snapshot. If the step fails, the resource's "status"
field is cleared.

As part of this commit, the engine will reject any snapshot that has a
resource within it with the "status" field set. Running "pulumi stack
import" on a stack with invalid resources in it will remove those
resources from the snapshot.
2018-08-08 15:53:24 -07:00
..
archive.go Add license headers 2018-05-22 15:02:47 -07:00
cancel.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
config.go Detect secret-like config (#1689) 2018-08-02 04:14:16 -07:00
config_test.go Support TypeScript in a more first-class way 2018-08-06 14:00:58 -07:00
destroy.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
gen_bash_completion.go Add license headers 2018-05-22 15:02:47 -07:00
gen_markdown.go Add license headers 2018-05-22 15:02:47 -07:00
login.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
logout.go Add license headers 2018-05-22 15:02:47 -07:00
logs.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
logs_test.go Add license headers 2018-05-22 15:02:47 -07:00
new.go Support TypeScript in a more first-class way 2018-08-06 14:00:58 -07:00
plugin.go Implement first-class providers. (#1695) 2018-08-06 17:50:29 -07:00
plugin_install.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
plugin_ls.go Add license headers 2018-05-22 15:02:47 -07:00
plugin_rm.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
preview.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
pulumi.go Prefer "up" over "update" (#1672) 2018-07-31 10:22:16 -07:00
refresh.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_export.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_graph.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_import.go Add per-resource states 2018-08-08 15:53:24 -07:00
stack_init.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_ls.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_output.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_output_test.go Add license headers 2018-05-22 15:02:47 -07:00
stack_rm.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
stack_select.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00
up.go Prefer "up" over "update" (#1672) 2018-07-31 10:22:16 -07:00
util.go Add a few more CI env vars (#1738) 2018-08-08 14:12:47 -07:00
version.go Add license headers 2018-05-22 15:02:47 -07:00
whoami.go Support the NO_COLOR env variable to suppres any colored output. (#1594) 2018-07-06 21:30:00 -07:00