Add config validation for KubernetesApplicationSpec in pipedv1

未关闭
#7,142 1 条评论 0 个 reaction 已指派 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 输入、受支持的流量路由方法以及变体标签要求添加测试;运行包测试,并确认最小 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 小时
30 天内合并 PR
58

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pipe-cd/pipecd 的其他 Issue

查看 pipe-cd/pipecd 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。