enough-truck-34175
04/26/2021, 5:59 PMfunc NewAKSComponent(ctx *pulumi.Context, name string, params Parameters, opts ...pulumi.ResourceOption) (*Component, error) {
aksComponent := &Component{}
err := ctx.RegisterComponentResource("r1-compute-infra:k8scp:AKSComponent", name, aksComponent, opts...)
I got this error
--- FAIL: TestAKSComponent (0.00s)
/workspaces/r1-compute-infra/pkg/aks/index_test.go:26:
Error Trace: index_test.go:26
run.go:103
run.go:84
index_test.go:24
Error: Received unexpected error:
resource name argument (for URN creation) cannot be empty
RegisterComponentResource failed
<http://github.com/relativityone/r1-compute-infra/pkg/aks.NewAKSComponent|github.com/relativityone/r1-compute-infra/pkg/aks.NewAKSComponent>
/workspaces/r1-compute-infra/pkg/aks/index.go:48
<http://github.com/relativityone/r1-compute-infra/pkg/aks.TestAKSComponent.func1|github.com/relativityone/r1-compute-infra/pkg/aks.TestAKSComponent.func1>
/workspaces/r1-compute-infra/pkg/aks/index_test.go:25
<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi.RunWithContext|github.com/pulumi/pulumi/sdk/v3/go/pulumi.RunWithContext>
/home/vscode/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.1.0/go/pulumi/run.go:103
<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi.RunErr|github.com/pulumi/pulumi/sdk/v3/go/pulumi.RunErr>
/home/vscode/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.1.0/go/pulumi/run.go:84
<http://github.com/relativityone/r1-compute-infra/pkg/aks.TestAKSComponent|github.com/relativityone/r1-compute-infra/pkg/aks.TestAKSComponent>
/workspaces/r1-compute-infra/pkg/aks/index_test.go:24
testing.tRunner
/usr/local/go/src/testing/testing.go:1194
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1371
Test: TestAKSComponent
Is there a process in place for testing resource components or is the way I’ve setup my code not the intended strategy? Currently, I’m calling NewAKSComponent
to the AKS cluster and its azure resource group.
Thanks!pulumi.Parent(aksComponent)
will be passed in as a variadic argument. Yay TDD!