Skip to content

fix: handle stale PVC app ownerReferences#31

Merged
zijiren233 merged 1 commit into
labring:fix/v0.9.3from
wallyxjh:fix/pvc-ownerrefs-cluster
May 26, 2026
Merged

fix: handle stale PVC app ownerReferences#31
zijiren233 merged 1 commit into
labring:fix/v0.9.3from
wallyxjh:fix/pvc-ownerrefs-cluster

Conversation

@wallyxjh

@wallyxjh wallyxjh commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • include PVCs with stale KubeBlocks Cluster/Component ownerReferences in TreeLoader so reconciliation can see existing PVCs
  • remove only stale apps.kubeblocks.io Cluster/Component ownerReferences in copyAndMergePVC while preserving other ownerReferences

Testing

  • go test ./pkg/controller/kubebuilderx ./pkg/controller/instanceset
  • git diff --check

@wallyxjh wallyxjh force-pushed the fix/pvc-ownerrefs-cluster branch from 4781297 to efb9553 Compare May 26, 2026 06:26
if len(refs) == 0 {
return refs
}
retained := refs[:0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a brand-new slice instead of referencing the old one to avoid long-term references or destructive changes to the slice’s content.

@wallyxjh wallyxjh force-pushed the fix/pvc-ownerrefs-cluster branch from efb9553 to d863170 Compare May 26, 2026 08:50
@zijiren233 zijiren233 merged commit 0ff295a into labring:fix/v0.9.3 May 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants