* Delete Before Create This commit implements the full semantics of delete before create. If a resource is replaced and requires deletion before creation, the engine will use the dependency graph saved in the snapshot to delete all resources that depend on the resource being replaced prior to the deletion of the resource to be replaced. * Rebase against master * CR: Simplify the control flow in makeRegisterResourceSteps * Run Check on new inputs when re-creating a resource * Fix an issue where the planner emitted benign but incorrect deletes of DBR-deleted resources * CR: produce the list of dependent resources in dependency order and iterate over the list in reverse * CR: deps->dependents, fix an issue with DependingOn where duplicate nodes could be added to the dependent set * CR: Fix an issue where we were considering old defaults and new inputs inappropriately when re-creating a deleted resource * CR: save 'iter.deletes[urn]' as a local, iterate starting at cursorIndex + 1 for dependency graph
25 lines
629 B
Go
25 lines
629 B
Go
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
|
|
|
|
package ints
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/pulumi/pulumi/pkg/testing/integration"
|
|
)
|
|
|
|
// Test that the engine does not consider old inputs when calling Check during re-creation of
|
|
// a resource that was deleted due to a dependency on a DBR-replaced resource.
|
|
func TestResourceRecreateCheck(t *testing.T) {
|
|
integration.ProgramTest(t, &integration.ProgramTestOptions{
|
|
Dir: "step1",
|
|
Dependencies: []string{"@pulumi/pulumi"},
|
|
Quick: true,
|
|
EditDirs: []integration.EditDir{
|
|
{
|
|
Dir: "step2",
|
|
Additive: true,
|
|
},
|
|
},
|
|
})
|
|
}
|