Skip to content

Commit

Permalink
list PVC with ZookeeperCluster uid (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
srteam2020 authored Mar 22, 2021
1 parent cda03d2 commit c25d193
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ func (r *ReconcileZookeeperCluster) cleanupOrphanPVCs(instance *zookeeperv1beta1

func (r *ReconcileZookeeperCluster) getPVCList(instance *zookeeperv1beta1.ZookeeperCluster) (pvList corev1.PersistentVolumeClaimList, err error) {
selector, err := metav1.LabelSelectorAsSelector(&metav1.LabelSelector{
MatchLabels: map[string]string{"app": instance.GetName()},
MatchLabels: map[string]string{"app": instance.GetName(), "uid": string(instance.UID)},
})
pvclistOps := &client.ListOptions{
Namespace: instance.Namespace,
Expand Down
2 changes: 1 addition & 1 deletion pkg/zk/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func MakeStatefulSet(z *v1beta1.ZookeeperCluster) *appsv1.StatefulSet {
Name: zkDataVolume,
Labels: mergeLabels(
z.Spec.Labels,
map[string]string{"app": z.GetName()},
map[string]string{"app": z.GetName(), "uid": string(z.UID)},
),
Annotations: z.Spec.Persistence.Annotations,
},
Expand Down

0 comments on commit c25d193

Please sign in to comment.