-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support yaml-to-dhall #83
Comments
Hmm this indeed seems to be a bug. The upstream swagger spec marks neither of the fields as But I have a feeling this has to do with the fact that we treat the empty list Perhaps we should encode optional lists as Only annoyance is that when defining a list you always have to do Thoughts @f-f ? |
@arianvp yeah what you described is exactly the reason for the current behaviour: we used to have I'm not super keen on going back to the old behaviour, so how about adding a flag to |
I think emptiness toleration in And hopefully, there are no cases in K8s api where an empty list means something different from null :) |
I modified yaml-to-dhall to support missing lists in dhall-lang/dhall-haskell#1414 and I am happy to report that the configmap I presented can be translated to dhall 🎉 But I bumped into couple of other problems when trying to read a deployment:
Here is the smallest example which is valid deployment but ---
apiVersion: apps/v1
kind: Deployment
metadata:
name: something
spec:
replicas: 1
selector:
matchLabels:
name: something
template:
metadata:
labels:
name: something
spec:
containers:
- name: nginx
image: nginx |
This example now works too. I think only the |
Looks that that case is also handled now. I see that |
Alright, I will close the issue, then |
I tried running
yaml-to-dhall
on a configmap like this withdhall-kubernetes/types/io.k8s.api.core.v1.ConfigMap.dhall
as SCHEMA:But it failed as it didn't match the schema. The type looks like this:
My understanding is that
data
andbinaryData
both are optional fields in K8s spec, but that is not true for the dhall type. Why is this so?For context, I want to use
yaml-to-dhall
as a begining point to translate my helm chart into a sort of "dhall distribution".The text was updated successfully, but these errors were encountered: