From 89e7c8ed0b2447e5d51caf4c4f103b0ef2159e4f Mon Sep 17 00:00:00 2001 From: Gabriel Gonzalez Date: Fri, 3 Jan 2020 08:51:05 -0800 Subject: [PATCH] Automate exclusion of duplicate resources (#99) 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). --- README.md | 4 +- defaults.dhall | 28 +- .../dhall-kubernetes-generator.cabal | 4 +- .../src/Dhall/Kubernetes/Convert.hs | 4 +- .../src/Dhall/Kubernetes/Data.hs | 261 +----------------- dhall-kubernetes-generator/src/Main.hs | 107 +++++-- examples/aws-iam-authenticator-chart.dhall | 2 +- examples/deployment.dhall | 2 +- examples/deploymentSimple.dhall | 2 +- examples/ingress.dhall | 2 +- examples/service.dhall | 2 +- package.dhall | 6 +- schemas.dhall | 28 +- types.dhall | 28 +- typesUnion.dhall | 28 +- 15 files changed, 162 insertions(+), 346 deletions(-) diff --git a/README.md b/README.md index 27fd0cb6..27a72702 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ In the following example, we: -- examples/deploymentSimple.dhall let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let deployment = kubernetes.Deployment::{ @@ -151,7 +151,7 @@ let map = Prelude.List.map let kv = Prelude.JSON.keyText let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let Service = { name : Text, host : Text, version : Text } diff --git a/defaults.dhall b/defaults.dhall index 5e7c31fe..ea6d2456 100644 --- a/defaults.dhall +++ b/defaults.dhall @@ -6,16 +6,12 @@ ./defaults/io.k8s.api.admissionregistration.v1.MutatingWebhookConfigurationList.dhall sha256:d66d78412702694d2e6abe67e67ae4b0b9055c0db351164f5310591e19804363 , RuleWithOperations = ./defaults/io.k8s.api.admissionregistration.v1.RuleWithOperations.dhall sha256:1bbba1effc10003614574e80ca8c637a74f00742fba42233b7a6da4a65c8a628 -, ServiceReference = - ./defaults/io.k8s.api.admissionregistration.v1.ServiceReference.dhall sha256:41716550e011eed9f171d6cca7bae2802ca3794d126daa7642e095934bc3cca7 , ValidatingWebhook = ./defaults/io.k8s.api.admissionregistration.v1.ValidatingWebhook.dhall sha256:5cf7a1732099515fbf6ffab36042e3e8232e6b21abb4dc7674b5d570df4e20ad , ValidatingWebhookConfiguration = ./defaults/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration.dhall sha256:369b97e62b63e3c8c46a0c01096cd1493e6b4be52900e2b6949b29c90a5cff2d , ValidatingWebhookConfigurationList = ./defaults/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfigurationList.dhall sha256:5fb4978384103f0c1aa205ad6ee9453511539421e780116a3d79324f661d4925 -, WebhookClientConfig = - ./defaults/io.k8s.api.admissionregistration.v1.WebhookClientConfig.dhall sha256:3d22b60a2265c8c7c2f153306c4111b4e0f04a51cc9f6e71257e3ef22a328900 , ControllerRevision = ./defaults/io.k8s.api.apps.v1.ControllerRevision.dhall sha256:76b4dd3693675359ca73ef4d4de4ade54bcc98eabb603f01178740ba80ac15c3 , ControllerRevisionList = @@ -72,10 +68,6 @@ ./defaults/io.k8s.api.apps.v1.StatefulSetStatus.dhall sha256:c546b1ef00fc415c624e2122e201c340aa5cb2e3fabcfc7076b9dd61be0b71f0 , StatefulSetUpdateStrategy = ./defaults/io.k8s.api.apps.v1.StatefulSetUpdateStrategy.dhall sha256:5b3f71bcd6db3b8a75e2b9308d5c10c4c1020b8f8e4d17219fc0ca0f67f68a67 -, DeploymentRollback = - ./defaults/io.k8s.api.apps.v1beta1.DeploymentRollback.dhall sha256:d2720fefc4ffc1569e9d49f060eead95e98a667d7495e4a3058840f2902858cf -, RollbackConfig = - ./defaults/io.k8s.api.apps.v1beta1.RollbackConfig.dhall sha256:259e5eb90283b13866747437813b461e5a93a794577b1435628502e2b6be32e2 , AuditSink = ./defaults/io.k8s.api.auditregistration.v1alpha1.AuditSink.dhall sha256:2f42b38a8cb2c7856d00d3a5323047a0c0c8659a1d16f64f1702a4616cd4334e , AuditSinkList = @@ -185,13 +177,13 @@ , JobStatus = ./defaults/io.k8s.api.batch.v1.JobStatus.dhall sha256:a8d8e591e2fe1686c47015ccb1ec4d526b2556e393d2971d9df4f2d670c66f1e , CronJob = - ./defaults/io.k8s.api.batch.v1beta1.CronJob.dhall sha256:2bef4189ab119a583247910482ff7d6c6ea39993be1db850eb17993efe6c9f55 + ./defaults/io.k8s.api.batch.v2alpha1.CronJob.dhall sha256:2b36c2d2b7020a85d1733bdbc8f15e5371aebb9c8b3dc61be2b52f9b5b9b8b8a , CronJobList = - ./defaults/io.k8s.api.batch.v1beta1.CronJobList.dhall sha256:7b8b56168421758c086940d5c603d40d45e69a6e8b2033078552ebd6f034822e + ./defaults/io.k8s.api.batch.v2alpha1.CronJobList.dhall sha256:26b1a6178d077df37f6c41e63db0b3a13f25be586eb3cafc112ba1215547ff26 , CronJobSpec = - ./defaults/io.k8s.api.batch.v1beta1.CronJobSpec.dhall sha256:d201ac1de16f2ba23aa937ddc73cfcd36cd589e0b3b87e4e33674d3796458365 + ./defaults/io.k8s.api.batch.v2alpha1.CronJobSpec.dhall sha256:d201ac1de16f2ba23aa937ddc73cfcd36cd589e0b3b87e4e33674d3796458365 , CronJobStatus = - ./defaults/io.k8s.api.batch.v1beta1.CronJobStatus.dhall sha256:74d9ee0419f4a414496b1195a1fa782696a07d131edf8194fa2d3dae5253a70b + ./defaults/io.k8s.api.batch.v2alpha1.CronJobStatus.dhall sha256:74d9ee0419f4a414496b1195a1fa782696a07d131edf8194fa2d3dae5253a70b , JobTemplateSpec = ./defaults/io.k8s.api.batch.v2alpha1.JobTemplateSpec.dhall sha256:2aa234045f2a2860acab9030495473ebade2ab3afd0f7b70d10fd9f8f96cb6bd , CertificateSigningRequest = @@ -586,8 +578,10 @@ ./defaults/io.k8s.api.discovery.v1alpha1.EndpointSlice.dhall sha256:f7912dc3ac8bc06f46ed0bc514450f368a20d893519bbc2a029e0596e25c9090 , EndpointSliceList = ./defaults/io.k8s.api.discovery.v1alpha1.EndpointSliceList.dhall sha256:3d4167abc8c54d94a6ed6c7402e7d543018a6f158cb4202e248d897735fb732e -, RuntimeClassStrategyOptions = - ./defaults/io.k8s.api.extensions.v1beta1.RuntimeClassStrategyOptions.dhall sha256:4e3e466b5805f9c35d66b1e802abc985cfc08e508d48ab204430f5b9afba476b +, DeploymentRollback = + ./defaults/io.k8s.api.extensions.v1beta1.DeploymentRollback.dhall sha256:b415daa397353818007c8670eca4652fc5e16b5eaae6646edb22bf75eb8c9a27 +, RollbackConfig = + ./defaults/io.k8s.api.extensions.v1beta1.RollbackConfig.dhall sha256:259e5eb90283b13866747437813b461e5a93a794577b1435628502e2b6be32e2 , IPBlock = ./defaults/io.k8s.api.networking.v1.IPBlock.dhall sha256:cc014e7288e2b1bb421317be608236bae1f40bf0d6337af01ab9419bcd6d519a , NetworkPolicy = @@ -664,6 +658,8 @@ ./defaults/io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions.dhall sha256:c5a2b1471ef3700443a5ed1e59a47e640ffd392c3eeb275d223c0a4ef95450ae , RunAsUserStrategyOptions = ./defaults/io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions.dhall sha256:c5a2b1471ef3700443a5ed1e59a47e640ffd392c3eeb275d223c0a4ef95450ae +, RuntimeClassStrategyOptions = + ./defaults/io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions.dhall sha256:4e3e466b5805f9c35d66b1e802abc985cfc08e508d48ab204430f5b9afba476b , SELinuxStrategyOptions = ./defaults/io.k8s.api.policy.v1beta1.SELinuxStrategyOptions.dhall sha256:4f75cf22af14786a303d47531c790359d1d9bf27cb7560d715a1a47ce38533d6 , SupplementalGroupsStrategyOptions = @@ -770,6 +766,8 @@ ./defaults/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool.dhall sha256:9bb9dcb5bf6f795291686f59383bcd01c8e79b87fc3fb63351d46dea100ac51b , JSONSchemaPropsOrStringArray = ./defaults/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray.dhall sha256:9bb9dcb5bf6f795291686f59383bcd01c8e79b87fc3fb63351d46dea100ac51b +, WebhookClientConfig = + ./defaults/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig.dhall sha256:3d22b60a2265c8c7c2f153306c4111b4e0f04a51cc9f6e71257e3ef22a328900 , WebhookConversion = ./defaults/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion.dhall sha256:2885e6ce60c9cb2a6707b0b42aa8df852b5cd472dca0f7f5a60862673d83a1f0 , APIGroup = @@ -822,4 +820,6 @@ ./defaults/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceSpec.dhall sha256:cfc0419c5fd6044fd269b7f3c916e834167a1aceb825d32145063069bfb7f96e , APIServiceStatus = ./defaults/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceStatus.dhall sha256:095c10d7c74ad63f074a1a78327080a6854b28a6656fb0551127d8aea344c374 +, ServiceReference = + ./defaults/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.ServiceReference.dhall sha256:26d9fe3ecf69a265929095de933d5870e08ed87177b64127fa943b33b7e68814 } diff --git a/dhall-kubernetes-generator/dhall-kubernetes-generator.cabal b/dhall-kubernetes-generator/dhall-kubernetes-generator.cabal index 8b515086..92ff9131 100644 --- a/dhall-kubernetes-generator/dhall-kubernetes-generator.cabal +++ b/dhall-kubernetes-generator/dhall-kubernetes-generator.cabal @@ -23,11 +23,11 @@ executable dhall-kubernetes-generator base >= 4.8.2.0 && < 5 , aeson >= 1.0.0.0 && < 1.5 , containers >= 0.5.0.0 && < 0.7 , - dhall >= 1.22.0 && < 1.28 , + dhall >= 1.22.0 && < 1.29 , megaparsec >= 7.0 && < 7.1 , optparse-applicative >= 0.14.3.0 && < 0.15 , parser-combinators >= 1.0.3 && < 1.3 , - prettyprinter >= 1.2.0.1 && < 1.3 , + prettyprinter >= 1.2.0.1 && < 1.6 , sort >= 1.0 && < 1.1 , text >= 0.11.1.0 && < 1.3 , turtle >= 1.5.0 && < 1.6 , diff --git a/dhall-kubernetes-generator/src/Dhall/Kubernetes/Convert.hs b/dhall-kubernetes-generator/src/Dhall/Kubernetes/Convert.hs index 3cb760be..5a100726 100644 --- a/dhall-kubernetes-generator/src/Dhall/Kubernetes/Convert.hs +++ b/dhall-kubernetes-generator/src/Dhall/Kubernetes/Convert.hs @@ -18,7 +18,6 @@ import Data.Maybe (fromMaybe, mapMaybe) import Data.Set (Set) import Data.Text (Text) -import Dhall.Kubernetes.Data (excludedModels) import Dhall.Kubernetes.Types @@ -279,14 +278,13 @@ getImportsMap prefixMap duplicateNameHandler objectNames folder toInclude selectObject :: (Text, [ModelName]) -> Maybe (ModelName, Text) selectObject (kind, namespacedNames) = fmap (,kind) namespaced where - filterFn modelName@(ModelName name) = not $ or + filterFn (ModelName name) = not $ or -- The reason why we filter these two prefixes is that they are "internal" -- objects. I.e. they do not appear referenced in other objects, but are -- just in the Go source. E.g. see https://godoc.org/k8s.io/kubernetes/pkg/apis/core [ Text.isPrefixOf "io.k8s.kubernetes.pkg.api." name , Text.isPrefixOf "io.k8s.kubernetes.pkg.apis." name -- We keep a list of "old" objects that should not be preferred/picked - , Set.member modelName excludedModels ] namespaced = case filter filterFn namespacedNames of diff --git a/dhall-kubernetes-generator/src/Dhall/Kubernetes/Data.hs b/dhall-kubernetes-generator/src/Dhall/Kubernetes/Data.hs index 21ea981e..8fef0250 100644 --- a/dhall-kubernetes-generator/src/Dhall/Kubernetes/Data.hs +++ b/dhall-kubernetes-generator/src/Dhall/Kubernetes/Data.hs @@ -1,9 +1,9 @@ module Dhall.Kubernetes.Data where -import qualified Data.Map.Strict as Data.Map -import Data.Set (Set) -import qualified Data.Set as Set -import Dhall.Kubernetes.Types +import Dhall.Kubernetes.Types + +import qualified Data.Map.Strict as Data.Map +import qualified Data.Set as Set -- | This just removes the offending keys from the definition @@ -12,256 +12,3 @@ patchCyclicImports Definition{ properties = oldProps, .. } = Definition{..} where properties = fmap (\propsMap -> Data.Map.withoutKeys propsMap toRemove) oldProps toRemove = Set.fromList $ ModelName <$> [ "allOf", "anyOf", "not", "oneOf" ] - - --- | List of objects that we don't include in the defaults and types records. --- The reason why we remove some is because of name clashes across API versions. --- So usually the rule for picking the object to keep is "the most recent". --- Note: this is used only for composing the `types.dhall` and `defaults.dhall` files. -excludedModels :: Set ModelName -excludedModels = Set.fromList $ ModelName <$> - [ "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIService" - , "io.k8s.api.admissionregistration.v1alpha1.Initializer" - , "io.k8s.api.admissionregistration.v1beta1.ServiceReference" - , "io.k8s.api.apps.v1beta1.ControllerRevision" - , "io.k8s.api.apps.v1beta1.ControllerRevisionList" - , "io.k8s.api.apps.v1beta1.Deployment" - , "io.k8s.api.apps.v1beta1.DeploymentCondition" - , "io.k8s.api.apps.v1beta1.DeploymentList" - , "io.k8s.api.apps.v1beta1.DeploymentSpec" - , "io.k8s.api.apps.v1beta1.DeploymentStatus" - , "io.k8s.api.apps.v1beta1.DeploymentStrategy" - , "io.k8s.api.apps.v1beta1.RollingUpdateDeployment" - , "io.k8s.api.apps.v1beta1.RollingUpdateStatefulSetStrategy" - , "io.k8s.api.apps.v1beta1.Scale" - , "io.k8s.api.apps.v1beta1.ScaleSpec" - , "io.k8s.api.apps.v1beta1.ScaleStatus" - , "io.k8s.api.apps.v1beta1.StatefulSet" - , "io.k8s.api.apps.v1beta1.StatefulSetCondition" - , "io.k8s.api.apps.v1beta1.StatefulSetList" - , "io.k8s.api.apps.v1beta1.StatefulSetSpec" - , "io.k8s.api.apps.v1beta1.StatefulSetStatus" - , "io.k8s.api.apps.v1beta1.StatefulSetUpdateStrategy" - , "io.k8s.api.apps.v1beta2.ControllerRevision" - , "io.k8s.api.apps.v1beta2.ControllerRevisionList" - , "io.k8s.api.apps.v1beta2.DaemonSet" - , "io.k8s.api.apps.v1beta2.DaemonSetCondition" - , "io.k8s.api.apps.v1beta2.DaemonSetList" - , "io.k8s.api.apps.v1beta2.DaemonSetSpec" - , "io.k8s.api.apps.v1beta2.DaemonSetStatus" - , "io.k8s.api.apps.v1beta2.DaemonSetUpdateStrategy" - , "io.k8s.api.apps.v1beta2.Deployment" - , "io.k8s.api.apps.v1beta2.DeploymentCondition" - , "io.k8s.api.apps.v1beta2.DeploymentList" - , "io.k8s.api.apps.v1beta2.DeploymentSpec" - , "io.k8s.api.apps.v1beta2.DeploymentStatus" - , "io.k8s.api.apps.v1beta2.DeploymentStrategy" - , "io.k8s.api.apps.v1beta2.ReplicaSet" - , "io.k8s.api.apps.v1beta2.ReplicaSetCondition" - , "io.k8s.api.apps.v1beta2.ReplicaSetList" - , "io.k8s.api.apps.v1beta2.ReplicaSetSpec" - , "io.k8s.api.apps.v1beta2.ReplicaSetStatus" - , "io.k8s.api.apps.v1beta2.RollingUpdateDaemonSet" - , "io.k8s.api.apps.v1beta2.RollingUpdateDeployment" - , "io.k8s.api.apps.v1beta2.RollingUpdateStatefulSetStrategy" - , "io.k8s.api.apps.v1beta2.Scale" - , "io.k8s.api.apps.v1beta2.ScaleSpec" - , "io.k8s.api.apps.v1beta2.ScaleStatus" - , "io.k8s.api.apps.v1beta2.StatefulSet" - , "io.k8s.api.apps.v1beta2.StatefulSetCondition" - , "io.k8s.api.apps.v1beta2.StatefulSetList" - , "io.k8s.api.apps.v1beta2.StatefulSetSpec" - , "io.k8s.api.apps.v1beta2.StatefulSetStatus" - , "io.k8s.api.apps.v1beta2.StatefulSetUpdateStrategy" - , "io.k8s.api.auditregistration.v1alpha1.ServiceReference" - , "io.k8s.api.auditregistration.v1alpha1.WebhookClientConfig" - , "io.k8s.api.authentication.v1beta1.TokenReview" - , "io.k8s.api.authentication.v1beta1.TokenReviewSpec" - , "io.k8s.api.authentication.v1beta1.TokenReviewStatus" - , "io.k8s.api.authentication.v1beta1.UserInfo" - , "io.k8s.api.authorization.v1beta1.LocalSubjectAccessReview" - , "io.k8s.api.authorization.v1beta1.NonResourceAttributes" - , "io.k8s.api.authorization.v1beta1.NonResourceRule" - , "io.k8s.api.authorization.v1beta1.ResourceAttributes" - , "io.k8s.api.authorization.v1beta1.ResourceRule" - , "io.k8s.api.authorization.v1beta1.SelfSubjectAccessReview" - , "io.k8s.api.authorization.v1beta1.SelfSubjectAccessReviewSpec" - , "io.k8s.api.authorization.v1beta1.SelfSubjectRulesReview" - , "io.k8s.api.authorization.v1beta1.SelfSubjectRulesReviewSpec" - , "io.k8s.api.authorization.v1beta1.SubjectAccessReview" - , "io.k8s.api.authorization.v1beta1.SubjectAccessReviewSpec" - , "io.k8s.api.authorization.v1beta1.SubjectAccessReviewStatus" - , "io.k8s.api.authorization.v1beta1.SubjectRulesReviewStatus" - , "io.k8s.api.autoscaling.v1.CrossVersionObjectReference" - , "io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler" - , "io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerList" - , "io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec" - , "io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus" - , "io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference" - , "io.k8s.api.autoscaling.v2beta1.ExternalMetricSource" - , "io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus" - , "io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscaler" - , "io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerCondition" - , "io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerList" - , "io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerSpec" - , "io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerStatus" - , "io.k8s.api.autoscaling.v2beta1.MetricSpec" - , "io.k8s.api.autoscaling.v2beta1.MetricStatus" - , "io.k8s.api.autoscaling.v2beta1.ObjectMetricSource" - , "io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus" - , "io.k8s.api.autoscaling.v2beta1.PodsMetricSource" - , "io.k8s.api.autoscaling.v2beta1.PodsMetricStatus" - , "io.k8s.api.autoscaling.v2beta1.ResourceMetricSource" - , "io.k8s.api.autoscaling.v2beta1.ResourceMetricStatus" - , "io.k8s.api.batch.v1beta1.JobTemplateSpec" - , "io.k8s.api.batch.v2alpha1.CronJob" - , "io.k8s.api.batch.v2alpha1.CronJobList" - , "io.k8s.api.batch.v2alpha1.CronJobSpec" - , "io.k8s.api.batch.v2alpha1.CronJobStatus" - , "io.k8s.api.coordination.v1beta1.Lease" - , "io.k8s.api.coordination.v1beta1.LeaseList" - , "io.k8s.api.coordination.v1beta1.LeaseSpec" - , "io.k8s.api.events.v1beta1.Event" - , "io.k8s.api.events.v1beta1.EventList" - , "io.k8s.api.events.v1beta1.EventSeries" - , "io.k8s.api.extensions.v1beta1.AllowedCSIDriver" - , "io.k8s.api.extensions.v1beta1.AllowedFlexVolume" - , "io.k8s.api.extensions.v1beta1.AllowedHostPath" - , "io.k8s.api.extensions.v1beta1.DaemonSet" - , "io.k8s.api.extensions.v1beta1.DaemonSetCondition" - , "io.k8s.api.extensions.v1beta1.DaemonSetList" - , "io.k8s.api.extensions.v1beta1.DaemonSetSpec" - , "io.k8s.api.extensions.v1beta1.DaemonSetStatus" - , "io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy" - , "io.k8s.api.extensions.v1beta1.Deployment" - , "io.k8s.api.extensions.v1beta1.DeploymentCondition" - , "io.k8s.api.extensions.v1beta1.DeploymentList" - , "io.k8s.api.extensions.v1beta1.DeploymentRollback" - , "io.k8s.api.extensions.v1beta1.DeploymentSpec" - , "io.k8s.api.extensions.v1beta1.DeploymentStatus" - , "io.k8s.api.extensions.v1beta1.DeploymentStrategy" - , "io.k8s.api.extensions.v1beta1.FSGroupStrategyOptions" - , "io.k8s.api.extensions.v1beta1.HTTPIngressPath" - , "io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue" - , "io.k8s.api.extensions.v1beta1.HostPortRange" - , "io.k8s.api.extensions.v1beta1.IDRange" - , "io.k8s.api.extensions.v1beta1.IPBlock" - , "io.k8s.api.extensions.v1beta1.Ingress" - , "io.k8s.api.extensions.v1beta1.IngressBackend" - , "io.k8s.api.extensions.v1beta1.IngressList" - , "io.k8s.api.extensions.v1beta1.IngressRule" - , "io.k8s.api.extensions.v1beta1.IngressSpec" - , "io.k8s.api.extensions.v1beta1.IngressStatus" - , "io.k8s.api.extensions.v1beta1.IngressTLS" - , "io.k8s.api.extensions.v1beta1.NetworkPolicy" - , "io.k8s.api.extensions.v1beta1.NetworkPolicyEgressRule" - , "io.k8s.api.extensions.v1beta1.NetworkPolicyIngressRule" - , "io.k8s.api.extensions.v1beta1.NetworkPolicyList" - , "io.k8s.api.extensions.v1beta1.NetworkPolicyPeer" - , "io.k8s.api.extensions.v1beta1.NetworkPolicyPort" - , "io.k8s.api.extensions.v1beta1.NetworkPolicySpec" - , "io.k8s.api.extensions.v1beta1.PodSecurityPolicy" - , "io.k8s.api.extensions.v1beta1.PodSecurityPolicyList" - , "io.k8s.api.extensions.v1beta1.PodSecurityPolicySpec" - , "io.k8s.api.extensions.v1beta1.ReplicaSet" - , "io.k8s.api.extensions.v1beta1.ReplicaSetCondition" - , "io.k8s.api.extensions.v1beta1.ReplicaSetList" - , "io.k8s.api.extensions.v1beta1.ReplicaSetSpec" - , "io.k8s.api.extensions.v1beta1.ReplicaSetStatus" - , "io.k8s.api.extensions.v1beta1.RollbackConfig" - , "io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet" - , "io.k8s.api.extensions.v1beta1.RollingUpdateDeployment" - , "io.k8s.api.extensions.v1beta1.RunAsGroupStrategyOptions" - , "io.k8s.api.extensions.v1beta1.RunAsUserStrategyOptions" - , "io.k8s.api.extensions.v1beta1.SELinuxStrategyOptions" - , "io.k8s.api.extensions.v1beta1.Scale" - , "io.k8s.api.extensions.v1beta1.ScaleSpec" - , "io.k8s.api.extensions.v1beta1.ScaleStatus" - , "io.k8s.api.extensions.v1beta1.SupplementalGroupsStrategyOptions" - , "io.k8s.api.node.v1alpha1.RuntimeClass" - , "io.k8s.api.node.v1alpha1.RuntimeClassList" - , "io.k8s.api.rbac.v1alpha1.AggregationRule" - , "io.k8s.api.rbac.v1alpha1.ClusterRole" - , "io.k8s.api.rbac.v1alpha1.ClusterRoleBinding" - , "io.k8s.api.rbac.v1alpha1.ClusterRoleBindingList" - , "io.k8s.api.rbac.v1alpha1.ClusterRoleList" - , "io.k8s.api.rbac.v1alpha1.PolicyRule" - , "io.k8s.api.rbac.v1alpha1.Role" - , "io.k8s.api.rbac.v1alpha1.RoleBinding" - , "io.k8s.api.rbac.v1alpha1.RoleBindingList" - , "io.k8s.api.rbac.v1alpha1.RoleList" - , "io.k8s.api.rbac.v1alpha1.RoleRef" - , "io.k8s.api.rbac.v1alpha1.Subject" - , "io.k8s.api.rbac.v1beta1.AggregationRule" - , "io.k8s.api.rbac.v1beta1.ClusterRole" - , "io.k8s.api.rbac.v1beta1.ClusterRoleBinding" - , "io.k8s.api.rbac.v1beta1.ClusterRoleBindingList" - , "io.k8s.api.rbac.v1beta1.ClusterRoleBindingList" - , "io.k8s.api.rbac.v1beta1.ClusterRoleList" - , "io.k8s.api.rbac.v1beta1.PolicyRule" - , "io.k8s.api.rbac.v1beta1.Role" - , "io.k8s.api.rbac.v1beta1.RoleBinding" - , "io.k8s.api.rbac.v1beta1.RoleBindingList" - , "io.k8s.api.rbac.v1beta1.RoleList" - , "io.k8s.api.rbac.v1beta1.RoleRef" - , "io.k8s.api.rbac.v1beta1.Subject" - , "io.k8s.api.scheduling.v1alpha1.PriorityClass" - , "io.k8s.api.scheduling.v1alpha1.PriorityClassList" - , "io.k8s.api.scheduling.v1beta1.PriorityClass" - , "io.k8s.api.scheduling.v1beta1.PriorityClassList" - , "io.k8s.api.storage.v1alpha1.VolumeAttachment" - , "io.k8s.api.storage.v1alpha1.VolumeAttachmentList" - , "io.k8s.api.storage.v1alpha1.VolumeAttachmentSource" - , "io.k8s.api.storage.v1alpha1.VolumeAttachmentSpec" - , "io.k8s.api.storage.v1alpha1.VolumeAttachmentStatus" - , "io.k8s.api.storage.v1alpha1.VolumeError" - , "io.k8s.api.storage.v1beta1.StorageClass" - , "io.k8s.api.storage.v1beta1.StorageClassList" - , "io.k8s.api.storage.v1beta1.VolumeAttachment" - , "io.k8s.api.storage.v1beta1.VolumeAttachmentList" - , "io.k8s.api.storage.v1beta1.VolumeAttachmentSource" - , "io.k8s.api.storage.v1beta1.VolumeAttachmentSpec" - , "io.k8s.api.storage.v1beta1.VolumeAttachmentStatus" - , "io.k8s.api.storage.v1beta1.VolumeError" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceColumnDefinition" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceConversion" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinition" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionCondition" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionList" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionNames" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionSpec" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionStatus" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionVersion" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceScale" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceStatus" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresources" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceValidation" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ServiceReference" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.WebhookClientConfig" - , "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIServiceCondition" - , "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIServiceList" - , "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIServiceSpec" - , "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIServiceStatus" - , "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.ServiceReference" - , "io.k8s.api.discovery.v1alpha1.EndpointPort" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ExternalDocumentation" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrStringArray" - , "io.k8s.api.admissionregistration.v1beta1.MutatingWebhook" - , "io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfiguration" - , "io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfigurationList" - , "io.k8s.api.node.v1alpha1.Overhead" - , "io.k8s.api.admissionregistration.v1beta1.RuleWithOperations" - , "io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions" - , "io.k8s.api.node.v1alpha1.Scheduling" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ServiceReference" - , "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.ServiceReference" - , "io.k8s.api.admissionregistration.v1beta1.ValidatingWebhook" - , "io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfiguration" - , "io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfigurationList" - , "io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig" - , "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig" - ] diff --git a/dhall-kubernetes-generator/src/Main.hs b/dhall-kubernetes-generator/src/Main.hs index 10ae36d4..19ca945c 100644 --- a/dhall-kubernetes-generator/src/Main.hs +++ b/dhall-kubernetes-generator/src/Main.hs @@ -3,30 +3,34 @@ module Main (main) where +import Control.Applicative.Combinators (sepBy1, option) +import Data.Aeson (decodeFileStrict) +import Data.Bifunctor (bimap) +import Data.Foldable (for_) +import Data.Text (Text, pack) +import Data.Void (Void) +import Dhall.Kubernetes.Data (patchCyclicImports) +import Dhall.Kubernetes.Types +import Numeric.Natural (Natural) +import Text.Megaparsec (Parsec, some, parse, (<|>), errorBundlePretty) +import Text.Megaparsec.Char (char, alphaNumChar) + +import qualified Data.List as List +import qualified Data.Ord as Ord import qualified Data.Map.Strict as Data.Map import qualified Data.Text as Text import qualified Data.Text.Prettyprint.Doc as Pretty import qualified Data.Text.Prettyprint.Doc.Render.Text as PrettyText import qualified Dhall.Core as Dhall import qualified Dhall.Format +import qualified Dhall.Kubernetes.Convert as Convert +import qualified Dhall.Parser import qualified Dhall.Pretty import qualified Dhall.Util -import qualified Turtle - -import Data.Aeson (decodeFileStrict) -import Data.Bifunctor (bimap) -import Data.Foldable (for_) -import Data.Text (Text, pack) import qualified Options.Applicative -import Control.Applicative.Combinators (sepBy1, option) -import Text.Megaparsec (some, parse, (<|>), errorBundlePretty) -import Text.Megaparsec.Char (char, alphaNumChar) - -import qualified Dhall.Kubernetes.Convert as Convert -import Dhall.Kubernetes.Data (patchCyclicImports) -import qualified Dhall.Parser -import Dhall.Kubernetes.Types - +import qualified Text.Megaparsec as Megaparsec +import qualified Text.Megaparsec.Char.Lexer as Megaparsec.Lexer +import qualified Turtle -- | Top-level program options data Options = Options @@ -64,8 +68,70 @@ echo = Turtle.printf (Turtle.s Turtle.% "\n") echoStr :: Turtle.MonadIO m => String -> m () echoStr = echo . Text.pack -errorOnDuplicateHandler :: DuplicateHandler -errorOnDuplicateHandler (kind, names) = error $ "Got more than one key for "++ show kind ++"! See:\n" <> show names +data Stability = Alpha Natural | Beta Natural | Production deriving (Eq, Ord) + +data Version = Version + { version :: Natural + , stability :: Stability + } deriving (Eq, Ord) + +parseStability :: Parsec Void Text Stability +parseStability = parseAlpha <|> parseBeta <|> parseProduction + where + parseAlpha = do + _ <- "alpha" + + n <- Megaparsec.Lexer.decimal + + return (Alpha n) + + parseBeta = do + _ <- "beta" + + n <- Megaparsec.Lexer.decimal + + return (Beta n) + + parseProduction = do + return Production + +parseVersion :: Parsec Void Text Version +parseVersion = Megaparsec.try parseSuffix <|> parsePrefix + where + parseComponent = do + Megaparsec.takeWhile1P (Just "not a period") (/= '.') + + parseSuffix = do + _ <- "v" + + version <- Megaparsec.Lexer.decimal + + stability <- parseStability + + _ <- "." + + _ <- parseComponent + + Megaparsec.eof + + return Version{..} + + parsePrefix = do + _ <- parseComponent + + _ <- "." + + parseVersion + +getVersion :: ModelName -> Version +getVersion ModelName{..} = + case Megaparsec.parse parseVersion "" unModelName of + Left errors -> error (show errors) + Right version -> version + +preferStableResource :: DuplicateHandler +preferStableResource (_, names) = + return (List.maximumBy (Ord.comparing getVersion) names) skipDuplicatesHandler :: DuplicateHandler skipDuplicatesHandler = const Nothing @@ -118,7 +184,12 @@ parserInfoOptions = main :: IO () main = do Options{..} <- Options.Applicative.execParser parserInfoOptions - let duplicateHandler = if skipDuplicates then skipDuplicatesHandler else errorOnDuplicateHandler + + let duplicateHandler = + if skipDuplicates + then skipDuplicatesHandler + else preferStableResource + -- Get the Swagger spec Swagger{..} <- do swaggerFile <- decodeFileStrict filename diff --git a/examples/aws-iam-authenticator-chart.dhall b/examples/aws-iam-authenticator-chart.dhall index 90887c43..d66df8a6 100644 --- a/examples/aws-iam-authenticator-chart.dhall +++ b/examples/aws-iam-authenticator-chart.dhall @@ -1,5 +1,5 @@ let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let release = "wintering-rodent" diff --git a/examples/deployment.dhall b/examples/deployment.dhall index 4c8d393b..c746d7c7 100644 --- a/examples/deployment.dhall +++ b/examples/deployment.dhall @@ -1,5 +1,5 @@ let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let kv = (../Prelude.dhall).JSON.keyText diff --git a/examples/deploymentSimple.dhall b/examples/deploymentSimple.dhall index 1e5f65c0..05d835d9 100644 --- a/examples/deploymentSimple.dhall +++ b/examples/deploymentSimple.dhall @@ -1,5 +1,5 @@ let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let deployment = kubernetes.Deployment::{ diff --git a/examples/ingress.dhall b/examples/ingress.dhall index cde44bbc..c9851df0 100644 --- a/examples/ingress.dhall +++ b/examples/ingress.dhall @@ -5,7 +5,7 @@ let map = Prelude.List.map let kv = Prelude.JSON.keyText let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let Service = { name : Text, host : Text, version : Text } diff --git a/examples/service.dhall b/examples/service.dhall index e3313264..ca0fd40a 100644 --- a/examples/service.dhall +++ b/examples/service.dhall @@ -1,5 +1,5 @@ let kubernetes = - ../package.dhall sha256:2c7ac35494f16b1f39afcf3467b2f3b0ab579edb0c711cddd2c93f1cbed358bd + ../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a let kv = (../Prelude.dhall).JSON.keyText diff --git a/package.dhall b/package.dhall index e993cd6f..6a5affef 100644 --- a/package.dhall +++ b/package.dhall @@ -1,7 +1,7 @@ - ./schemas.dhall sha256:ef1262e4f1762fd156ab530e63dc7b5b873fc8a0b79757c65edd8062ce7997b8 + ./schemas.dhall sha256:4269707d831794c130dfc75b0e511e657356adcc46653cd4c22de8a6a7e66b65 ∧ { IntOrString = - ( ./types.dhall sha256:97e57bbaecf2894e86bd61a8111761ce9a4154545b79257a0e86604bae568b6f + ( ./types.dhall sha256:d750783ee3c79b2e932de83fdcae3a474532c8ca6b8dcab158c85123fe1fa69a ).IntOrString , Resource = - ./typesUnion.dhall sha256:05cfefb54e234ed7f309ee5d74022c94ee692a4912d716fb444e6edea13c73a3 + ./typesUnion.dhall sha256:1bb630d6052145e99c243eb66a51f3572903e7d59e49174a9561311e85b4207a } diff --git a/schemas.dhall b/schemas.dhall index c45d1983..c66d10a4 100644 --- a/schemas.dhall +++ b/schemas.dhall @@ -6,16 +6,12 @@ ./schemas/io.k8s.api.admissionregistration.v1.MutatingWebhookConfigurationList.dhall sha256:8d54ca16e2ef52f00c884f1189fad00440a9eb554897764f643c2ab881a5fde4 , RuleWithOperations = ./schemas/io.k8s.api.admissionregistration.v1.RuleWithOperations.dhall sha256:f3ee2991090285b77a2873eaba9ca468b82c7645fe6dcfbbfa022761a77f9b44 -, ServiceReference = - ./schemas/io.k8s.api.admissionregistration.v1.ServiceReference.dhall sha256:0919534228f3771840467c1a7f35eb02ed04d51309640d8af9068dfc901d0576 , ValidatingWebhook = ./schemas/io.k8s.api.admissionregistration.v1.ValidatingWebhook.dhall sha256:a5314931d5f4cfd34be373d6f58b0bd953ce958db6a6d9ed9a097ddc2429ec15 , ValidatingWebhookConfiguration = ./schemas/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration.dhall sha256:f5247aa5f9c2d6625df815e8d590f3d916a83dce2c965e6c5ced8f06073c3d45 , ValidatingWebhookConfigurationList = ./schemas/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfigurationList.dhall sha256:46c9609daca096e49f3993a236d53808365e65ac022f57905df311df4320b368 -, WebhookClientConfig = - ./schemas/io.k8s.api.admissionregistration.v1.WebhookClientConfig.dhall sha256:67c666b4afb7381da53f1aa7169c48666f426c0882f2c58b3edd6b8281c6a665 , ControllerRevision = ./schemas/io.k8s.api.apps.v1.ControllerRevision.dhall sha256:90c6c9f1868f80d8ac3feda62bb8e3a2f4ea6bdca83e00881a0bc0cf7c35294b , ControllerRevisionList = @@ -72,10 +68,6 @@ ./schemas/io.k8s.api.apps.v1.StatefulSetStatus.dhall sha256:6554d50b615e34ee9a4e335c27b65712bb2acf7aaa29673c7772971dec1b0c52 , StatefulSetUpdateStrategy = ./schemas/io.k8s.api.apps.v1.StatefulSetUpdateStrategy.dhall sha256:a5a573cae08ac68893ed009e80813ae74da8549ed2dc158967a98310eb256f06 -, DeploymentRollback = - ./schemas/io.k8s.api.apps.v1beta1.DeploymentRollback.dhall sha256:fe5763deedc6231826e0f5e16911301b8de660e34b40abe206443587f3dd2a3a -, RollbackConfig = - ./schemas/io.k8s.api.apps.v1beta1.RollbackConfig.dhall sha256:dea803cfc54d7b85d0dc8f4c3ef7c5510c45aeee2918b7b47900a5c94f211d8c , AuditSink = ./schemas/io.k8s.api.auditregistration.v1alpha1.AuditSink.dhall sha256:5bb64f4f81b8cfdc123663d7a26875270641a06026877aab4e462795bba95104 , AuditSinkList = @@ -185,13 +177,13 @@ , JobStatus = ./schemas/io.k8s.api.batch.v1.JobStatus.dhall sha256:aac9bd4f987b2e8705d0795ebed197f46a8da1224c0f78c0391cc6ac93f373f2 , CronJob = - ./schemas/io.k8s.api.batch.v1beta1.CronJob.dhall sha256:b7bc2521ef3857101360e4df97030d694617ff14dd3bf3f91bc39a871e3d15dd + ./schemas/io.k8s.api.batch.v2alpha1.CronJob.dhall sha256:6b985debf948a9de7271df0e7f83cd979a19808877a15f7fad4622b70dcb7fef , CronJobList = - ./schemas/io.k8s.api.batch.v1beta1.CronJobList.dhall sha256:418d08e5947d5692f98b7a4bd3d794ae618dbd182b901180f38fe6f80e52744f + ./schemas/io.k8s.api.batch.v2alpha1.CronJobList.dhall sha256:6bff4ea8ca7fd1ccb6055183985de7b3e976f2df1aa68df8ba23ad32d0a973f7 , CronJobSpec = - ./schemas/io.k8s.api.batch.v1beta1.CronJobSpec.dhall sha256:d1597da01ef47707d78e28e60812064bbdd7daadbd2e7dafcba6ca364b0b2608 + ./schemas/io.k8s.api.batch.v2alpha1.CronJobSpec.dhall sha256:d1597da01ef47707d78e28e60812064bbdd7daadbd2e7dafcba6ca364b0b2608 , CronJobStatus = - ./schemas/io.k8s.api.batch.v1beta1.CronJobStatus.dhall sha256:8a7e5324c4646d2bab98c167e1d852ddb57a3bb70b4b460e6afd3df1b5d8230f + ./schemas/io.k8s.api.batch.v2alpha1.CronJobStatus.dhall sha256:8a7e5324c4646d2bab98c167e1d852ddb57a3bb70b4b460e6afd3df1b5d8230f , JobTemplateSpec = ./schemas/io.k8s.api.batch.v2alpha1.JobTemplateSpec.dhall sha256:a3f9572614ac05a8677d2c380b386e893def93b926953f2f4b6d5c67ba9e7b96 , CertificateSigningRequest = @@ -586,8 +578,10 @@ ./schemas/io.k8s.api.discovery.v1alpha1.EndpointSlice.dhall sha256:58743f9233b50283eb870adf39874f395d29217fa83ce0414c3020f36165b928 , EndpointSliceList = ./schemas/io.k8s.api.discovery.v1alpha1.EndpointSliceList.dhall sha256:118ed0ec331f75a54a13ba3240b8e5ba649b9dc86fb03b1a56561f9e08fdb63d -, RuntimeClassStrategyOptions = - ./schemas/io.k8s.api.extensions.v1beta1.RuntimeClassStrategyOptions.dhall sha256:99a46531c07034324f010ef98893df531bb90d34c7ee95f06f036341a63ddd33 +, DeploymentRollback = + ./schemas/io.k8s.api.extensions.v1beta1.DeploymentRollback.dhall sha256:14e139270452a99a484cebb6c73c50ea4d820221946de06f4221ce243eb8a704 +, RollbackConfig = + ./schemas/io.k8s.api.extensions.v1beta1.RollbackConfig.dhall sha256:dea803cfc54d7b85d0dc8f4c3ef7c5510c45aeee2918b7b47900a5c94f211d8c , IPBlock = ./schemas/io.k8s.api.networking.v1.IPBlock.dhall sha256:f83bc01f054743419619fbd944659c4226b2a4693de8ff672ee7fbb3204c79ef , NetworkPolicy = @@ -664,6 +658,8 @@ ./schemas/io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions.dhall sha256:43d4f4120fe23beeb5680b4d381db91066e024107e651df75d848cec041d2e71 , RunAsUserStrategyOptions = ./schemas/io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions.dhall sha256:43d4f4120fe23beeb5680b4d381db91066e024107e651df75d848cec041d2e71 +, RuntimeClassStrategyOptions = + ./schemas/io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions.dhall sha256:99a46531c07034324f010ef98893df531bb90d34c7ee95f06f036341a63ddd33 , SELinuxStrategyOptions = ./schemas/io.k8s.api.policy.v1beta1.SELinuxStrategyOptions.dhall sha256:f1f3e2fc14a7017ecf1c3108719ae66819bf416e38bb8f6ac9c7827aa00bee82 , SupplementalGroupsStrategyOptions = @@ -770,6 +766,8 @@ ./schemas/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool.dhall sha256:81a1bf11fb9dc588941bd83400ed571298585a700a53e858456806f7ea3b8ce2 , JSONSchemaPropsOrStringArray = ./schemas/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray.dhall sha256:81a1bf11fb9dc588941bd83400ed571298585a700a53e858456806f7ea3b8ce2 +, WebhookClientConfig = + ./schemas/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig.dhall sha256:67c666b4afb7381da53f1aa7169c48666f426c0882f2c58b3edd6b8281c6a665 , WebhookConversion = ./schemas/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion.dhall sha256:e9357d044833142666bca848d8c4f3a7e6911edb613293393cea7cbf95fdb0c7 , APIGroup = @@ -822,4 +820,6 @@ ./schemas/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceSpec.dhall sha256:9a7933d647b37e29738901e7907a398fca8e50403a7d21bb14d77f0fc4f034c1 , APIServiceStatus = ./schemas/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceStatus.dhall sha256:e2c26cc6686c20ae4c1483740a49e1564afd1b0786175f1f7ff16b2af028345c +, ServiceReference = + ./schemas/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.ServiceReference.dhall sha256:9f76b3a3f72bc711f596f585cadae06b6d3401ac07a9280b0f5ba1cb1e101279 } diff --git a/types.dhall b/types.dhall index 259f2f92..6ecd7103 100644 --- a/types.dhall +++ b/types.dhall @@ -6,16 +6,12 @@ ./types/io.k8s.api.admissionregistration.v1.MutatingWebhookConfigurationList.dhall sha256:0496422ab00f0a5ee01cb425a5021119ca525235f77f8a28520538115a18bd56 , RuleWithOperations = ./types/io.k8s.api.admissionregistration.v1.RuleWithOperations.dhall sha256:36a526978601e8c9dd44c837045320d0e350f660cd14a938c2448baf013ce7ee -, ServiceReference = - ./types/io.k8s.api.admissionregistration.v1.ServiceReference.dhall sha256:075bf53099b54d0b509b5f7d21aee9535d68aaf259891de18801f04d442a3c5a , ValidatingWebhook = ./types/io.k8s.api.admissionregistration.v1.ValidatingWebhook.dhall sha256:f3a2c672a6f9b8fd81a132bd34bab2bf29d1545dfc95e747a89b7f9701dac757 , ValidatingWebhookConfiguration = ./types/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration.dhall sha256:41d8969ea0f1c32564c8ce47d6bd669f276c2755ce0fd0d16c687e0be32aed5d , ValidatingWebhookConfigurationList = ./types/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfigurationList.dhall sha256:4ac39bca8b017f829e78e4bdbbf60acea7427c3a19d2c6417f2db5b7760ae4ab -, WebhookClientConfig = - ./types/io.k8s.api.admissionregistration.v1.WebhookClientConfig.dhall sha256:e65d81831ebd9f944992c1654a3b4bb83579ed4286759e18db4c83dc5613a9ce , ControllerRevision = ./types/io.k8s.api.apps.v1.ControllerRevision.dhall sha256:c55277680b6e1addb1fafbb1fcef71a80e27dc0127114d1d6246ac96fe81f0d7 , ControllerRevisionList = @@ -72,10 +68,6 @@ ./types/io.k8s.api.apps.v1.StatefulSetStatus.dhall sha256:c9a37e2b617a60e503a78d58e1fb0e424b0f0292a8f8d953ba09b6c7659a8270 , StatefulSetUpdateStrategy = ./types/io.k8s.api.apps.v1.StatefulSetUpdateStrategy.dhall sha256:d08c454bcb0d610e0214fddc4be030889842e15051c8e0e075ed55964224df85 -, DeploymentRollback = - ./types/io.k8s.api.apps.v1beta1.DeploymentRollback.dhall sha256:2e98f5c5ecfa23f844e223af9d4765d53cb501239e7e8abe34611f1ea3c41946 -, RollbackConfig = - ./types/io.k8s.api.apps.v1beta1.RollbackConfig.dhall sha256:fd75ab6fa553f049cc08ba4c763a1e3ca1865be1ded9446c769395409d528077 , AuditSink = ./types/io.k8s.api.auditregistration.v1alpha1.AuditSink.dhall sha256:fb514cab1be9e2be23c272e534fb1e1d2aad4186b4a36012d7ddf6ff51badae6 , AuditSinkList = @@ -185,13 +177,13 @@ , JobStatus = ./types/io.k8s.api.batch.v1.JobStatus.dhall sha256:f9ea74adce4426e2277120d8427b62ca553e6a57274469139665a59801f8e1cd , CronJob = - ./types/io.k8s.api.batch.v1beta1.CronJob.dhall sha256:1b69374e7d3b203f11737be704442167e0ea3de1f6a5390508416bb7fa74a6b2 + ./types/io.k8s.api.batch.v2alpha1.CronJob.dhall sha256:1b69374e7d3b203f11737be704442167e0ea3de1f6a5390508416bb7fa74a6b2 , CronJobList = - ./types/io.k8s.api.batch.v1beta1.CronJobList.dhall sha256:5e56f77f4bb3c3b6b7313b6bf78a2af4520e917d2e0c9685d90d0bce3543a213 + ./types/io.k8s.api.batch.v2alpha1.CronJobList.dhall sha256:5e56f77f4bb3c3b6b7313b6bf78a2af4520e917d2e0c9685d90d0bce3543a213 , CronJobSpec = - ./types/io.k8s.api.batch.v1beta1.CronJobSpec.dhall sha256:c51f71a4cdfa751236203b7c8b173636356b9b5b8b5a24d35196fea1b8f01218 + ./types/io.k8s.api.batch.v2alpha1.CronJobSpec.dhall sha256:c51f71a4cdfa751236203b7c8b173636356b9b5b8b5a24d35196fea1b8f01218 , CronJobStatus = - ./types/io.k8s.api.batch.v1beta1.CronJobStatus.dhall sha256:bde64bf966a728236e65593d21075a7f13c954793b7676d628b53594c2619b92 + ./types/io.k8s.api.batch.v2alpha1.CronJobStatus.dhall sha256:bde64bf966a728236e65593d21075a7f13c954793b7676d628b53594c2619b92 , JobTemplateSpec = ./types/io.k8s.api.batch.v2alpha1.JobTemplateSpec.dhall sha256:35df6b5c77f77cce9e11aeaebdb481499437c9d3aad6c57e4ad95232e17c41f6 , CertificateSigningRequest = @@ -586,8 +578,10 @@ ./types/io.k8s.api.discovery.v1alpha1.EndpointSlice.dhall sha256:df8d3e78fb8ab34b4dea82f13d408498985abdb0c3bdbb351b4a09d49e1e7933 , EndpointSliceList = ./types/io.k8s.api.discovery.v1alpha1.EndpointSliceList.dhall sha256:b3d7ee2756a4046630a1e28062e90f3fc10067c2871e124ceb00861cb2187844 -, RuntimeClassStrategyOptions = - ./types/io.k8s.api.extensions.v1beta1.RuntimeClassStrategyOptions.dhall sha256:84e3fb0c0fbdc37bbb410a74bf5fa4ab3e42843ccf5f4aedd1df361e55abdae6 +, DeploymentRollback = + ./types/io.k8s.api.extensions.v1beta1.DeploymentRollback.dhall sha256:2e98f5c5ecfa23f844e223af9d4765d53cb501239e7e8abe34611f1ea3c41946 +, RollbackConfig = + ./types/io.k8s.api.extensions.v1beta1.RollbackConfig.dhall sha256:fd75ab6fa553f049cc08ba4c763a1e3ca1865be1ded9446c769395409d528077 , IPBlock = ./types/io.k8s.api.networking.v1.IPBlock.dhall sha256:955e947b368b10d732f3ab2da1930e08ccb73e42db32cbbd65067dd7be73de62 , NetworkPolicy = @@ -664,6 +658,8 @@ ./types/io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions.dhall sha256:eed3ff916ff754f69b2d05f5d4c49254ea8561c6b1f02237515dac196108cb34 , RunAsUserStrategyOptions = ./types/io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions.dhall sha256:eed3ff916ff754f69b2d05f5d4c49254ea8561c6b1f02237515dac196108cb34 +, RuntimeClassStrategyOptions = + ./types/io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions.dhall sha256:84e3fb0c0fbdc37bbb410a74bf5fa4ab3e42843ccf5f4aedd1df361e55abdae6 , SELinuxStrategyOptions = ./types/io.k8s.api.policy.v1beta1.SELinuxStrategyOptions.dhall sha256:64c91dabb86504c79bd00ebe73650b7ea064b55a7ba6360aba59c3f4b500844c , SupplementalGroupsStrategyOptions = @@ -772,6 +768,8 @@ ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool.dhall sha256:0912602a19e01dcff30f351958d2d9b69519c9be61b57b1b32a2a569bf8bf5f9 , JSONSchemaPropsOrStringArray = ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray.dhall sha256:0912602a19e01dcff30f351958d2d9b69519c9be61b57b1b32a2a569bf8bf5f9 +, WebhookClientConfig = + ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig.dhall sha256:e65d81831ebd9f944992c1654a3b4bb83579ed4286759e18db4c83dc5613a9ce , WebhookConversion = ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion.dhall sha256:199170ecdee498f0f981ea55cff7539d4f7861d0d8b272a4f9a782ff6e261217 , Quantity = @@ -838,4 +836,6 @@ ./types/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceSpec.dhall sha256:ca6b19e83944739ca2c7f8fefa6efce503fb3186dff921d605804bf98b3b1a3a , APIServiceStatus = ./types/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceStatus.dhall sha256:302659b275ad69fa816e075c5bf48d1b9796537a20880412e8172756cd06fa11 +, ServiceReference = + ./types/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.ServiceReference.dhall sha256:a6120fee8a715bb8007f527166643eb5df3f7e527270308c9895748d4ed8dea4 } diff --git a/typesUnion.dhall b/typesUnion.dhall index 8316c3c2..8059a95a 100644 --- a/typesUnion.dhall +++ b/typesUnion.dhall @@ -6,16 +6,12 @@ ./types/io.k8s.api.admissionregistration.v1.MutatingWebhookConfigurationList.dhall sha256:0496422ab00f0a5ee01cb425a5021119ca525235f77f8a28520538115a18bd56 | RuleWithOperations : ./types/io.k8s.api.admissionregistration.v1.RuleWithOperations.dhall sha256:36a526978601e8c9dd44c837045320d0e350f660cd14a938c2448baf013ce7ee -| ServiceReference : - ./types/io.k8s.api.admissionregistration.v1.ServiceReference.dhall sha256:075bf53099b54d0b509b5f7d21aee9535d68aaf259891de18801f04d442a3c5a | ValidatingWebhook : ./types/io.k8s.api.admissionregistration.v1.ValidatingWebhook.dhall sha256:f3a2c672a6f9b8fd81a132bd34bab2bf29d1545dfc95e747a89b7f9701dac757 | ValidatingWebhookConfiguration : ./types/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration.dhall sha256:41d8969ea0f1c32564c8ce47d6bd669f276c2755ce0fd0d16c687e0be32aed5d | ValidatingWebhookConfigurationList : ./types/io.k8s.api.admissionregistration.v1.ValidatingWebhookConfigurationList.dhall sha256:4ac39bca8b017f829e78e4bdbbf60acea7427c3a19d2c6417f2db5b7760ae4ab -| WebhookClientConfig : - ./types/io.k8s.api.admissionregistration.v1.WebhookClientConfig.dhall sha256:e65d81831ebd9f944992c1654a3b4bb83579ed4286759e18db4c83dc5613a9ce | ControllerRevision : ./types/io.k8s.api.apps.v1.ControllerRevision.dhall sha256:c55277680b6e1addb1fafbb1fcef71a80e27dc0127114d1d6246ac96fe81f0d7 | ControllerRevisionList : @@ -72,10 +68,6 @@ ./types/io.k8s.api.apps.v1.StatefulSetStatus.dhall sha256:c9a37e2b617a60e503a78d58e1fb0e424b0f0292a8f8d953ba09b6c7659a8270 | StatefulSetUpdateStrategy : ./types/io.k8s.api.apps.v1.StatefulSetUpdateStrategy.dhall sha256:d08c454bcb0d610e0214fddc4be030889842e15051c8e0e075ed55964224df85 -| DeploymentRollback : - ./types/io.k8s.api.apps.v1beta1.DeploymentRollback.dhall sha256:2e98f5c5ecfa23f844e223af9d4765d53cb501239e7e8abe34611f1ea3c41946 -| RollbackConfig : - ./types/io.k8s.api.apps.v1beta1.RollbackConfig.dhall sha256:fd75ab6fa553f049cc08ba4c763a1e3ca1865be1ded9446c769395409d528077 | AuditSink : ./types/io.k8s.api.auditregistration.v1alpha1.AuditSink.dhall sha256:fb514cab1be9e2be23c272e534fb1e1d2aad4186b4a36012d7ddf6ff51badae6 | AuditSinkList : @@ -185,13 +177,13 @@ | JobStatus : ./types/io.k8s.api.batch.v1.JobStatus.dhall sha256:f9ea74adce4426e2277120d8427b62ca553e6a57274469139665a59801f8e1cd | CronJob : - ./types/io.k8s.api.batch.v1beta1.CronJob.dhall sha256:1b69374e7d3b203f11737be704442167e0ea3de1f6a5390508416bb7fa74a6b2 + ./types/io.k8s.api.batch.v2alpha1.CronJob.dhall sha256:1b69374e7d3b203f11737be704442167e0ea3de1f6a5390508416bb7fa74a6b2 | CronJobList : - ./types/io.k8s.api.batch.v1beta1.CronJobList.dhall sha256:5e56f77f4bb3c3b6b7313b6bf78a2af4520e917d2e0c9685d90d0bce3543a213 + ./types/io.k8s.api.batch.v2alpha1.CronJobList.dhall sha256:5e56f77f4bb3c3b6b7313b6bf78a2af4520e917d2e0c9685d90d0bce3543a213 | CronJobSpec : - ./types/io.k8s.api.batch.v1beta1.CronJobSpec.dhall sha256:c51f71a4cdfa751236203b7c8b173636356b9b5b8b5a24d35196fea1b8f01218 + ./types/io.k8s.api.batch.v2alpha1.CronJobSpec.dhall sha256:c51f71a4cdfa751236203b7c8b173636356b9b5b8b5a24d35196fea1b8f01218 | CronJobStatus : - ./types/io.k8s.api.batch.v1beta1.CronJobStatus.dhall sha256:bde64bf966a728236e65593d21075a7f13c954793b7676d628b53594c2619b92 + ./types/io.k8s.api.batch.v2alpha1.CronJobStatus.dhall sha256:bde64bf966a728236e65593d21075a7f13c954793b7676d628b53594c2619b92 | JobTemplateSpec : ./types/io.k8s.api.batch.v2alpha1.JobTemplateSpec.dhall sha256:35df6b5c77f77cce9e11aeaebdb481499437c9d3aad6c57e4ad95232e17c41f6 | CertificateSigningRequest : @@ -586,8 +578,10 @@ ./types/io.k8s.api.discovery.v1alpha1.EndpointSlice.dhall sha256:df8d3e78fb8ab34b4dea82f13d408498985abdb0c3bdbb351b4a09d49e1e7933 | EndpointSliceList : ./types/io.k8s.api.discovery.v1alpha1.EndpointSliceList.dhall sha256:b3d7ee2756a4046630a1e28062e90f3fc10067c2871e124ceb00861cb2187844 -| RuntimeClassStrategyOptions : - ./types/io.k8s.api.extensions.v1beta1.RuntimeClassStrategyOptions.dhall sha256:84e3fb0c0fbdc37bbb410a74bf5fa4ab3e42843ccf5f4aedd1df361e55abdae6 +| DeploymentRollback : + ./types/io.k8s.api.extensions.v1beta1.DeploymentRollback.dhall sha256:2e98f5c5ecfa23f844e223af9d4765d53cb501239e7e8abe34611f1ea3c41946 +| RollbackConfig : + ./types/io.k8s.api.extensions.v1beta1.RollbackConfig.dhall sha256:fd75ab6fa553f049cc08ba4c763a1e3ca1865be1ded9446c769395409d528077 | IPBlock : ./types/io.k8s.api.networking.v1.IPBlock.dhall sha256:955e947b368b10d732f3ab2da1930e08ccb73e42db32cbbd65067dd7be73de62 | NetworkPolicy : @@ -664,6 +658,8 @@ ./types/io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions.dhall sha256:eed3ff916ff754f69b2d05f5d4c49254ea8561c6b1f02237515dac196108cb34 | RunAsUserStrategyOptions : ./types/io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions.dhall sha256:eed3ff916ff754f69b2d05f5d4c49254ea8561c6b1f02237515dac196108cb34 +| RuntimeClassStrategyOptions : + ./types/io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions.dhall sha256:84e3fb0c0fbdc37bbb410a74bf5fa4ab3e42843ccf5f4aedd1df361e55abdae6 | SELinuxStrategyOptions : ./types/io.k8s.api.policy.v1beta1.SELinuxStrategyOptions.dhall sha256:64c91dabb86504c79bd00ebe73650b7ea064b55a7ba6360aba59c3f4b500844c | SupplementalGroupsStrategyOptions : @@ -772,6 +768,8 @@ ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool.dhall sha256:0912602a19e01dcff30f351958d2d9b69519c9be61b57b1b32a2a569bf8bf5f9 | JSONSchemaPropsOrStringArray : ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray.dhall sha256:0912602a19e01dcff30f351958d2d9b69519c9be61b57b1b32a2a569bf8bf5f9 +| WebhookClientConfig : + ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig.dhall sha256:e65d81831ebd9f944992c1654a3b4bb83579ed4286759e18db4c83dc5613a9ce | WebhookConversion : ./types/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion.dhall sha256:199170ecdee498f0f981ea55cff7539d4f7861d0d8b272a4f9a782ff6e261217 | Quantity : @@ -838,4 +836,6 @@ ./types/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceSpec.dhall sha256:ca6b19e83944739ca2c7f8fefa6efce503fb3186dff921d605804bf98b3b1a3a | APIServiceStatus : ./types/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceStatus.dhall sha256:302659b275ad69fa816e075c5bf48d1b9796537a20880412e8172756cd06fa11 +| ServiceReference : + ./types/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.ServiceReference.dhall sha256:a6120fee8a715bb8007f527166643eb5df3f7e527270308c9895748d4ed8dea4 >