Skip to content

Cannot override "Metadata" when kcl import -m crd #1844

@spastorclovr

Description

@spastorclovr

Bug Report

1. Minimal reproduce step (Required)

Have a CRDS like so

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: apps.app
spec:
  group: apps.app
  names:
    kind: App
    plural: apps
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        type: object
        properties:
          metadata:
            type: object
            properties:
              name:
                type: string
                description: The name of the App
            required:
              - name
  • run kcl import -m crd

2. What did you expect to see? (Required)

I would expect the generated schema wiith at least

metadata?: AppsAppV1alpha1AppMetadata

and AppsAppV1alpha1AppMetadata defined as

schema AppsAppV1alpha1AppMetadata:
    r"""
    apps app v1alpha1 app metadata

    Attributes
    ----------
    name : str, default is Undefined, required
        The name of the App
    """


    name: str

3. What did you see instead (Required)

metadata?: v1.ObjectMeta

4. What is your KCL components version? (Required)

0.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions