Skip to content

LabelSelector type-checks with empty component Lists #78

@ari-becker

Description

@ari-becker

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 a LabelSelector (since their Deployment doesn't have any labels in its metadata).

Currently, a DeploymentSpec bundles in its own default LabelSelector, which bundles in empty lists for matchLabels and matchExpressions. Due to --omitEmpty, this succeeds at type-checking, and the enveloping Deployment also type-checks.

However, attempting to actually apply the Deployment results in error: 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 Lists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions