Add config validation for KubernetesApplicationSpec in pipedv1

オープン
#7,142 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@adityamukesh がすでに取り組んでいます。

2026年10月16日 から。

  • #7143 @ayushsarode による — マージされずにクローズ

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
go, kubernetes

調査の方向性

pkg/app/pipedv1/plugin/kubernetes/config の KubernetesApplicationSpec の検証に関する TODO から始め、multicluster Kubernetes、analysis、terraform プラグインの検証パターンを比較します。デフォルト値が有効であること、Helm と Kustomize の入力が相互排他的であること、サポートされているトラフィックルーティング方式、variant-label の要件についてテストを追加します。パッケージのテストを実行し、最小限の JSON デフォルト値が引き続き有効であることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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).
主要言語
Go
スター
1.4k
フォーク
391
平均マージ
4日 1時間
マージ済み PR(30日)
58

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pipe-cd/pipecd のほかの issue

pipe-cd/pipecd の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。