https://pulumi.com logo
#golang
Title
# golang
b

boundless-telephone-98269

02/13/2022, 8:05 PM
Copy code
func (c *Chart) GetResource(gvk, name, namespace string) pulumi.AnyOutput {
	id := name
	if len(namespace) > 0 && namespace != "default" {
		id = fmt.Sprintf("%s/%s", namespace, name)
	}
	key := fmt.Sprintf("%s::%s", gvk, id)
	return c.Resources.ApplyT(func(x interface{}) interface{} {
		resources := x.(map[string]pulumi.Resource)
		return resources[key]
	}).(pulumi.AnyOutput)
}
3 Views