You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Are you saying that you want to use a custom metadata structure to constrain metadata to only set fields such as name and not annotations, labels, etc? If so, could you provide more detailed information?
One way you can manually modify the metadata field definition of CRD KCL schema.
Yes exactly I need to change the shema corresponding to metadata to make sure our users enter some meaningfull string + also because as we are using the schema for auto-suggestions in their IDE, I wanted to make sure there were no other stuff proposed that would be irrelevant for us in the context of Crossplane Claims we are in.
I did like you are suggesting (adding manually after generation the metadata definition as we want it) but it is true, that if we coud get it generated out of the CRD that would be easier. 😄
Bug Report
1. Minimal reproduce step (Required)
Have a CRDS like so
2. What did you expect to see? (Required)
I would expect the generated schema wiith at least
metadata?: AppsAppV1alpha1AppMetadata
and
AppsAppV1alpha1AppMetadata
defined as3. What did you see instead (Required)
metadata?: v1.ObjectMeta
4. What is your KCL components version? (Required)
0.11.0
The text was updated successfully, but these errors were encountered: