Skip to content

Commit

Permalink
> force set PersistentVolumeReclaimPolicy to Retain
Browse files Browse the repository at this point in the history
  • Loading branch information
kebe7jun committed Jan 21, 2025
1 parent 00307ef commit 58af574
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/controller/dataset/dataset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ func (r *DatasetReconciler) reconcilePVC(ctx context.Context, ds *datasetv1alpha
newPv.Labels[constants.DatasetNameLabel] = ds.Name
newPv.ResourceVersion = ""
newPv.Spec.ClaimRef = nil
// 保留策略改为 Retain
newPv.Spec.PersistentVolumeReclaimPolicy = corev1.PersistentVolumeReclaimRetain
if err := r.Get(ctx, client.ObjectKey{Name: newPv.Name}, pv); err != nil {
if !k8serrors.IsNotFound(err) {
return err
Expand Down

0 comments on commit 58af574

Please sign in to comment.