Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1beta1 Ingress is missing from typesUnion.dhall #168

Open
K0Te opened this issue Jun 14, 2021 · 1 comment
Open

v1beta1 Ingress is missing from typesUnion.dhall #168

K0Te opened this issue Jun 14, 2021 · 1 comment

Comments

@K0Te
Copy link

K0Te commented Jun 14, 2021

Hi,

I am trying to use the new v1beta1 Ingress API for K8, I've been able to create configuration:

let k8Ingress =
      https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/master/1.19/schemas/io.k8s.api.extensions.v1beta1.Ingress.dhall sha256:751334b2bff987943ee94b79e57a8f52f9d82db8e78d0af288df0c2c62f870db
in  k8Ingress::{
    , metadata = k8.ObjectMeta::{
...

But now I cannot use it list API, as the new one is missing from typesUnion.dhall, it only contains the old one:

| Ingress :    ./types/io.k8s.api.networking.v1.Ingress.dhall sha256:11cb1017304eefa899441f454e5f46a1dada585092b89a7c7158528d4f9f1230<br class="Apple-interchange-newline">

Please advise.

@Gabriella439
Copy link
Contributor

@K0Te: Yeah, this is because if there are multiple versions of a resource available form the API, then we only select one version for typesUnion (and also for types / schemas / defaults). In particular, we prefer the v1 version of a resource over the v1beta1 version

So if you really want the beta1 version of the resource, then there is a way to work around this if you need to use a non-default version, which is to wrap the typesUnion type in yet another sum type, like this:

let typesUnion = ...

let MyUnion = < Ingress : https://.../types/io.k8s.api.extensions.v1beta1.Ingress.dhall | Other : typesUnion >

... because dhall-to-yaml can handle nested union types (it will strip the alternative from both of them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants