Add config validation for KubernetesApplicationSpec in pipedv1

Đang mở
#7,142 1 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 2 ngày

@adityamukesh đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #7143 của @ayushsarode — đã đóng, không merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
74/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go, kubernetes
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Bắt đầu tại pkg/app/pipedv1/plugin/kubernetes/config, ở TODO về việc xác thực KubernetesApplicationSpec, và so sánh các mẫu xác thực trong các plugin multicluster Kubernetes, analysis và terraform. Thêm các test cho các giá trị mặc định hợp lệ, các đầu vào Helm và Kustomize loại trừ lẫn nhau, các phương thức định tuyến lưu lượng được hỗ trợ và các yêu cầu về nhãn biến thể; chạy các test của package và xác nhận rằng các giá trị mặc định JSON tối thiểu vẫn hợp lệ.

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

Mô tả

kind/enhancement

What would you like to be added:

Implement proper validation for KubernetesApplicationSpec in the pipedv1 Kubernetes plugin (pkg/app/pipedv1/plugin/kubernetes/config), replacing the current // TODO: Validate KubernetesApplicationSpec fields. stub.

Validation should cover at least:

  1. Mutually exclusive input options

    • Reject configs that set both input.helmChart and input.kustomizeOptions.
  2. Traffic routing method

    • When trafficRouting is set, allow only supported methods ("", podselector, istio) and fail clearly on unknown values.
  3. Variant labels

    • Require non-empty variantLabel.key, primaryValue, canaryValue, and baselineValue.
    • Require primaryValue, canaryValue, and baselineValue to be unique.

Add unit tests for valid configs, each failure case, and that JSON unmarshaling applies defaults so a minimal {} spec remains valid after defaults are set.

Why is this needed:

Invalid Kubernetes application configs are currently accepted and only fail later during plan/sync (or produce confusing progressive-delivery behavior). Early validation:

  • Surfaces configuration mistakes immediately with actionable error messages.
  • Prevents impossible combinations (e.g. Helm chart + Kustomize options).
  • Protects progressive delivery by ensuring variant labels and traffic-routing method are usable before a deployment starts.
  • Aligns the single-cluster Kubernetes plugin with existing validation patterns used by other plugins (e.g. multicluster Kubernetes, analysis, terraform).
Ngôn ngữ chính
Go
Star
1.4k
Fork
391
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
58

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

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 pipe-cd/pipecd

Tất cả issue của pipe-cd/pipecd

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.