bug: finalizer "syncagent.kcp.io/cleanup" on related resources block deletion of primary object
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- go
调研方向
首先使用此 issue 中的 Network 和 VirtualMachine 清单复现 provider A/B 设置,然后跟踪主要资源和相关资源的 finalizer 清理流程。查看 issue #116 和 #117 了解上下文;当删除 VirtualMachine 不再使 Network 被一个立即重新添加的 finalizer 阻塞时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Let's assume, there are two service providers using the api-syncagent to publish API resources and sync objects to / from kcp. To have a concrete example, let's also assume that:
- service provider "A" provides a
NetworkAPI - service provider "B" provides a
VirtualMachineAPI that allows you to reference an existingNetwork(defined as related resource) in which the virtual machine should be created
In this case, both api-syncagents add the finalizer "syncagent.kcp.io/cleanup" to any Network object referenced by a VirtualMachine - the api-syncagent of service provider "A" since the Network is the primary object, the api-syncagent of service provider "B" since the Network object is a related resource with origin: kcp.
When a VirtualMachine is deleted, provider "B" removes the finalizer from the Network as part of cleanup — but provider "A" immediately re-adds it, blocking deletion indefinitely.
Steps To Reproduce
- service provider "A": install api-syncagent and created
PublishedResourceforNetwork
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: networks.network.example.com
spec:
group: network.example.com
names:
kind: Network
listKind: NetworkList
plural: networks
singular: network
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cidrBlock:
type: string
served: true
storage: true
---
apiVersion: syncagent.kcp.io/v1alpha1
kind: PublishedResource
metadata:
name: networks.network.example.com
spec:
resource:
apiGroup: network.example.com
versions: [v1]
kind: Network
naming:
namespace: 'ws-{{ .ClusterName }}-{{ .Object.metadata.namespace | sha3short }}'
name: '{{ .Object.metadata.name }}'
- service provider "B": install api-syncagent and created
PublishedResourceforVirtualMachine
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: virtualmachines.compute.example.com
spec:
group: compute.example.com
names:
kind: VirtualMachine
listKind: VirtualMachineList
plural: virtualmachines
singular: virtualmachine
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
networkRef:
type: object
properties:
name:
type: string
served: true
storage: true
---
apiVersion: syncagent.kcp.io/v1alpha1
kind: PublishedResource
metadata:
name: virtualmachines.compute.example.com
spec:
resource:
apiGroup: compute.example.com
versions: [v1]
kind: VirtualMachine
naming:
namespace: 'ws-{{ .ClusterName }}-{{ .Object.metadata.namespace | sha3short }}'
name: '{{ .Object.metadata.name }}'
related:
- identifier: network
origin: kcp
group: network.example.com
version: v1
resource: networks
identityHash: ${NETWORKS_API_EXPORT_IDENTITY_HASH}
object:
reference:
path: spec.networkRef.name
- consumer: bind both
APIExports, apply manifests, and deleteVirtualMachine
---
apiVersion: network.example.com/v1
kind: Network
metadata:
name: network
spec:
cidrBlock: "192.168.0.0/24"
---
apiVersion: compute.example.com/v1
kind: VirtualMachine
metadata:
name: vm
spec:
networkRef:
name: network
Expected Behaviour
The VirtualMachine should get deleted successfully
Additional Context
- 主要语言
- Go
- 星标
- 25
- 派生
- 31
- 平均合并
- 5 天 18 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kcp-dev/api-syncagent 的其他 Issue
-
kind/bug
难度 2/5 1-3 小时 新手友好度 74/100
kcp-dev/api-syncagent#163 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
kcp-dev/api-syncagent#161 ·
-
bug: failed sync controller prevents subsequent startup retries可能已有人在做 @Sarthak-Shreshtha01 于 4 天前认领。 未关闭kind/bug
难度 3/5 1-2 天 新手友好度 20/100
kcp-dev/api-syncagent#190 · 1 条评论 ·
-
bug: dangling schema in an APIExport is neither removed nor reported可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
kcp-dev/api-syncagent#188 · 1 条评论 ·
-
kind/feature
难度 4/5 3-5 天 新手友好度 48/100
kcp-dev/api-syncagent#186 · 1 条评论 · 1 个 reaction ·
查看 kcp-dev/api-syncagent 的全部 Issue
相似的 Issue
-
product/backlog
难度 2/5 1-3 小时 新手友好度 75/100
TencentBlueKing/bk-nodemgr#3645 ·
维护者通常 1 天内回复
-
agent-butler-finding chore
难度 2/5 1-3 小时 新手友好度 78/100
jordansmall/spindrift#5128 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 2 天内回复
-
License GOtome under Apache 2.0 instead of AGPL-3.0可能已有人在做 @praetorianer777 今天认领。 未关闭area:workflow documentation
难度 2/5 1-3 小时 新手友好度 84/100
praetorianer777/GoTome#212 ·
维护者通常 1 天内回复
-
ci: pin Go version in Build and Unit Test workflows (>=1.26.6 floats to 1.27.2 and breaks golangci-lint)可能已有人在做 @leninmehedy 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 87/100
hashgraph/solo-weaver#1255 ·
维护者通常 1 天内回复