Skip to content

Rethinking metadata schema generation in CRD yamls #385

@tamalsaha

Description

@tamalsaha

Currently controller-tools does not generate any properties for metadata fields at any level in CRD yamls to accommodate for structural schema.

https://github.com/kubernetes-sigs/controller-tools/blob/master/pkg/crd/known_types.go#L29-L33

My it is my understanding that only top level metadata field is restricted to define name & generatedName fields. Any other nested metadata field can have detailed schema. Some common cases are embedding PodTemplate, PersistentVolumeClaim in CRDs.

Currently we are creating our own ObjectMeta types are using them in our CRDs to work around this issue.

Do you think controller-tools could just strip the properties for top level metadata field? One way to do that will be to remove ObjectMeta from known types and then clean the generated yaml before writing to disk.

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions