You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm relatively new to Dhall & to this project (thanks for creating it!). I (and I'm sure many others) have existing configs in YAML/JSON/whatever, that I want to switch to being generated by Dhall. I've found @Gabriella439's awesome slide on how that can be done, which uses dhall-kubernetes in the example.
I've managed to put together just enough locally to convert my collection of prometheus-operator PrometheusRule custom resource YAML files to Dhall. I've put the steps that I used at the end below.
I think it would be useful to have that schemas.dhall that I generated be a part of this project, and I've created #26 to get it included if you think it would be useful. There are some things that I'm not 100% sure about though, hence this issue rather than just creating the pull request alone:
Would it be useful to structure this project more closely to how the dhall-kubernetes project is structured? E.g. have types/defaults/schemas separated? dhall-kubernetes mentions this dhall-prometheus-operator as the only entry in the "Projects using dhall-kubernetes" section of its README.md; I wonder if there would be benefit if this and any future dhall-*-operator libraries to be layed out in a similar form?
Some of the types here are not in schema form ({ Type: Type, default: {}}). Should we look to have those in the same form too? I haven't looked into what would be involved there.
WDYT? If you think either or both of those would be worthwhile, I can try to find some time to look into them.
Converting a PrometheusRule YAML file to Dhall
Use yaml-to-dhall to generate the corresponding Dhall:
Make a schemas.dhall file for this project, to be able to use with dhall rewrite-with-schemas to clean up the Dhall that was generated in step 1 above.
Rewrite the Dhall with schemas, using a schemas record of a merge of the dhall-kubernetes schemas (pretty much just for ObjectMeta) with the schemas.dhall, using // because of a collision that I don't care about (Error: Field collision on: Probe.Type):
replace the schemas import with separate imports for dhall-kubernetes and dhall-prometheus-operator
replace instances of < Int : Integer | String : Text > with Kubernetes.IntOrString (there is no "schema" for this union, so it doesn't get automatically done)
The text was updated successfully, but these errors were encountered:
I'm relatively new to Dhall & to this project (thanks for creating it!). I (and I'm sure many others) have existing configs in YAML/JSON/whatever, that I want to switch to being generated by Dhall. I've found @Gabriella439's awesome slide on how that can be done, which uses dhall-kubernetes in the example.
I've managed to put together just enough locally to convert my collection of prometheus-operator
PrometheusRule
custom resource YAML files to Dhall. I've put the steps that I used at the end below.I think it would be useful to have that
schemas.dhall
that I generated be a part of this project, and I've created #26 to get it included if you think it would be useful. There are some things that I'm not 100% sure about though, hence this issue rather than just creating the pull request alone:dhall-kubernetes
project is structured? E.g. have types/defaults/schemas separated?dhall-kubernetes
mentions thisdhall-prometheus-operator
as the only entry in the "Projects usingdhall-kubernetes
" section of its README.md; I wonder if there would be benefit if this and any futuredhall-*-operator
libraries to be layed out in a similar form?{ Type: Type, default: {}}
). Should we look to have those in the same form too? I haven't looked into what would be involved there.WDYT? If you think either or both of those would be worthwhile, I can try to find some time to look into them.
Converting a PrometheusRule YAML file to Dhall
yaml-to-dhall
to generate the corresponding Dhall:Make a schemas.dhall file for this project, to be able to use with
dhall rewrite-with-schemas
to clean up the Dhall that was generated in step 1 above.Rewrite the Dhall with schemas, using a schemas record of a merge of the
dhall-kubernetes
schemas (pretty much just for ObjectMeta) with theschemas.dhall
, using//
because of a collision that I don't care about (Error: Field collision on: Probe.Type
):dhall-kubernetes
anddhall-prometheus-operator
< Int : Integer | String : Text >
withKubernetes.IntOrString
(there is no "schema" for this union, so it doesn't get automatically done)The text was updated successfully, but these errors were encountered: