operator-framework / operator-framework/java-operator-sdk

Automatically Delete Resource if Dependent Removed From Workflow

未关闭
#2,267 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature
主要语言
Java
星标
944
派生
242
平均合并
1 天 4 小时
30 天内合并 PR
43

描述

If a dependent is removed from a workflow, the previously created resource represented by that dependent needs to be cleaned up. This can happen before the actual workflow is executed.
This could be done automatically before a workflow is executed, although it is not trivial in general. There are two problems:

  1. If a dependent is removed, on startup the informer related to its type might not be added anymore. So we would need to mark somewhere (maybe status or annotation?) the GVk-s of resources managed.

  2. If there are multiple resources of the same type in general it is not easy to identify which resource belongs to which dependent resource - without calling getSecondaryResource on the dependent. Since this cleanup would happen before the dependents are reconciled this is not doable without imposing additional requirements on implementation: for example, if the id of the resource is calculated based on the desired state, the desired state calculation might depend on other resources (which might not be reconciled now).
    Fortunately, this problem can be solved simply just by adding the name of the dependent as an annotation to the resource so it can be identified easily.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,检查 issue 中描述的 workflow 执行以及 informer 和依赖资源的生命周期。确定如何保留受管资源的 kind 和依赖资源的名称,然后将完成定义为:对于已移除的依赖资源,在执行前进行清理,同时不混淆多个相同类型的资源。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, kubernetes
领域
infrastructure
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

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