I added a `livenessProbe` to my `Deployment` and t...
# general
f
I added a
livenessProbe
to my
Deployment
and then removed it and received this exception:
Copy code
TSError: ⨯ Unable to compile TypeScript:
    src/index.ts(418,21): error TS2345: Argument of type '{ metadata: { namespace: Output<string>; name: string; labels: { "<http://app.kubernetes.io/name|app.kubernetes.io/name>": string; "<http://app.kubernetes.io/instance|app.kubernetes.io/instance>": string; "<http://app.kubernetes.io/version|app.kubernetes.io/version>": string; }; }; spec: { selector: { ...; }; replicas: number; template: { ...; }; }; }' is not assignable to parameter of type 'Deployment'.
      Types of property 'spec' are incompatible.
        Types of property 'template' are incompatible.
          Types of property 'spec' are incompatible.
            Type '{ replicas: number; containers: { name: string; image: string; env: ({ name: string; value: Output<string>; } | { name: string; value: string; } | { name: string; valueFrom: { fieldRef: { fieldPath: string; }; }; })[]; resources: { ...; }; }[]; }' is not assignable to type 'PodSpec | Promise<PodSpec> | OutputInstance<PodSpec> | undefined'.
              Object literal may only specify known properties, and 'replicas' does not exist in type 'Input<PodSpec>'.
    
        at createTSError (/home/kenny/compute_software/infrastructure/pulumi-k8s-src/node_modules/ts-node/src/index.ts:261:12)
        at getOutput (/home/kenny/compute_software/infrastructure/pulumi-k8s-src/node_modules/ts-node/src/index.ts:367:40)
        at Object.compile (/home/kenny/compute_software/infrastructure/pulumi-k8s-src/node_modules/ts-node/src/index.ts:558:11)
        at Module.m._compile (/home/kenny/compute_software/infrastructure/pulumi-k8s-src/node_modules/ts-node/src/index.ts:439:43)
        at Module._extensions..js (module.js:664:10)
        at Object.require.extensions.(anonymous function) [as .ts] (/home/kenny/compute_software/infrastructure/pulumi-k8s-src/node_modules/ts-node/src/index.ts:442:12)
        at Module.load (module.js:566:32)
        at tryModuleLoad (module.js:506:12)
        at Function.Module._load (module.js:498:3)
        at Module.require (module.js:597:17)
It is not clear what this means. Is this expected?
So, I had a
replicas
property on my Deployment
spec
and the
template.spec
. It's odd that
pulumi up
has worked until I changed the
livenessProbe
property on a different Deployment.
c
I mean, it’s telling you that your deployment does not actually satisfy the schema.
replicas
does not go in the pod spec, right?
Pulumi is just faithfully reporting the error.
f
It’s just weird that the deployment was working with no errors until the livenessProbe change.
c
i don’t know about that, but the error here seems to tell you what to fix?
did it work?
f
Yes. The concerning part was that I did not receive that message until other, unrelated changes occurred.
c
¯\_(ツ)_/¯
was something in the liveness probe a computed value?
mmm that wouldn’t do it either.
f
Given it's a TSError, I would've thought it would always fail.
c
this is a TS error
I have no idea, but the TS compiler does a lot of guessing.
It’s more like a heuristic engine than a safe type checker.
f
I also know that I had several successful deploys with
initialDelaySeconds
set in
readinessProbe.httpGet
instead of just
readinessProbe
.