-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LabelSelector type-checks with empty component Lists #78
Comments
@ari-becker I think this is another case in which the Swagger types are "lying" (see #8), and we should integrate that type information by hand here: dhall-kubernetes/dhall-kubernetes-generator/src/Dhall/Kubernetes/Convert.hs Lines 42 to 47 in 4ad5815
|
Reading the Kubernetes API documentation:
It sounds to me like this is really another instance where #77 comes to bear. |
I think this is an instantiation of https://stackoverflow.com/questions/50309057/what-is-the-purpose-of-a-kubernetes-deployment-pod-selector (See first answer). It used to be the case that About it being an instantiaton of #77 . This is a bit more funky than that. In this case it is valid for both of them to be defined or one of them to be defined. #77 is about mutually exclusive values mostly. The However I'm not sure how we would translate an |
The other ugly thing here is that matchLabels :: [(string, string)] -> [LabelSelectorRequirement] e.g.: matchLabels:
app: arians-cool-app
env: production is the same as: matchExpressions:
- key: app
operator: In
values:
- arians-cool-app
- key: env
operator: In
values:
- production |
This is fixed by #110 as the |
I'm currently trying to fit external-dns into our Dhall-ified pipeline, and I replicated the mistake in their tutorial wherein a
DeploymentSpec
is created without aLabelSelector
(since theirDeployment
doesn't have any labels in itsmetadata
).Currently, a
DeploymentSpec
bundles in its own defaultLabelSelector
, which bundles in empty lists formatchLabels
andmatchExpressions
. Due to--omitEmpty
, this succeeds at type-checking, and the envelopingDeployment
also type-checks.However, attempting to actually apply the
Deployment
results inerror: error validating "STDIN": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec
.Not sure what a proper solution is considering dhall-lang#691 precluded language-level support for non-empty
List
s.The text was updated successfully, but these errors were encountered: