Generated CRDs do not populate top-level OpenAPI schema descriptions

Đang mở
#3,742 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
40/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go, openapi

Hướng nghiên cứu

Bắt đầu tại cmd/protoc-gen-crd/openapiGenerator.go, khoảng dòng 340-341, rồi so sánh schema gốc được tạo ra với phần mô tả spec do kubectl explain hiển thị. Kiểm tra schema OpenAPI v3 của VirtualService và xác minh thiết kế mô tả ở cấp tài nguyên theo dự định. Hoàn tất khi các CRDs được tạo ra có phần mô tả cấp cao nhất có ý nghĩa mà không che khuất phần mô tả spec hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/user experience kind/docs kind/enhancement

Describe the feature request
While investigating kubectl explain, I noticed that all generated Istio CRDs have an empty top-level description.
For example:

kubectl explain virtualservice

GROUP:      networking.istio.io
KIND:       VirtualService
VERSION:    v1

DESCRIPTION:
    <empty>
.
.

even though explain virtualservice.spec , correctly shows the generated description:

kubectl explain virtualservice.spec

GROUP:      networking.istio.io
KIND:       VirtualService
VERSION:    v1

FIELD: spec <Object>


DESCRIPTION:
    Configuration affecting label/content routing, sni routing, etc. See more
    details at:
    https://istio.io/docs/reference/config/networking/virtual-service.html

Looking at the generated OpenAPI:
kubectl get --raw /openapi/v3/apis/networking.istio.io/v1 \ | jq '.components.schemas["io.istio.networking.v1.VirtualService"].description'

returns null.

I traced this to the CRD generator https://github.com/istio/tools/blob/master/cmd/protoc-gen-crd/openapiGenerator.go#L340-L341 . A straightforward implementation is to propagate spec.Description to the root schema, which makes kubectl explain display a description. However, this results in the same description appearing for both the resource and its spec.

Before preparing a PR, I'd like to understand the intended design:

  • Should the root CRD schema reuse the protobuf message description?
  • Or should the generator support a separate resource-level description (for example via a new +cue-gen annotation)?

Affected product area (please put an X in all that apply)

[ ] Configuration Infrastructure
[X] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[X] User Experience

Additional context:
This enhancement would improve the usability of generated Istio CRDs by populating top-level OpenAPI schema descriptions. Currently, kubectl explain <resource> shows an empty DESCRIPTION for generated CRDs, even though field and spec descriptions are available. Adding meaningful root descriptions would make Istio APIs easier to discover and understand directly from the CLI, without changing runtime behavior.

Ngôn ngữ chính
Go
Star
523
Fork
623
Merge trung bình
5 ngày 20 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của istio/api

Tất cả issue của istio/api

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.