Update to dhall lang v17
This change updates the dhall code to the latest version. * Support for record pun where `{ x = x }` can now be written as `{ x }` * Indentation and function definitions are more compact This change has been generated after installing dhall v1.33 using this command: find . -name "*.dhall" -exec dhall --ascii format --inplace {} \; Change-Id: I3b6560f26e28622aa51150dc8083d127d89a8a7b
This commit is contained in:
parent
0fbffe66f2
commit
06b4062e4b
@ -1,10 +1,10 @@
|
|||||||
FROM quay.io/operator-framework/ansible-operator:v0.13.0
|
FROM quay.io/operator-framework/ansible-operator:v0.13.0
|
||||||
|
|
||||||
# dhall versions and digests
|
# dhall versions and digests
|
||||||
ARG DHALL_VERSION=1.30.0
|
ARG DHALL_VERSION=1.33.1
|
||||||
ARG DHALL_JSON_VERSION=1.6.2
|
ARG DHALL_JSON_VERSION=1.7.0
|
||||||
ARG DHALL_JSON_DIGEST=ea37627c4e19789af33def099d4cb145b874c03b4d5b98cb33ce06be1debf4f3
|
ARG DHALL_JSON_DIGEST=cc9fc70e492d35a3986183b589a435653e782f67cda51d33a935dff1ddd15aec
|
||||||
ARG DHALL_LANG_REF=v14.0.0
|
ARG DHALL_LANG_REF=v17.0.0
|
||||||
ARG DHALL_KUBE_REF=v4.0.0
|
ARG DHALL_KUBE_REF=v4.0.0
|
||||||
|
|
||||||
# kubectl versions and digests
|
# kubectl versions and digests
|
||||||
|
@ -56,9 +56,4 @@ let Union =
|
|||||||
| Certificate : Certificate.Type
|
| Certificate : Certificate.Type
|
||||||
>
|
>
|
||||||
|
|
||||||
in { IssuerSpec = IssuerSpec
|
in { IssuerSpec, Issuer, CertificateSpec, Certificate, Union }
|
||||||
, Issuer = Issuer
|
|
||||||
, CertificateSpec = CertificateSpec
|
|
||||||
, Certificate = Certificate
|
|
||||||
, Union = Union
|
|
||||||
}
|
|
||||||
|
@ -24,5 +24,5 @@
|
|||||||
* https://github.com/dhall-lang/dhall-nethack/blob/master/Prelude.dhall
|
* https://github.com/dhall-lang/dhall-nethack/blob/master/Prelude.dhall
|
||||||
-}
|
-}
|
||||||
env:DHALL_PRELUDE
|
env:DHALL_PRELUDE
|
||||||
? https://prelude.dhall-lang.org/v13.0.0/package.dhall sha256:4aa8581954f7734d09b7b21fddbf5d8df901a44b54b4ef26ea71db92de0b1a12
|
? https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
|
||||||
? https://prelude.dhall-lang.org/v13.0.0/package.dhall
|
? https://prelude.dhall-lang.org/v17.0.0/package.dhall
|
||||||
|
@ -4,11 +4,11 @@ let F = ../functions.dhall
|
|||||||
|
|
||||||
let db-volumes = [ F.Volume::{ name = "pg-data", dir = "/var/lib/pg/" } ]
|
let db-volumes = [ F.Volume::{ name = "pg-data", dir = "/var/lib/pg/" } ]
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \ ( db-internal-password-env
|
\ ( db-internal-password-env
|
||||||
: forall (env-name : Text) -> List Kubernetes.EnvVar.Type
|
: forall (env-name : Text) -> List Kubernetes.EnvVar.Type
|
||||||
)
|
) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "db" "pg" 5432)
|
, Service = Some (F.mkService app-name "db" "pg" 5432)
|
||||||
, StatefulSet = Some
|
, StatefulSet = Some
|
||||||
( F.mkStatefulSet
|
( F.mkStatefulSet
|
||||||
|
@ -6,13 +6,13 @@ let InputExecutor = (../input.dhall).Executor.Type
|
|||||||
|
|
||||||
let JobVolume = (../input.dhall).JobVolume.Type
|
let JobVolume = (../input.dhall).JobVolume.Type
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(input-executor : InputExecutor)
|
\(input-executor : InputExecutor) ->
|
||||||
-> \(data-dir : List F.Volume.Type)
|
\(data-dir : List F.Volume.Type) ->
|
||||||
-> \(volumes : List F.Volume.Type)
|
\(volumes : List F.Volume.Type) ->
|
||||||
-> \(env : List Kubernetes.EnvVar.Type)
|
\(env : List Kubernetes.EnvVar.Type) ->
|
||||||
-> \(jobVolumes : Optional (List JobVolume))
|
\(jobVolumes : Optional (List JobVolume)) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "executor" "finger" 7900)
|
, Service = Some (F.mkService app-name "executor" "finger" 7900)
|
||||||
, StatefulSet = Some
|
, StatefulSet = Some
|
||||||
( F.mkStatefulSet
|
( F.mkStatefulSet
|
||||||
@ -20,8 +20,8 @@ in \(app-name : Text)
|
|||||||
F.Component::{
|
F.Component::{
|
||||||
, name = "executor"
|
, name = "executor"
|
||||||
, count = 1
|
, count = 1
|
||||||
, data-dir = data-dir
|
, data-dir
|
||||||
, volumes = volumes
|
, volumes
|
||||||
, extra-volumes =
|
, extra-volumes =
|
||||||
let job-volumes =
|
let job-volumes =
|
||||||
F.mkJobVolume
|
F.mkJobVolume
|
||||||
@ -47,8 +47,8 @@ in \(app-name : Text)
|
|||||||
let job-volumes-mount =
|
let job-volumes-mount =
|
||||||
F.mkJobVolume
|
F.mkJobVolume
|
||||||
F.Volume.Type
|
F.Volume.Type
|
||||||
( \(job-volume : JobVolume)
|
( \(job-volume : JobVolume) ->
|
||||||
-> F.Volume::{
|
F.Volume::{
|
||||||
, name = job-volume.volume.name
|
, name = job-volume.volume.name
|
||||||
, dir = job-volume.dir
|
, dir = job-volume.dir
|
||||||
}
|
}
|
||||||
|
@ -4,20 +4,20 @@ let F = ../functions.dhall
|
|||||||
|
|
||||||
let InputMerger = (../input.dhall).Merger.Type
|
let InputMerger = (../input.dhall).Merger.Type
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(input-merger : InputMerger)
|
\(input-merger : InputMerger) ->
|
||||||
-> \(data-dir : List F.Volume.Type)
|
\(data-dir : List F.Volume.Type) ->
|
||||||
-> \(volumes : List F.Volume.Type)
|
\(volumes : List F.Volume.Type) ->
|
||||||
-> \(env : List Kubernetes.EnvVar.Type)
|
\(env : List Kubernetes.EnvVar.Type) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Deployment = Some
|
, Deployment = Some
|
||||||
( F.mkDeployment
|
( F.mkDeployment
|
||||||
app-name
|
app-name
|
||||||
F.Component::{
|
F.Component::{
|
||||||
, name = "merger"
|
, name = "merger"
|
||||||
, count = 1
|
, count = 1
|
||||||
, data-dir = data-dir
|
, data-dir
|
||||||
, volumes = volumes
|
, volumes
|
||||||
, container = Kubernetes.Container::{
|
, container = Kubernetes.Container::{
|
||||||
, name = "merger"
|
, name = "merger"
|
||||||
, image = input-merger.image
|
, image = input-merger.image
|
||||||
|
@ -4,10 +4,10 @@ let F = ../functions.dhall
|
|||||||
|
|
||||||
let InputPreview = (../input.dhall).Preview.Type
|
let InputPreview = (../input.dhall).Preview.Type
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(input-preview : InputPreview)
|
\(input-preview : InputPreview) ->
|
||||||
-> \(data-dir : List F.Volume.Type)
|
\(data-dir : List F.Volume.Type) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "preview" "preview" 80)
|
, Service = Some (F.mkService app-name "preview" "preview" 80)
|
||||||
, Deployment = Some
|
, Deployment = Some
|
||||||
( F.mkDeployment
|
( F.mkDeployment
|
||||||
@ -15,7 +15,7 @@ in \(app-name : Text)
|
|||||||
F.Component::{
|
F.Component::{
|
||||||
, name = "preview"
|
, name = "preview"
|
||||||
, count = F.defaultNat input-preview.count 0
|
, count = F.defaultNat input-preview.count 0
|
||||||
, data-dir = data-dir
|
, data-dir
|
||||||
, container = Kubernetes.Container::{
|
, container = Kubernetes.Container::{
|
||||||
, name = "preview"
|
, name = "preview"
|
||||||
, image = input-preview.image
|
, image = input-preview.image
|
||||||
|
@ -7,33 +7,33 @@ let F = ../functions.dhall
|
|||||||
let InputRegistry = (../input.dhall).Registry.Type
|
let InputRegistry = (../input.dhall).Registry.Type
|
||||||
|
|
||||||
let registry-volumes =
|
let registry-volumes =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> [ F.Volume::{
|
[ F.Volume::{
|
||||||
, name = app-name ++ "-registry-tls"
|
, name = app-name ++ "-registry-tls"
|
||||||
, dir = "/etc/zuul-registry"
|
, dir = "/etc/zuul-registry"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
let registry-env =
|
let registry-env =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> F.mkEnvVarSecret
|
F.mkEnvVarSecret
|
||||||
( Prelude.List.map
|
( Prelude.List.map
|
||||||
Text
|
Text
|
||||||
F.EnvSecret
|
F.EnvSecret
|
||||||
( \(key : Text)
|
( \(key : Text) ->
|
||||||
-> { name = "ZUUL_REGISTRY_${key}"
|
{ name = "ZUUL_REGISTRY_${key}"
|
||||||
, key = key
|
, key
|
||||||
, secret = "${app-name}-registry-user-rw"
|
, secret = "${app-name}-registry-user-rw"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
[ "secret", "username", "password" ]
|
[ "secret", "username", "password" ]
|
||||||
)
|
)
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(input-registry : InputRegistry)
|
\(input-registry : InputRegistry) ->
|
||||||
-> \(data-dir : List F.Volume.Type)
|
\(data-dir : List F.Volume.Type) ->
|
||||||
-> \(volumes : List F.Volume.Type)
|
\(volumes : List F.Volume.Type) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "registry" "registry" 9000)
|
, Service = Some (F.mkService app-name "registry" "registry" 9000)
|
||||||
, StatefulSet = Some
|
, StatefulSet = Some
|
||||||
( F.mkStatefulSet
|
( F.mkStatefulSet
|
||||||
@ -41,18 +41,14 @@ in \(app-name : Text)
|
|||||||
F.Component::{
|
F.Component::{
|
||||||
, name = "registry"
|
, name = "registry"
|
||||||
, count = F.defaultNat input-registry.count 0
|
, count = F.defaultNat input-registry.count 0
|
||||||
, data-dir = data-dir
|
, data-dir
|
||||||
, volumes = volumes # registry-volumes app-name
|
, volumes = volumes # registry-volumes app-name
|
||||||
, claim-size = F.defaultNat input-registry.storage-size 20
|
, claim-size = F.defaultNat input-registry.storage-size 20
|
||||||
, container = Kubernetes.Container::{
|
, container = Kubernetes.Container::{
|
||||||
, name = "registry"
|
, name = "registry"
|
||||||
, image = input-registry.image
|
, image = input-registry.image
|
||||||
, args = Some
|
, args = Some
|
||||||
[ "zuul-registry"
|
[ "zuul-registry", "-c", "/etc/zuul/registry.yaml", "serve" ]
|
||||||
, "-c"
|
|
||||||
, "/etc/zuul/registry.yaml"
|
|
||||||
, "serve"
|
|
||||||
]
|
|
||||||
, imagePullPolicy = Some "IfNotPresent"
|
, imagePullPolicy = Some "IfNotPresent"
|
||||||
, ports = Some
|
, ports = Some
|
||||||
[ Kubernetes.ContainerPort::{
|
[ Kubernetes.ContainerPort::{
|
||||||
|
@ -4,12 +4,12 @@ let F = ../functions.dhall
|
|||||||
|
|
||||||
let InputScheduler = (../input.dhall).Scheduler.Type
|
let InputScheduler = (../input.dhall).Scheduler.Type
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(input-scheduler : InputScheduler)
|
\(input-scheduler : InputScheduler) ->
|
||||||
-> \(data-dir : List F.Volume.Type)
|
\(data-dir : List F.Volume.Type) ->
|
||||||
-> \(volumes : List F.Volume.Type)
|
\(volumes : List F.Volume.Type) ->
|
||||||
-> \(env : List Kubernetes.EnvVar.Type)
|
\(env : List Kubernetes.EnvVar.Type) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "scheduler" "gearman" 4730)
|
, Service = Some (F.mkService app-name "scheduler" "gearman" 4730)
|
||||||
, StatefulSet = Some
|
, StatefulSet = Some
|
||||||
( F.mkStatefulSet
|
( F.mkStatefulSet
|
||||||
@ -17,8 +17,8 @@ in \(app-name : Text)
|
|||||||
F.Component::{
|
F.Component::{
|
||||||
, name = "scheduler"
|
, name = "scheduler"
|
||||||
, count = 1
|
, count = 1
|
||||||
, data-dir = data-dir
|
, data-dir
|
||||||
, volumes = volumes
|
, volumes
|
||||||
, claim-size = 5
|
, claim-size = 5
|
||||||
, container = Kubernetes.Container::{
|
, container = Kubernetes.Container::{
|
||||||
, name = "scheduler"
|
, name = "scheduler"
|
||||||
|
@ -4,12 +4,12 @@ let F = ../functions.dhall
|
|||||||
|
|
||||||
let InputWeb = (../input.dhall).Web.Type
|
let InputWeb = (../input.dhall).Web.Type
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(input-web : InputWeb)
|
\(input-web : InputWeb) ->
|
||||||
-> \(data-dir : List F.Volume.Type)
|
\(data-dir : List F.Volume.Type) ->
|
||||||
-> \(volumes : List F.Volume.Type)
|
\(volumes : List F.Volume.Type) ->
|
||||||
-> \(env : List Kubernetes.EnvVar.Type)
|
\(env : List Kubernetes.EnvVar.Type) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "web" "api" 9000)
|
, Service = Some (F.mkService app-name "web" "api" 9000)
|
||||||
, Deployment = Some
|
, Deployment = Some
|
||||||
( F.mkDeployment
|
( F.mkDeployment
|
||||||
@ -17,8 +17,8 @@ in \(app-name : Text)
|
|||||||
F.Component::{
|
F.Component::{
|
||||||
, name = "web"
|
, name = "web"
|
||||||
, count = 1
|
, count = 1
|
||||||
, data-dir = data-dir
|
, data-dir
|
||||||
, volumes = volumes
|
, volumes
|
||||||
, container = Kubernetes.Container::{
|
, container = Kubernetes.Container::{
|
||||||
, name = "web"
|
, name = "web"
|
||||||
, image = input-web.image
|
, image = input-web.image
|
||||||
|
@ -10,9 +10,9 @@ let data-volumes =
|
|||||||
, F.Volume::{ name = "zk-dat", dir = "/var/lib/zookeeper/" }
|
, F.Volume::{ name = "zk-dat", dir = "/var/lib/zookeeper/" }
|
||||||
]
|
]
|
||||||
|
|
||||||
in \(app-name : Text)
|
in \(app-name : Text) ->
|
||||||
-> \(client-conf : List F.Volume.Type)
|
\(client-conf : List F.Volume.Type) ->
|
||||||
-> F.KubernetesComponent::{
|
F.KubernetesComponent::{
|
||||||
, Service = Some (F.mkService app-name "zk" "zk" 2281)
|
, Service = Some (F.mkService app-name "zk" "zk" 2281)
|
||||||
, StatefulSet = Some
|
, StatefulSet = Some
|
||||||
( F.mkStatefulSet
|
( F.mkStatefulSet
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
TODO: replace opaque Text by structured zk host list and tls configuration
|
TODO: replace opaque Text by structured zk host list and tls configuration
|
||||||
-}
|
-}
|
||||||
\(zk-host : Text)
|
\(zk-host : Text) ->
|
||||||
-> ''
|
''
|
||||||
${zk-host}
|
${zk-host}
|
||||||
|
|
||||||
webapp:
|
webapp:
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{- This function converts a public-url Text to a registry.yaml file content
|
{- This function converts a public-url Text to a registry.yaml file content
|
||||||
|
|
||||||
-}
|
-}
|
||||||
\(public-url : Text)
|
\(public-url : Text) ->
|
||||||
-> ''
|
''
|
||||||
registry:
|
registry:
|
||||||
address: '0.0.0.0'
|
address: '0.0.0.0'
|
||||||
port: 9000
|
port: 9000
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{- This function converts a client-dir and server-dir Text to a zoo.cfg file content
|
{- This function converts a client-dir and server-dir Text to a zoo.cfg file content
|
||||||
-}
|
-}
|
||||||
\(client-dir : Text)
|
\(client-dir : Text) ->
|
||||||
-> \(server-dir : Text)
|
\(server-dir : Text) ->
|
||||||
-> ''
|
''
|
||||||
dataDir=/data
|
dataDir=/data
|
||||||
dataLogDir=/datalog
|
dataLogDir=/datalog
|
||||||
tickTime=2000
|
tickTime=2000
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
TODO: replace input schemas by the required attributes.
|
TODO: replace input schemas by the required attributes.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
\(input : (../input.dhall).Input.Type)
|
\(input : (../input.dhall).Input.Type) ->
|
||||||
-> \(zk-hosts : Text)
|
\(zk-hosts : Text) ->
|
||||||
-> let Prelude = ../../Prelude.dhall
|
let Prelude = ../../Prelude.dhall
|
||||||
|
|
||||||
let Schemas = ../input.dhall
|
let Schemas = ../input.dhall
|
||||||
|
|
||||||
@ -18,14 +18,12 @@ TODO: replace input schemas by the required attributes.
|
|||||||
|
|
||||||
Then it returns a text blob for all the connections
|
Then it returns a text blob for all the connections
|
||||||
-} mkConns =
|
-} mkConns =
|
||||||
\(type : Type)
|
\(type : Type) ->
|
||||||
-> \(list : Optional (List type))
|
\(list : Optional (List type)) ->
|
||||||
-> \(f : type -> Text)
|
\(f : type -> Text) ->
|
||||||
-> F.newlineSep
|
F.newlineSep
|
||||||
( merge
|
( merge
|
||||||
{ None = [] : List Text
|
{ None = [] : List Text, Some = Prelude.List.map type Text f }
|
||||||
, Some = Prelude.List.map type Text f
|
|
||||||
}
|
|
||||||
list
|
list
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -53,8 +51,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
mkConns
|
mkConns
|
||||||
Schemas.Gerrit.Type
|
Schemas.Gerrit.Type
|
||||||
input.connections.gerrits
|
input.connections.gerrits
|
||||||
( \(gerrit : Schemas.Gerrit.Type)
|
( \(gerrit : Schemas.Gerrit.Type) ->
|
||||||
-> let key = F.defaultText gerrit.sshkey.key "id_rsa"
|
let key = F.defaultText gerrit.sshkey.key "id_rsa"
|
||||||
|
|
||||||
let server = F.defaultText gerrit.server gerrit.name
|
let server = F.defaultText gerrit.server gerrit.name
|
||||||
|
|
||||||
@ -72,8 +70,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
mkConns
|
mkConns
|
||||||
Schemas.GitHub.Type
|
Schemas.GitHub.Type
|
||||||
input.connections.githubs
|
input.connections.githubs
|
||||||
( \(github : Schemas.GitHub.Type)
|
( \(github : Schemas.GitHub.Type) ->
|
||||||
-> let key = F.defaultText github.app_key.key "github_rsa"
|
let key = F.defaultText github.app_key.key "github_rsa"
|
||||||
|
|
||||||
in ''
|
in ''
|
||||||
[connection ${github.name}]
|
[connection ${github.name}]
|
||||||
@ -88,8 +86,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
mkConns
|
mkConns
|
||||||
Schemas.Git.Type
|
Schemas.Git.Type
|
||||||
input.connections.gits
|
input.connections.gits
|
||||||
( \(git : Schemas.Git.Type)
|
( \(git : Schemas.Git.Type) ->
|
||||||
-> ''
|
''
|
||||||
[connection ${git.name}]
|
[connection ${git.name}]
|
||||||
driver=git
|
driver=git
|
||||||
baseurl=${git.baseurl}
|
baseurl=${git.baseurl}
|
||||||
@ -101,8 +99,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
mkConns
|
mkConns
|
||||||
Schemas.Mqtt.Type
|
Schemas.Mqtt.Type
|
||||||
input.connections.mqtts
|
input.connections.mqtts
|
||||||
( \(mqtt : Schemas.Mqtt.Type)
|
( \(mqtt : Schemas.Mqtt.Type) ->
|
||||||
-> let user =
|
let user =
|
||||||
merge
|
merge
|
||||||
{ None = "", Some = \(some : Text) -> "user=${some}" }
|
{ None = "", Some = \(some : Text) -> "user=${some}" }
|
||||||
mqtt.user
|
mqtt.user
|
||||||
@ -111,8 +109,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
merge
|
merge
|
||||||
{ None = ""
|
{ None = ""
|
||||||
, Some =
|
, Some =
|
||||||
\(some : Schemas.UserSecret.Type)
|
\(some : Schemas.UserSecret.Type) ->
|
||||||
-> "password=%(ZUUL_MQTT_PASSWORD)"
|
"password=%(ZUUL_MQTT_PASSWORD)"
|
||||||
}
|
}
|
||||||
mqtt.password
|
mqtt.password
|
||||||
|
|
||||||
@ -128,8 +126,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
let job-volumes =
|
let job-volumes =
|
||||||
F.mkJobVolume
|
F.mkJobVolume
|
||||||
Text
|
Text
|
||||||
( \(job-volume : Schemas.JobVolume.Type)
|
( \(job-volume : Schemas.JobVolume.Type) ->
|
||||||
-> let {- TODO: add support for abritary lists of path per (context, access)
|
let {- TODO: add support for abritary lists of path per (context, access)
|
||||||
-} context =
|
-} context =
|
||||||
merge
|
merge
|
||||||
{ trusted = "trusted", untrusted = "untrusted" }
|
{ trusted = "trusted", untrusted = "untrusted" }
|
||||||
@ -139,8 +137,8 @@ TODO: replace input schemas by the required attributes.
|
|||||||
merge
|
merge
|
||||||
{ None = "ro"
|
{ None = "ro"
|
||||||
, Some =
|
, Some =
|
||||||
\(access : < ro | rw >)
|
\(access : < ro | rw >) ->
|
||||||
-> merge { ro = "ro", rw = "rw" } access
|
merge { ro = "ro", rw = "rw" } access
|
||||||
}
|
}
|
||||||
job-volume.access
|
job-volume.access
|
||||||
|
|
||||||
|
@ -16,45 +16,45 @@ let {- This methods process the optional input.job-volumes list. It takes:
|
|||||||
|
|
||||||
Then it returns a list of the output type
|
Then it returns a list of the output type
|
||||||
-} mkJobVolume =
|
-} mkJobVolume =
|
||||||
\(OutputType : Type)
|
\(OutputType : Type) ->
|
||||||
-> \(f : JobVolume -> OutputType)
|
\(f : JobVolume -> OutputType) ->
|
||||||
-> \(job-volumes : Optional (List JobVolume))
|
\(job-volumes : Optional (List JobVolume)) ->
|
||||||
-> merge
|
merge
|
||||||
{ None = [] : List OutputType
|
{ None = [] : List OutputType
|
||||||
, Some = Prelude.List.map JobVolume OutputType f
|
, Some = Prelude.List.map JobVolume OutputType f
|
||||||
}
|
}
|
||||||
job-volumes
|
job-volumes
|
||||||
|
|
||||||
let defaultNat =
|
let defaultNat =
|
||||||
\(value : Optional Natural)
|
\(value : Optional Natural) ->
|
||||||
-> \(default : Natural)
|
\(default : Natural) ->
|
||||||
-> merge { None = default, Some = \(some : Natural) -> some } value
|
merge { None = default, Some = \(some : Natural) -> some } value
|
||||||
|
|
||||||
let defaultText =
|
let defaultText =
|
||||||
\(value : Optional Text)
|
\(value : Optional Text) ->
|
||||||
-> \(default : Text)
|
\(default : Text) ->
|
||||||
-> merge { None = default, Some = \(some : Text) -> some } value
|
merge { None = default, Some = \(some : Text) -> some } value
|
||||||
|
|
||||||
let defaultKey =
|
let defaultKey =
|
||||||
\(secret : Optional UserSecret)
|
\(secret : Optional UserSecret) ->
|
||||||
-> \(default : Text)
|
\(default : Text) ->
|
||||||
-> merge
|
merge
|
||||||
{ None = default
|
{ None = default
|
||||||
, Some = \(some : UserSecret) -> defaultText some.key default
|
, Some = \(some : UserSecret) -> defaultText some.key default
|
||||||
}
|
}
|
||||||
secret
|
secret
|
||||||
|
|
||||||
let mkAppLabels =
|
let mkAppLabels =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> [ { mapKey = "app.kubernetes.io/name", mapValue = app-name }
|
[ { mapKey = "app.kubernetes.io/name", mapValue = app-name }
|
||||||
, { mapKey = "app.kubernetes.io/instance", mapValue = app-name }
|
, { mapKey = "app.kubernetes.io/instance", mapValue = app-name }
|
||||||
, { mapKey = "app.kubernetes.io/part-of", mapValue = "zuul" }
|
, { mapKey = "app.kubernetes.io/part-of", mapValue = "zuul" }
|
||||||
]
|
]
|
||||||
|
|
||||||
let mkComponentLabel =
|
let mkComponentLabel =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> \(component-name : Text)
|
\(component-name : Text) ->
|
||||||
-> mkAppLabels app-name
|
mkAppLabels app-name
|
||||||
# [ { mapKey = "app.kubernetes.io/component"
|
# [ { mapKey = "app.kubernetes.io/component"
|
||||||
, mapValue = component-name
|
, mapValue = component-name
|
||||||
}
|
}
|
||||||
@ -65,20 +65,20 @@ let Label = { mapKey : Text, mapValue : Text }
|
|||||||
let Labels = List Label
|
let Labels = List Label
|
||||||
|
|
||||||
let mkObjectMeta =
|
let mkObjectMeta =
|
||||||
\(name : Text)
|
\(name : Text) ->
|
||||||
-> \(labels : Labels)
|
\(labels : Labels) ->
|
||||||
-> Kubernetes.ObjectMeta::{ name = name, labels = Some labels }
|
Kubernetes.ObjectMeta::{ name, labels = Some labels }
|
||||||
|
|
||||||
let mkSelector =
|
let mkSelector =
|
||||||
\(labels : Labels)
|
\(labels : Labels) ->
|
||||||
-> Kubernetes.LabelSelector::{ matchLabels = Some labels }
|
Kubernetes.LabelSelector::{ matchLabels = Some labels }
|
||||||
|
|
||||||
let mkService =
|
let mkService =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> \(name : Text)
|
\(name : Text) ->
|
||||||
-> \(port-name : Text)
|
\(port-name : Text) ->
|
||||||
-> \(port : Natural)
|
\(port : Natural) ->
|
||||||
-> let labels = mkComponentLabel app-name name
|
let labels = mkComponentLabel app-name name
|
||||||
|
|
||||||
in Kubernetes.Service::{
|
in Kubernetes.Service::{
|
||||||
, metadata = mkObjectMeta name labels
|
, metadata = mkObjectMeta name labels
|
||||||
@ -89,9 +89,8 @@ let mkService =
|
|||||||
[ Kubernetes.ServicePort::{
|
[ Kubernetes.ServicePort::{
|
||||||
, name = Some port-name
|
, name = Some port-name
|
||||||
, protocol = Some "TCP"
|
, protocol = Some "TCP"
|
||||||
, targetPort = Some
|
, targetPort = Some (Kubernetes.IntOrString.String port-name)
|
||||||
(Kubernetes.IntOrString.String port-name)
|
, port
|
||||||
, port = port
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -143,8 +142,8 @@ let mkVolumeEmptyDir =
|
|||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
Volume.Type
|
Volume.Type
|
||||||
Kubernetes.Volume.Type
|
Kubernetes.Volume.Type
|
||||||
( \(volume : Volume.Type)
|
( \(volume : Volume.Type) ->
|
||||||
-> Kubernetes.Volume::{
|
Kubernetes.Volume::{
|
||||||
, name = volume.name
|
, name = volume.name
|
||||||
, emptyDir = Some Kubernetes.EmptyDirVolumeSource::{=}
|
, emptyDir = Some Kubernetes.EmptyDirVolumeSource::{=}
|
||||||
}
|
}
|
||||||
@ -154,8 +153,8 @@ let mkVolumeSecret =
|
|||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
Volume.Type
|
Volume.Type
|
||||||
Kubernetes.Volume.Type
|
Kubernetes.Volume.Type
|
||||||
( \(volume : Volume.Type)
|
( \(volume : Volume.Type) ->
|
||||||
-> Kubernetes.Volume::{
|
Kubernetes.Volume::{
|
||||||
, name = volume.name
|
, name = volume.name
|
||||||
, secret = Some Kubernetes.SecretVolumeSource::{
|
, secret = Some Kubernetes.SecretVolumeSource::{
|
||||||
, secretName = Some volume.name
|
, secretName = Some volume.name
|
||||||
@ -165,9 +164,9 @@ let mkVolumeSecret =
|
|||||||
)
|
)
|
||||||
|
|
||||||
let mkPodTemplateSpec =
|
let mkPodTemplateSpec =
|
||||||
\(component : Component.Type)
|
\(component : Component.Type) ->
|
||||||
-> \(labels : Labels)
|
\(labels : Labels) ->
|
||||||
-> Kubernetes.PodTemplateSpec::{
|
Kubernetes.PodTemplateSpec::{
|
||||||
, metadata = mkObjectMeta component.name labels
|
, metadata = mkObjectMeta component.name labels
|
||||||
, spec = Some Kubernetes.PodSpec::{
|
, spec = Some Kubernetes.PodSpec::{
|
||||||
, volumes = Some
|
, volumes = Some
|
||||||
@ -181,17 +180,15 @@ let mkPodTemplateSpec =
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mkStatefulSet =
|
let mkStatefulSet =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> \(component : Component.Type)
|
\(component : Component.Type) ->
|
||||||
-> let labels = mkComponentLabel app-name component.name
|
let labels = mkComponentLabel app-name component.name
|
||||||
|
|
||||||
let component-name = app-name ++ "-" ++ component.name
|
let component-name = app-name ++ "-" ++ component.name
|
||||||
|
|
||||||
let claim =
|
let claim =
|
||||||
if Natural/isZero component.claim-size
|
if Natural/isZero component.claim-size
|
||||||
|
|
||||||
then [] : List Kubernetes.PersistentVolumeClaim.Type
|
then [] : List Kubernetes.PersistentVolumeClaim.Type
|
||||||
|
|
||||||
else [ Kubernetes.PersistentVolumeClaim::{
|
else [ Kubernetes.PersistentVolumeClaim::{
|
||||||
, apiVersion = ""
|
, apiVersion = ""
|
||||||
, kind = ""
|
, kind = ""
|
||||||
@ -204,8 +201,7 @@ let mkStatefulSet =
|
|||||||
, requests = Some
|
, requests = Some
|
||||||
( toMap
|
( toMap
|
||||||
{ storage =
|
{ storage =
|
||||||
Natural/show component.claim-size
|
Natural/show component.claim-size ++ "Gi"
|
||||||
++ "Gi"
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -225,9 +221,9 @@ let mkStatefulSet =
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mkDeployment =
|
let mkDeployment =
|
||||||
\(app-name : Text)
|
\(app-name : Text) ->
|
||||||
-> \(component : Component.Type)
|
\(component : Component.Type) ->
|
||||||
-> let labels = mkComponentLabel app-name component.name
|
let labels = mkComponentLabel app-name component.name
|
||||||
|
|
||||||
let component-name = app-name ++ "-" ++ component.name
|
let component-name = app-name ++ "-" ++ component.name
|
||||||
|
|
||||||
@ -244,19 +240,16 @@ let mkEnvVarValue =
|
|||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
Label
|
Label
|
||||||
Kubernetes.EnvVar.Type
|
Kubernetes.EnvVar.Type
|
||||||
( \(env : Label)
|
( \(env : Label) ->
|
||||||
-> Kubernetes.EnvVar::{
|
Kubernetes.EnvVar::{ name = env.mapKey, value = Some env.mapValue }
|
||||||
, name = env.mapKey
|
|
||||||
, value = Some env.mapValue
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
let mkEnvVarSecret =
|
let mkEnvVarSecret =
|
||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
EnvSecret
|
EnvSecret
|
||||||
Kubernetes.EnvVar.Type
|
Kubernetes.EnvVar.Type
|
||||||
( \(env : EnvSecret)
|
( \(env : EnvSecret) ->
|
||||||
-> Kubernetes.EnvVar::{
|
Kubernetes.EnvVar::{
|
||||||
, name = env.name
|
, name = env.name
|
||||||
, valueFrom = Some Kubernetes.EnvVarSource::{
|
, valueFrom = Some Kubernetes.EnvVarSource::{
|
||||||
, secretKeyRef = Some Kubernetes.SecretKeySelector::{
|
, secretKeyRef = Some Kubernetes.SecretKeySelector::{
|
||||||
@ -271,31 +264,31 @@ let mkVolumeMount =
|
|||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
Volume.Type
|
Volume.Type
|
||||||
Kubernetes.VolumeMount.Type
|
Kubernetes.VolumeMount.Type
|
||||||
( \(volume : Volume.Type)
|
( \(volume : Volume.Type) ->
|
||||||
-> Kubernetes.VolumeMount::{
|
Kubernetes.VolumeMount::{
|
||||||
, name = volume.name
|
, name = volume.name
|
||||||
, mountPath = volume.dir
|
, mountPath = volume.dir
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
in { defaultNat = defaultNat
|
in { defaultNat
|
||||||
, defaultText = defaultText
|
, defaultText
|
||||||
, defaultKey = defaultKey
|
, defaultKey
|
||||||
, newlineSep = Prelude.Text.concatSep "\n"
|
, newlineSep = Prelude.Text.concatSep "\n"
|
||||||
, mkJobVolume = mkJobVolume
|
, mkJobVolume
|
||||||
, mkComponentLabel = mkComponentLabel
|
, mkComponentLabel
|
||||||
, mkObjectMeta = mkObjectMeta
|
, mkObjectMeta
|
||||||
, mkSelector = mkSelector
|
, mkSelector
|
||||||
, mkService = mkService
|
, mkService
|
||||||
, mkDeployment = mkDeployment
|
, mkDeployment
|
||||||
, mkStatefulSet = mkStatefulSet
|
, mkStatefulSet
|
||||||
, mkVolumeMount = mkVolumeMount
|
, mkVolumeMount
|
||||||
, mkEnvVarValue = mkEnvVarValue
|
, mkEnvVarValue
|
||||||
, mkEnvVarSecret = mkEnvVarSecret
|
, mkEnvVarSecret
|
||||||
, EnvSecret = EnvSecret
|
, EnvSecret
|
||||||
, Label = Label
|
, Label
|
||||||
, Labels = Labels
|
, Labels
|
||||||
, Volume = Volume
|
, Volume
|
||||||
, Component = Component
|
, Component
|
||||||
, KubernetesComponent = KubernetesComponent
|
, KubernetesComponent
|
||||||
}
|
}
|
||||||
|
@ -70,10 +70,7 @@ let Schemas =
|
|||||||
, status_url : Optional Text
|
, status_url : Optional Text
|
||||||
}
|
}
|
||||||
, default =
|
, default =
|
||||||
{ image = None Text
|
{ image = None Text, count = None Natural, status_url = None Text }
|
||||||
, count = None Natural
|
|
||||||
, status_url = None Text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
, Scheduler =
|
, Scheduler =
|
||||||
{ Type =
|
{ Type =
|
||||||
@ -175,4 +172,4 @@ let Input =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
in Schemas // { Input = Input }
|
in Schemas // { Input }
|
||||||
|
@ -54,8 +54,8 @@ let UserSecret = Schemas.UserSecret.Type
|
|||||||
|
|
||||||
let Volume = F.Volume
|
let Volume = F.Volume
|
||||||
|
|
||||||
in \(input : Input)
|
in \(input : Input) ->
|
||||||
-> let zk-conf =
|
let zk-conf =
|
||||||
merge
|
merge
|
||||||
{ None =
|
{ None =
|
||||||
{ ServiceVolumes =
|
{ ServiceVolumes =
|
||||||
@ -95,8 +95,8 @@ in \(input : Input)
|
|||||||
, Env = [] : List Kubernetes.EnvVar.Type
|
, Env = [] : List Kubernetes.EnvVar.Type
|
||||||
}
|
}
|
||||||
, Some =
|
, Some =
|
||||||
\(some : UserSecret)
|
\(some : UserSecret) ->
|
||||||
-> let empty = [] : List Volume.Type
|
let empty = [] : List Volume.Type
|
||||||
|
|
||||||
in { ServiceVolumes = empty
|
in { ServiceVolumes = empty
|
||||||
, ClientVolumes = empty
|
, ClientVolumes = empty
|
||||||
@ -118,8 +118,8 @@ in \(input : Input)
|
|||||||
input.zookeeper
|
input.zookeeper
|
||||||
|
|
||||||
let db-internal-password-env =
|
let db-internal-password-env =
|
||||||
\(env-name : Text)
|
\(env-name : Text) ->
|
||||||
-> F.mkEnvVarSecret
|
F.mkEnvVarSecret
|
||||||
[ { name = env-name
|
[ { name = env-name
|
||||||
, secret = "${input.name}-database-password"
|
, secret = "${input.name}-database-password"
|
||||||
, key = "password"
|
, key = "password"
|
||||||
@ -136,9 +136,9 @@ in \(input : Input)
|
|||||||
let image = \(name : Text) -> "${org}/${name}:${version}"
|
let image = \(name : Text) -> "${org}/${name}:${version}"
|
||||||
|
|
||||||
let set-image =
|
let set-image =
|
||||||
\(default-name : Text)
|
\(default-name : Text) ->
|
||||||
-> \(input-name : Optional Text)
|
\(input-name : Optional Text) ->
|
||||||
-> { image =
|
{ image =
|
||||||
merge
|
merge
|
||||||
{ None = Some default-name
|
{ None = Some default-name
|
||||||
, Some = \(_ : Text) -> input-name
|
, Some = \(_ : Text) -> input-name
|
||||||
@ -199,7 +199,6 @@ in \(input : Input)
|
|||||||
|
|
||||||
let registry-cert =
|
let registry-cert =
|
||||||
if registry-enabled
|
if registry-enabled
|
||||||
|
|
||||||
then [ CertManager.Certificate::{
|
then [ CertManager.Certificate::{
|
||||||
, metadata =
|
, metadata =
|
||||||
F.mkObjectMeta
|
F.mkObjectMeta
|
||||||
@ -212,12 +211,10 @@ in \(input : Input)
|
|||||||
, secretName = "${input.name}-registry-tls"
|
, secretName = "${input.name}-registry-tls"
|
||||||
, issuerRef = issuer
|
, issuerRef = issuer
|
||||||
, dnsNames = Some [ "registry" ]
|
, dnsNames = Some [ "registry" ]
|
||||||
, usages = Some
|
, usages = Some [ "server auth", "client auth" ]
|
||||||
[ "server auth", "client auth" ]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
else [] : List CertManager.Certificate.Type
|
else [] : List CertManager.Certificate.Type
|
||||||
|
|
||||||
in { Issuers =
|
in { Issuers =
|
||||||
@ -264,10 +261,7 @@ in \(input : Input)
|
|||||||
, metadata =
|
, metadata =
|
||||||
F.mkObjectMeta
|
F.mkObjectMeta
|
||||||
"${input.name}-gearman-tls"
|
"${input.name}-gearman-tls"
|
||||||
( F.mkComponentLabel
|
(F.mkComponentLabel input.name "cert-gearman")
|
||||||
input.name
|
|
||||||
"cert-gearman"
|
|
||||||
)
|
|
||||||
, spec = CertManager.CertificateSpec::{
|
, spec = CertManager.CertificateSpec::{
|
||||||
, secretName = "${input.name}-gearman-tls"
|
, secretName = "${input.name}-gearman-tls"
|
||||||
, issuerRef = issuer
|
, issuerRef = issuer
|
||||||
@ -286,8 +280,7 @@ in \(input : Input)
|
|||||||
input.name
|
input.name
|
||||||
db-internal-password-env
|
db-internal-password-env
|
||||||
, Some =
|
, Some =
|
||||||
\(some : UserSecret)
|
\(some : UserSecret) -> F.KubernetesComponent.default
|
||||||
-> F.KubernetesComponent.default
|
|
||||||
}
|
}
|
||||||
input.database
|
input.database
|
||||||
, ZooKeeper =
|
, ZooKeeper =
|
||||||
@ -297,8 +290,7 @@ in \(input : Input)
|
|||||||
input.name
|
input.name
|
||||||
(zk-conf.ClientVolumes # zk-conf.ServiceVolumes)
|
(zk-conf.ClientVolumes # zk-conf.ServiceVolumes)
|
||||||
, Some =
|
, Some =
|
||||||
\(some : UserSecret)
|
\(some : UserSecret) -> F.KubernetesComponent.default
|
||||||
-> F.KubernetesComponent.default
|
|
||||||
}
|
}
|
||||||
input.zookeeper
|
input.zookeeper
|
||||||
}
|
}
|
||||||
@ -313,8 +305,8 @@ in \(input : Input)
|
|||||||
merge
|
merge
|
||||||
{ None = db-internal-password-env "ZUUL_DB_PASSWORD"
|
{ None = db-internal-password-env "ZUUL_DB_PASSWORD"
|
||||||
, Some =
|
, Some =
|
||||||
\(some : UserSecret)
|
\(some : UserSecret) ->
|
||||||
-> F.mkEnvVarSecret
|
F.mkEnvVarSecret
|
||||||
[ { name = "ZUUL_DB_URI"
|
[ { name = "ZUUL_DB_URI"
|
||||||
, secret = some.secretName
|
, secret = some.secretName
|
||||||
, key = F.defaultText some.key "db_uri"
|
, key = F.defaultText some.key "db_uri"
|
||||||
@ -328,8 +320,7 @@ in \(input : Input)
|
|||||||
F.mkEnvVarValue (toMap { ZUUL_DB_PASSWORD = "unused" })
|
F.mkEnvVarValue (toMap { ZUUL_DB_PASSWORD = "unused" })
|
||||||
|
|
||||||
let zuul-data-dir =
|
let zuul-data-dir =
|
||||||
[ Volume::{ name = "zuul-data", dir = "/var/lib/zuul" }
|
[ Volume::{ name = "zuul-data", dir = "/var/lib/zuul" } ]
|
||||||
]
|
|
||||||
|
|
||||||
let sched-config =
|
let sched-config =
|
||||||
Volume::{
|
Volume::{
|
||||||
@ -424,8 +415,8 @@ in \(input : Input)
|
|||||||
merge
|
merge
|
||||||
{ None = [] : List Volume.Type
|
{ None = [] : List Volume.Type
|
||||||
, Some =
|
, Some =
|
||||||
\(some : UserSecret)
|
\(some : UserSecret) ->
|
||||||
-> [ Volume::{
|
[ Volume::{
|
||||||
, name = some.secretName
|
, name = some.secretName
|
||||||
, dir = "/etc/nodepool-openstack"
|
, dir = "/etc/nodepool-openstack"
|
||||||
}
|
}
|
||||||
@ -437,8 +428,8 @@ in \(input : Input)
|
|||||||
merge
|
merge
|
||||||
{ None = [] : List Volume.Type
|
{ None = [] : List Volume.Type
|
||||||
, Some =
|
, Some =
|
||||||
\(some : UserSecret)
|
\(some : UserSecret) ->
|
||||||
-> [ Volume::{
|
[ Volume::{
|
||||||
, name = some.secretName
|
, name = some.secretName
|
||||||
, dir = "/etc/nodepool-kubernetes"
|
, dir = "/etc/nodepool-kubernetes"
|
||||||
}
|
}
|
||||||
@ -504,18 +495,16 @@ in \(input : Input)
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mkSecret =
|
let mkSecret =
|
||||||
\(volume : Volume.Type)
|
\(volume : Volume.Type) ->
|
||||||
-> Kubernetes.Resource.Secret
|
Kubernetes.Resource.Secret
|
||||||
Kubernetes.Secret::{
|
Kubernetes.Secret::{
|
||||||
, metadata = Kubernetes.ObjectMeta::{ name = volume.name }
|
, metadata = Kubernetes.ObjectMeta::{ name = volume.name }
|
||||||
, stringData = Some
|
, stringData = Some
|
||||||
( Prelude.List.map
|
( Prelude.List.map
|
||||||
{ path : Text, content : Text }
|
{ path : Text, content : Text }
|
||||||
{ mapKey : Text, mapValue : Text }
|
{ mapKey : Text, mapValue : Text }
|
||||||
( \(config : { path : Text, content : Text })
|
( \(config : { path : Text, content : Text }) ->
|
||||||
-> { mapKey = config.path
|
{ mapKey = config.path, mapValue = config.content }
|
||||||
, mapValue = config.content
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
volume.files
|
volume.files
|
||||||
)
|
)
|
||||||
@ -524,28 +513,28 @@ in \(input : Input)
|
|||||||
let {- This function transforms the different types into the Kubernetes.Resource
|
let {- This function transforms the different types into the Kubernetes.Resource
|
||||||
union to enable using them inside a single List array
|
union to enable using them inside a single List array
|
||||||
-} mkUnion =
|
-} mkUnion =
|
||||||
\(component : F.KubernetesComponent.Type)
|
\(component : F.KubernetesComponent.Type) ->
|
||||||
-> let empty = [] : List Kubernetes.Resource
|
let empty = [] : List Kubernetes.Resource
|
||||||
|
|
||||||
in merge
|
in merge
|
||||||
{ None = empty
|
{ None = empty
|
||||||
, Some =
|
, Some =
|
||||||
\(some : Kubernetes.Service.Type)
|
\(some : Kubernetes.Service.Type) ->
|
||||||
-> [ Kubernetes.Resource.Service some ]
|
[ Kubernetes.Resource.Service some ]
|
||||||
}
|
}
|
||||||
component.Service
|
component.Service
|
||||||
# merge
|
# merge
|
||||||
{ None = empty
|
{ None = empty
|
||||||
, Some =
|
, Some =
|
||||||
\(some : Kubernetes.StatefulSet.Type)
|
\(some : Kubernetes.StatefulSet.Type) ->
|
||||||
-> [ Kubernetes.Resource.StatefulSet some ]
|
[ Kubernetes.Resource.StatefulSet some ]
|
||||||
}
|
}
|
||||||
component.StatefulSet
|
component.StatefulSet
|
||||||
# merge
|
# merge
|
||||||
{ None = empty
|
{ None = empty
|
||||||
, Some =
|
, Some =
|
||||||
\(some : Kubernetes.Deployment.Type)
|
\(some : Kubernetes.Deployment.Type) ->
|
||||||
-> [ Kubernetes.Resource.Deployment some ]
|
[ Kubernetes.Resource.Deployment some ]
|
||||||
}
|
}
|
||||||
component.Deployment
|
component.Deployment
|
||||||
|
|
||||||
@ -555,15 +544,14 @@ in \(input : Input)
|
|||||||
Prelude.List.map
|
Prelude.List.map
|
||||||
Kubernetes.Resource
|
Kubernetes.Resource
|
||||||
CertManager.Union
|
CertManager.Union
|
||||||
( \(resource : Kubernetes.Resource)
|
( \(resource : Kubernetes.Resource) ->
|
||||||
-> CertManager.Union.Kubernetes resource
|
CertManager.Union.Kubernetes resource
|
||||||
)
|
)
|
||||||
|
|
||||||
let {- if cert-manager is enabled, then includes and transforms the CertManager types
|
let {- if cert-manager is enabled, then includes and transforms the CertManager types
|
||||||
into the new Union that combines Kubernetes and CertManager resources
|
into the new Union that combines Kubernetes and CertManager resources
|
||||||
-} all-certificates =
|
-} all-certificates =
|
||||||
if input.withCertManager
|
if input.withCertManager
|
||||||
|
|
||||||
then Prelude.List.map
|
then Prelude.List.map
|
||||||
CertManager.Issuer.Type
|
CertManager.Issuer.Type
|
||||||
CertManager.Union
|
CertManager.Union
|
||||||
@ -574,10 +562,9 @@ in \(input : Input)
|
|||||||
CertManager.Union
|
CertManager.Union
|
||||||
CertManager.Union.Certificate
|
CertManager.Union.Certificate
|
||||||
Components.CertManager.Certificates
|
Components.CertManager.Certificates
|
||||||
|
|
||||||
else [] : List CertManager.Union
|
else [] : List CertManager.Union
|
||||||
|
|
||||||
in { Components = Components
|
in { Components
|
||||||
, List =
|
, List =
|
||||||
{ apiVersion = "v1"
|
{ apiVersion = "v1"
|
||||||
, kind = "List"
|
, kind = "List"
|
||||||
|
Loading…
Reference in New Issue
Block a user