Round out V2 breaking changes for Resource
@@ -127,17 +127,26 @@ type ResourceV1 struct {
InitErrors []string `json:"initErrors" yaml:"initErrors,omitempty"`
}
-// ResourceV2 is the second version of the Resource API type. It absorbs two breaking changes:
+// ResourceV2 is the second version of the Resource API type. It absorbs a few breaking changes:
// 1. The deprecated `Defaults` field is removed because it is not used anywhere,
// 2. It adds an additional bool field, "External", which reflects whether or not this resource
// exists because of a call to `ReadResource`. This is motivated by a need to store
// resources that Pulumi does not own in the deployment.
+// 3. It adds an additional string field, "Status" that indicates whether or not the engine is
+// aware that the last operation that targeted that resource completed successfully. If the engine
+// crashes or is otherwise terminated while a resource operation is in-flight, resources may be
+// left with this field set to a non-empty value.
+// 4. It adds an additional string field, "Provider", that is a reference to a first-class provider
+// associated with this resource.
//
// Migrating from ResourceV1 to ResourceV2 involves:
// 1. Dropping the `Defaults` field (it should be empty anyway)
// 2. Setting the `External` field to "false", since a ResourceV1 existing for a resource
// implies that it is owned by Pulumi. Note that since this is the default value for
// booleans in Go, no explicit assignment needs to be made.
+// 3. Setting the "Status" field to the empty string, since a resource's presence in a V1 deployment
+// implies that it has been operated upon successfully.
+// 4. Setting the "Provider" field to the empty string, because V1 deployments don't have first-class providers.
type ResourceV2 struct {
// URN uniquely identifying this resource.
URN resource.URN `json:"urn" yaml:"urn"`
@@ -164,6 +173,12 @@ type ResourceV2 struct {
// InitErrors is the set of errors encountered in the process of initializing resource (i.e.,
// during create or update).
InitErrors []string `json:"initErrors" yaml:"initErrors,omitempty"`
+ // Status is an indicator of whether or not this resource is in a "dirty" (known) state. If
+ // set and not the empty string, this resource refers to an operation that was in-flight but whose
+ // completion status is not known.
+ Status string `json:"status,omitempty" yaml:"status,omitempty"`
+ // Provider is a reference to the provider that is associated with this resource.
+ Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
}
// ManifestV1 captures meta-information about this checkpoint file, such as versions of binaries, etc.
