You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to write a Go SDK program that post-processes the resources produced by yamlv2.ConfigGroup. I found that the array elements aren't coercible to pulumi.Resource nor to *corev1.ConfigMap (the concrete resource type).
Example
package main
import (
corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2""github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
funcmain() {
pulumi.Run(func(ctx*pulumi.Context) error {
example, err:=yamlv2.NewConfigGroup(ctx, "example", &yamlv2.ConfigGroupArgs{
Objs: pulumi.Array{
pulumi.Map{
"apiVersion": pulumi.String("v1"),
"kind": pulumi.String("ConfigMap"),
"metadata": pulumi.Map{
"name": pulumi.String("my-map"),
},
},
},
})
iferr!=nil {
returnerr
}
_=example.Resources.Index(pulumi.Int(0)).ApplyT(func(rany) error {
res:=r.(pulumi.Resource) // <-- BUG: r is not a "pulumi.Resource"ctx.Log.Info("Hello World", &pulumi.LogArgs{Resource: res})
configMap:=r.(*corev1.ConfigMap) // <-- BUG: r is a "corev1.ConfigMap" not a "*corev1.ConfigMap"ctx.Export("configMapUid", configMap.Metadata.Uid())
returnnil
})
returnnil
})
}
Output of pulumi about
CLI
Version 3.108.1
Go Version go1.22.0
Go Compiler gc
Plugins
NAME VERSION
go unknown
kubernetes 4.10.0
Host
OS darwin
Version 13.5.1
Arch arm64
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered:
What happened?
I tried to write a Go SDK program that post-processes the resources produced by
yamlv2.ConfigGroup
. I found that the array elements aren't coercible topulumi.Resource
nor to*corev1.ConfigMap
(the concrete resource type).Example
Output of
pulumi about
Additional context
Root cause issue: pulumi/pulumi#15788
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: