knative / hack

Knative common scripts.
Apache License 2.0
18 stars 64 forks source link

Schema Tool can't load descriptions and set optional fields to be required #155

Closed ChunyiLyu closed 1 year ago

ChunyiLyu commented 2 years ago

I've tried following instruction using the schema tool to generate CRD for rabbitmqsources in eventing-rabbitmq.

If you run go run ./ dump RabbitmqSource, the output crd looks like:

type: object
properties:
  spec:
    description: 'not found: unable to parse dir: error parse dir "./pkg/apis/sources/v1alpha1": open ./pkg/apis/sources/v1alpha1: no such file or directory'
    type: object
    required:
      - sink
    properties:
      brokers:
        description: 'not found: unable to parse dir: error parse dir "./pkg/apis/sources/v1alpha1": open ./pkg/apis/sources/v1alpha1: no such file or directory'
        type: string
      channel_config:
        description: 'not found: unable to parse dir: error parse dir "./pkg/apis/sources/v1alpha1": open ./pkg/apis/sources/v1alpha1: no such file or directory'
        type: object
        required:
          - prefetch_count
        ...
      observedGeneration:
        description: 'not found: unable to parse dir: error parse dir "vendor/knative.dev/pkg/apis/duck/v1": open vendor/knative.dev/pkg/apis/duck/v1: no such file or directory'
        type: integer
        format: int64
      sinkUri:
        description: 'not found: unable to parse dir: error parse dir "vendor/knative.dev/pkg/apis/duck/v1": open vendor/knative.dev/pkg/apis/duck/v1: no such file or directory'
        type: string

It can't find fields descriptions and set some optional fields to be required instead. Used fork

krsna-m commented 2 years ago

@n3wscott @mattmoor Since it looks like you all added the tool

krsna-m commented 1 year ago

Doing a little manual cleanup. If this is still an issue please reopen this issue.