rhythmic-finland-36256
10/09/2019, 5:55 PMComponentResource
with shared ComponentResourceOptions
passed down to the child resources seems to mutate the options - which leads to confusing error messages of duplicate resource aliases. Do I need to construct a new options object for each child resource?ComponentResource
, constructing the options in the ComponentResource constructor and passing the same instance to all children. Doing so resulted in an error of duplicate aliases for several URNs. When constructing them for each this doesn’t happen.error: Duplicate resource alias 'urn:pulumi:dev::xxxxx::ajaegle:xxxxx:fullservicedeployment$kubernetes:apps/v1:Deployment::whoami' applied to resource with URN 'urn:pulumi:dev::xxxxx::ajaegle:xxxxx:fullservicedeployment$kubernetes:apps/v1:Deployment::processor-deploy' conflicting with resource with URN 'urn:pulumi:dev::xxxxx::ajaegle:xxxxx:fullservicedeployment$kubernetes:core/v1:Service::processor-svc'
ComponentResourceOptions
(using deconstruction) in the ComponentResource
constructor and passing it as third argument like this.k8sResourceOpts
. Works when using {parent: this, provider: this.args.k8sProvider}
. Is there some mutation on the object? I’m using kubernetes deployments and services as child resources.white-balloon-205
rhythmic-finland-36256
10/10/2019, 9:44 AMpulumi up
and applying the changes: panic: fatal: An assertion has failed: Two resources ('urn:pulumi:dev::pulumi-component-resource-mutability-issue::ajaegle:componentres:mutabilityissue$kubernetes:apps/v1:Deployment::whoami-one' and 'urn:pulumi:dev::pulumi-component-resource-mutability-issue::ajaegle:componentres:mutabilityissue$kubernetes:core/v1:Service::whoami') aliased to the same: 'urn:pulumi:dev::pulumi-component-resource-mutability-issue::ajaegle:componentres:mutabilityissue$kubernetes:apps/v1:Deployment::whoami-one'
goroutine 297 [running]:
<http://github.com/pulumi/pulumi/pkg/util/contract.failfast(...)|github.com/pulumi/pulumi/pkg/util/contract.failfast(...)>
/private/tmp/pulumi-20191001-29115-1u0fjxm/src/github.com/pulumi/pulumi/pkg/util/contract/failfast.go:23
<http://github.com/pulumi/pulumi/pkg/util/contract.Assertf(0xc001162200|github.com/pulumi/pulumi/pkg/util/contract.Assertf(0xc001162200>, 0x22f3765, 0x37, 0xc00174bce0, 0x3, 0x3)
/private/tmp/pulumi-20191001-29115-1u0fjxm/src/github.com/pulumi/pulumi/pkg/util/contract/assert.go:33 +0x198
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*Snapshot).NormalizeURNReferences(0xc00109e240)|github.com/pulumi/pulumi/pkg/resource/deploy.(*Snapshot).NormalizeURNReferences(0xc00109e240)>
/private/tmp/pulumi-20191001-29115-1u0fjxm/src/github.com/pulumi/pulumi/pkg/resource/deploy/snapshot.go:112 +0x6cb
<http://github.com/pulumi/pulumi/pkg/backend.(*SnapshotManager).saveSnapshot(0xc001134480|github.com/pulumi/pulumi/pkg/backend.(*SnapshotManager).saveSnapshot(0xc001134480>, 0xc00174bf30, 0x2)
/private/tmp/pulumi-20191001-29115-1u0fjxm/src/github.com/pulumi/pulumi/pkg/backend/snapshot.go:565 +0x42
<http://github.com/pulumi/pulumi/pkg/backend.NewSnapshotManager.func1(0xc0010843c0|github.com/pulumi/pulumi/pkg/backend.NewSnapshotManager.func1(0xc0010843c0>, 0xc001134480, 0xc001084420, 0xc001084480)
/private/tmp/pulumi-20191001-29115-1u0fjxm/src/github.com/pulumi/pulumi/pkg/backend/snapshot.go:608 +0x12e
created by <http://github.com/pulumi/pulumi/pkg/backend.NewSnapshotManager|github.com/pulumi/pulumi/pkg/backend.NewSnapshotManager>
/private/tmp/pulumi-20191001-29115-1u0fjxm/src/github.com/pulumi/pulumi/pkg/backend/snapshot.go:597 +0x150