Add config validation for KubernetesApplicationSpec in pipedv1
维护者通常 2 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- go, kubernetes
- 领域
- devops, infrastructure
调研方向
从 pkg/app/pipedv1/plugin/kubernetes/config 中 KubernetesApplicationSpec 验证相关的 TODO 开始,并比较 multicluster Kubernetes、analysis 和 terraform 插件中的验证模式。为有效的默认值、互斥的 Helm 和 Kustomize 输入、受支持的流量路由方法以及变体标签要求添加测试;运行包测试,并确认最小 JSON 默认值仍然有效。
由索引模型根据 Issue 内容生成。
描述
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:
-
Mutually exclusive input options
- Reject configs that set both
input.helmChartandinput.kustomizeOptions.
- Reject configs that set both
-
Traffic routing method
- When
trafficRoutingis set, allow only supported methods ("",podselector,istio) and fail clearly on unknown values.
- When
-
Variant labels
- Require non-empty
variantLabel.key,primaryValue,canaryValue, andbaselineValue. - Require
primaryValue,canaryValue, andbaselineValueto be unique.
- Require non-empty
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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pipe-cd/pipecd 的其他 Issue
-
Applications at the repository root are not triggered by new commits可能已有人在做 @Daksha1611 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTING可能已有人在做 @Dhirenderchoudhary 今天认领。 未关闭
难度 2/5 半天 新手友好度 74/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
pipectl transfer restore application drops backed-up labels可能已有人在做 @bhavishyajain545 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
docker-compose: postgres healthcheck should probe TCP (pg_isready -h localhost)可能已有人在做 @zezo-mohamed22 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
OneBusAway/watchdog#305 · 1 条评论 ·
维护者通常 1 天内回复
-
self-care self-care:agent-discoverability
难度 2/5 1-3 小时 新手友好度 62/100
githubnext/gh-cao#20928 ·
维护者通常 1 天内回复
-
automation documentation
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
SocialGouv/iterion#3287 ·
维护者通常 1 天内回复