Using a Condition to test if dependencies are met
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start from the @Dependent annotation and the code that interprets dependsOn and reconcilePrecondition (io.javaoperatorsdk.operator.processing.dependent.* and the Condition interface) to see where deletion on a false precondition is triggered. Design where the new dependenciesMetPrecondition option would be evaluated in the reconcile cycle so it gates work without deleting an existing secondary resource, and decide how it interacts with dependsOn. Done looks like: the new option is honored during ongoing reconcile cycles, existing precondition deletion behavior is unchanged, and unit/integration tests around dependent resources pass.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Currently, we can describe a resource's dependencies using their names in dependsOn and we can also test preconditions with a reconcilePrecondition. However, sometimes a resource may need to depend one "at least one of" some other resource. For example, either an Ingress or a Route depending on the underlying cluster. In this case, dependsOn is not possible and a reconcilePrecondition returning false would delete the resource, which is undesirable for ongoing reconcile cycles.
There could also be cases where, for example, downstream dependents need a generated Route's hostname, but do not depend on the route actually becoming ready for further processing of the workflow, etc. Using a Condition could allow dependencies on sub-resources and not only on a resource's full readiness.
Describe the solution you'd like
An additional option on @Dependent (such as dependenciesMetPrecondition) that would allow programmatic checking on dependencies without removal of an existing secondary resource if it exists. This could be either mutually exclusive with, or in addition to whatever is given in dependsOn. Allowing both would provide a way to test simple dependencies and more complex ones at the same time.
Describe alternatives you've considered
I think more complicated workflows with "virtual" resources (always returning ReconcileResult.noOperation(primary) from reconcile) together with a readyPostcondition could be made to behave similarly, but with the burden of additional code and dependencies in the @Workflow.
Additional context
N/A
- 主要语言
- Java
- 星标
- 942
- 派生
- 246
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 28
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
operator-framework/java-operator-sdk 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
operator-framework/java-operator-sdk#3568 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
operator-framework/java-operator-sdk#3563 ·
维护者通常 1 天内回复
-
Support for Virtual Threads可能已有人在做 @xstefank 于 63 天前认领。 未关闭
operator-framework/java-operator-sdk#3538 · 2 条评论 · 已指派 2 人 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
operator-framework/java-operator-sdk#3498 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
operator-framework/java-operator-sdk#3452 ·
维护者通常 1 天内回复
查看 operator-framework/java-operator-sdk 的全部 Issue
相似的 Issue
-
RRateLimiter acquire methods accept negative permits and raise available permits above the rate.可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100
krahets/hello-algo#1993 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
NationalSecurityAgency/ghidra#9884 ·
维护者通常 2 天内回复
-
Status: Pending Review Type: Feature Request
难度 1/5 1 小时以内 新手友好度 82/100
OpenRefine/OpenRefine#8019 ·
维护者通常 1 天内回复
-
[TEMP] pin maven version to 3.9.x可能已有人在做 @petrenyi-mark 今天认领。 未关闭
难度 2/5 1 小时以内 新手友好度 62/100