Splunk Operator: VolumeSpec CEL validation rule "region is required when provider is aws" errors on missing provider field instead of allowing it (optional field)
@gabrielm-splunk 已经在做这个了。
开始于 2026年9月8日。
评估
这个 Issue 还没有评估数据。
描述
Please select the type of request
Bug
Tell us more
Splunk Operator version: 3.1.0 (CRDs generated with controller-gen.kubebuilder.io/version: v0.18.0)
Affected CRDs: All CRDs embedding VolumeSpec (e.g. ClusterManager, IndexerCluster, SearchHeadCluster, Standalone) - the same x-kubernetes-validations rule appears on both spec.smartstore.volumes[] and spec.appRepo.volumes[] (and their status mirrors).
Bug
The CEL rule introduced in 3.1.0 for VolumeSpec:
message: region is required when provider is aws
rule: self.provider != 'aws' || size(self.region) > 0
assumes self.provider is always accessible. But provider is documented as an optional string field on VolumeSpec, with no default value. When provider is entirely absent from a volume entry (not just an empty string - genuinely unset, which is a valid, supported configuration per the field's own docs), evaluating self.provider in CEL fails with a runtime error rather than being treated as empty/false. The resulting API error is:
spec.smartstore.volumes[0]: Invalid value: "object": no such key: provider evaluating rule: region is required when provider is aws
Impact
Because Kubernetes validates the entire object (including unrelated, previously-persisted status fields) on every write to the resource, once an object has ever been persisted with a provider-less volume entry (e.g. before upgrading the operator/CRDs to 3.1.0, when this rule didn't exist), every subsequent write to that object fails this rule - including attempts to PATCH the object to fix it, and even attempts to remove finalizers as part of deleting it. The object becomes permanently stuck: it can't be updated, and it can't be deleted, because any write (even a finalizer-only patch) is rejected by this same rule evaluating against the already-invalid, untouched part of the object.
Steps to reproduce
- On an operator version before 3.1.0 (or by any means that skips this validation), create a
ClusterManager(or similar) with asmartstore.volumesentry that has noproviderfield set. - Upgrade the CRDs to 3.1.0.
- Attempt any further write to that object (a spec change via Helm/kubectl, or
kubectl deletefollowed by removing its finalizers) - every attempt fails with the error above, even one that includes/fixesprovidergoing forward, because the other untouched half of the object (whichever ofspec/statusa given patch doesn't touch) still lacks it.
Expected behavior
provider being unset should not error at all, matching its documented "optional" status - the rule should only enforce region when provider is explicitly "aws".
Suggested fix
Guard the field access with has(), standard practice for optional CEL fields:
rule: '!has(self.provider) || self.provider != ''aws'' || size(self.region) > 0'
We applied this locally to unblock ourselves, but it means anyone upgrading straight to 3.1.0 with existing objects that predate this rule can get stuck with an object that can neither be updated nor deleted through the Kubernetes API.
- 主要语言
- Go
- 星标
- 260
- 派生
- 134
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
splunk/splunk-operator 的其他 Issue
-
monitoring console
难度 4/5 3-5 天 新手友好度 45/100
splunk/splunk-operator#1887 ·
-
monitoring console
难度 3/5 1-2 天 新手友好度 55/100
splunk/splunk-operator#1886 ·
-
难度 4/5 3-5 天 新手友好度 66/100
splunk/splunk-operator#1885 ·
-
难度 4/5 1-2 天 新手友好度 52/100
splunk/splunk-operator#1884 ·
-
难度 3/5 1-2 天 新手友好度 48/100
splunk/splunk-operator#1883 ·
查看 splunk/splunk-operator 的全部 Issue
相似的 Issue
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
gtsteffaniak/filebrowser#3395 ·
维护者通常 1 天内回复
-
effort:s impact:low raised-by:worker risk:low
难度 1/5 1 小时以内 新手友好度 70/100
medici-finance/assay#6496 · 1 条评论 ·
维护者通常 1 天内回复
-
kind/bug require/reproduce require/severity
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 60/100