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

Remove requiredness of name attribute in ObjectMeta #85

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 110 additions & 110 deletions defaults.dhall

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
None Natural
, initializers =
None ./../types/io.k8s.apimachinery.pkg.apis.meta.v1.Initializers.dhall
, name =
None Text
, namespace =
None Text
, resourceVersion =
Expand Down
4 changes: 1 addition & 3 deletions dhall-kubernetes-generator/src/Dhall/Kubernetes/Convert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ requiredFields maybeName required
-- | Some models require keys that are not in the required set,
-- but are in the docs or just work
requiredConstraints = Data.Map.fromList
[ ( ModelName "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
, Set.fromList [FieldName "name"])
]
[ ]

-- | Some models should not require some keys, and this is not
-- in the Swagger spec but just in the docs
Expand Down
8 changes: 4 additions & 4 deletions examples/deployment.dhall
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let types =
../types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed
../types.dhall sha256:14b65f1f7e1eab5409a24f524f6bd455a2fdb07bbce99190c6086a2c63349f0f

let defaults =
../defaults.dhall sha256:4450e23dc81975d111650e06c0238862944bf699537af6cbacac9c7e471dfabe
../defaults.dhall sha256:fbbb714a3c71bfaa51ec8d6a0fb85e0434b5b3d0e7f8ce77c16a2a2a2df2b0d5

let kv =
( ../Prelude.dhall).JSON.keyText
Expand All @@ -11,7 +11,7 @@ let deployment
: types.Deployment
= defaults.Deployment
// { metadata =
defaults.ObjectMeta // { name = "nginx" }
defaults.ObjectMeta // { name = Some "nginx" }
, spec =
Some
( defaults.DeploymentSpec
Expand Down Expand Up @@ -40,7 +40,7 @@ let deployment
// { metadata =
defaults.ObjectMeta
// { name =
"nginx"
Some "nginx"
, labels =
[ kv "app" "nginx" ]
}
Expand Down
8 changes: 4 additions & 4 deletions examples/deploymentSimple.dhall
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
let types =
../types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed
../types.dhall sha256:14b65f1f7e1eab5409a24f524f6bd455a2fdb07bbce99190c6086a2c63349f0f

let defaults =
../defaults.dhall sha256:4450e23dc81975d111650e06c0238862944bf699537af6cbacac9c7e471dfabe
../defaults.dhall sha256:fbbb714a3c71bfaa51ec8d6a0fb85e0434b5b3d0e7f8ce77c16a2a2a2df2b0d5

let deployment
: types.Deployment
= defaults.Deployment
// { metadata =
defaults.ObjectMeta // { name = "nginx" }
defaults.ObjectMeta // { name = Some "nginx" }
, spec =
Some
( defaults.DeploymentSpec
Expand All @@ -17,7 +17,7 @@ let deployment
, template =
defaults.PodTemplateSpec
// { metadata =
defaults.ObjectMeta // { name = "nginx" }
defaults.ObjectMeta // { name = Some "nginx" }
, spec =
Some
( defaults.PodSpec
Expand Down
6 changes: 3 additions & 3 deletions examples/ingress.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ let map = Prelude.`List`.map
let kv = Prelude.JSON.keyText

let types =
../types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed
../types.dhall sha256:14b65f1f7e1eab5409a24f524f6bd455a2fdb07bbce99190c6086a2c63349f0f

let defaults =
../defaults.dhall sha256:4450e23dc81975d111650e06c0238862944bf699537af6cbacac9c7e471dfabe
../defaults.dhall sha256:fbbb714a3c71bfaa51ec8d6a0fb85e0434b5b3d0e7f8ce77c16a2a2a2df2b0d5

let Service = { name : Text, host : Text, version : Text }

Expand Down Expand Up @@ -74,7 +74,7 @@ let mkIngress
in defaults.Ingress
// { metadata =
defaults.ObjectMeta
// { name = "nginx", annotations = annotations }
// { name = Some "nginx", annotations = annotations }
, spec =
Some spec
}
Expand Down
6 changes: 3 additions & 3 deletions examples/service.dhall
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let types =
../types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed
../types.dhall sha256:14b65f1f7e1eab5409a24f524f6bd455a2fdb07bbce99190c6086a2c63349f0f

let defaults =
../defaults.dhall sha256:4450e23dc81975d111650e06c0238862944bf699537af6cbacac9c7e471dfabe
../defaults.dhall sha256:fbbb714a3c71bfaa51ec8d6a0fb85e0434b5b3d0e7f8ce77c16a2a2a2df2b0d5

let kv = (../Prelude.dhall).JSON.keyText

Expand All @@ -22,7 +22,7 @@ let service
= defaults.Service
// { metadata =
defaults.ObjectMeta
// { name = "nginx", labels = [ kv "app" "nginx" ] }
// { name = Some "nginx", labels = [ kv "app" "nginx" ] }
, spec =
Some (defaults.ServiceSpec // spec)
}
Expand Down
Loading