Missing record field: IngressServiceBackend

3/19/2021

I'm getting a strange error message which I don't understand when trying to use Dhall for Kubernetes. Here is my configuration:

let k8s = ./k8s.dhall

let utils = ./utils.dhall

let Env = utils.Env

in  \(env : Env) ->
      k8s.Ingress::{
      , metadata = k8s.ObjectMeta::{
        , name = Some "my-ingress"
        , annotations = Some
          [ { mapKey = "kubernetes.io/ingress.global-static-ip-name"
            , mapValue = "my-ip"
            }
          ]
        }
      , spec = Some k8s.IngressSpec::{
        , defaultBackend = Some k8s.IngressBackend::{
          , service = Some k8s.IngressServiceBackend::{
            , name = "my-nginx"
            , port = Some k8s.ServiceBackendPort::{ number = Some 71742 }
            }
          }
        }
      }

And here is the error message:

↳ ./ingress.dhall

Error: Missing record field: IngressServiceBackend

19│                            k8s.IngressServiceBackend

/Users/damd/Code/proj/ingress.dhall:19:28

23│                    ./ingress.dhall

./proj.dhall:23:20

So it would seem to me that it doesn't find IngressServiceBackend in k8s? However, k8s is defined as https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/master/1.19/package.dhall and when I browse that URL manually, I can see that it's in there.

Any ideas?

-- damd
dhall
kubernetes

1 Answer

3/19/2021

Clearing my Dhall cache seems to have resolved the issue. Not sure what happened.

$ rm -rf ~/.cache/dhall*

Hope this helps someone else.

-- damd
Source: StackOverflow