Hi folks, how can I depend on a spec field of a cu...
# kubernetes
e
Hi folks, how can I depend on a spec field of a custom resource?
Copy code
export const cert = new k8s.apiextensions.CustomResource(
  "cert",
  {
    apiVersion: "<http://cert-manager.io/v1|cert-manager.io/v1>",
    kind: "Certificate",
    spec: {
      secretName: "foo-bar",
      dnsNames: ["example.default.svc.cluster.local"],
      issuerRef: { .. },
    },
  }
)
I need to get
secretName
to reference in a subsequent deployment. My workaround is to make
const certSecretName = "foo-bar"
then reference it in both places and add a dependsOn, but that's not great. Thanks!
d
You should be able to do
cert.spec.secretName
e
I get
Property 'spec' does not exist on type 'CustomResource'.ts(2339)
d
Oh, this is odd. It looks like the sdk isn't generating properly for node, as
spec
is missing
So, I think it's just a type error; at runtime it should still be accessible
e
sounds like a bug then
I'm using typescript, I can't really ignore errors (easily)
d
Yeah, you'd need to do
(cert as any).spec
e
ah will try thank you
I'll also file a bug
d
Thanks