looks like `getResourceProperty` doesn’t like name...
# general
d
looks like
getResourceProperty
doesn’t like namespace values that are passed as Pulumi a `Output`:
Copy code
const k8sProvider = new k8s.Provider("k8s-provider", {
  suppressDeprecationWarnings: true,
  namespace: "dev"
});
const port = mysql.getResourceProperty(
  "v1/Service",
  k8sProvider.namespace,
  name,
  "spec"
).ports[0].port;
that raises a
Cannot read property 'spec' of undefined
error, unless I change
k8sProvider.namespace
in
getResourceProperty
to a string literal - `pulumi.interpolate`/`apply()` doesn’t have an effect either
g
It looks like the problem is that the
namespace
property is not exposed on
k8s.Provider
, so you’re actually passing
undefined
into the
getResourceProperty
method. I’d recommend referencing the namespace name in both the
Provider
and
getResourceProperty
from the same variable (e.g., the Namespace object).
d
fair enough, that’s what I’ve ended up doing - it’s a shame I have to pass the same bit of info into a resource twice though