Skip to content

Commit

Permalink
Disable auto stack parenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle committed Nov 7, 2022
1 parent 72f007f commit b3b65e5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: engine
description: "Disable auto parenting to see if that fixes #10950."
1 change: 1 addition & 0 deletions pkg/engine/lifecycletest/pulumi_test.go
Expand Up @@ -4116,6 +4116,7 @@ func TestAdditionalSecretOutputs(t *testing.T) {

func TestDefaultParents(t *testing.T) {
t.Parallel()
t.Skipf("Default parents disabled due to https://github.com/pulumi/pulumi/issues/10950")

loaders := []*deploytest.ProviderLoader{
deploytest.NewProviderLoader("pkgA", semver.MustParse("1.0.0"), func() (plugin.Provider, error) {
Expand Down
21 changes: 16 additions & 5 deletions pkg/resource/deploy/step_generator.go
Expand Up @@ -140,11 +140,22 @@ func (sg *stepGenerator) checkParent(parent resource.URN, resourceType tokens.Ty
}
} else {
// Else try and set it to the root stack
for urn := range sg.urns {
if urn.Type() == resource.RootStackType {
return urn, nil
}
}

// TODO: It looks like this currently has some issues with state ordering (see
// https://github.com/pulumi/pulumi/issues/10950). Best I can guess is the stack resource is
// hitting the step generator and so saving it's URN to sg.urns and issuing a Create step but not
// actually getting to writing it's state to the snapshot. Then in parallel with this something
// else is causing a pulumi:providers:pulumi default provider to be created, this picks up the
// stack URN from sg.urns and so sets it's parent automatically, but then races the step executor
// to write itself to state before the stack resource manages to. Long term we want to ensure
// there's always a stack resource present, and so that all resources (except the stack) have a
// parent (this will save us some work in each SDK), but for now lets just turn this support off.

//for urn := range sg.urns {
// if urn.Type() == resource.RootStackType {
// return urn, nil
// }
//}
}
}

Expand Down

0 comments on commit b3b65e5

Please sign in to comment.