mirror of
https://github.com/dhall-lang/dhall-kubernetes.git
synced 2024-09-17 10:27:08 +03:00
89e7c8ed0b
Related to https://github.com/dhall-lang/dhall-kubernetes/issues/75 In order to support multiple versions of the Kubernetes API we need to begin automating the process of excluding duplicate resources (otherwise the maintenance burden would be far too high). This change adds new support for automatically preferring Kubernetes resources by version where: * v2 is prioritized over v1 * production is prioritized over beta, which is prioritized over alpha Note that even when prioritizing by version there are still a few cases of duplicates. For now we use the default behavior of `Data.List.maximumBy` to select the last resource if there are still conflicts. This leads to a few differences in which resources are preferred when such a conflict arises (where previously we were just guessing manually which one to pick).
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
let kubernetes =
|
|
../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a
|
|
|
|
let deployment =
|
|
kubernetes.Deployment::{
|
|
, metadata = kubernetes.ObjectMeta::{ name = "nginx" }
|
|
, spec =
|
|
Some
|
|
kubernetes.DeploymentSpec::{
|
|
, replicas = Some 2
|
|
, template =
|
|
kubernetes.PodTemplateSpec::{
|
|
, metadata = kubernetes.ObjectMeta::{ name = "nginx" }
|
|
, spec =
|
|
Some
|
|
kubernetes.PodSpec::{
|
|
, containers =
|
|
[ kubernetes.Container::{
|
|
, name = "nginx"
|
|
, image = Some "nginx:1.15.3"
|
|
, ports =
|
|
[ kubernetes.ContainerPort::{
|
|
, containerPort = 80
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
in deployment
|