Skip to content

Generated Metadata breaks crd in 1.15 #279

@skonto

Description

@skonto

Details are described in kubernetes/kubernetes#80493. Initially I thought that this might be a k8s issue but it looks now like an incompatibility issue for controller-tools.

The problem is that the default preserveUnknownFields: true in combination with

  annotations:
    certmanager.k8s.io/inject-ca-from: test-operator-system/test-operator-serving-cert

and

conversion:
    strategy: Webhook
    webhookClientConfig:
      caBundle: Cg==
      service:
        name: test-operator-webhook-service
        namespace: test-operator-system
        path: /convert

create this error The CustomResourceDefinition "cronjobs.batch.tutorial.kubebuilder.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true

If you set preserveUnknownFields: false to make conversion work then immediately you get:


> The CustomResourceDefinition "testapplications.testoperator.k8s.io" is invalid: spec.validation.openAPIV3Schema.properties[metadata]: Forbidden: must not specify anything other than name and generateName, but metadata is implicitly specified

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions