Skip to content

Commit 4d8f7eb

Browse files
Wei WengWei Weng
authored andcommitted
Revert "strip volume name from PVC"
This reverts commit f41077b.
1 parent b1fa18a commit 4d8f7eb

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

pkg/controllers/placement/resource_selector.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,6 @@ func generateRawContent(object *unstructured.Unstructured) ([]byte, error) {
501501
unstructured.RemoveNestedField(object.Object, "spec", "template", "metadata", "labels", "controller-uid")
502502
unstructured.RemoveNestedField(object.Object, "spec", "template", "metadata", "labels", "batch.kubernetes.io/controller-uid")
503503
}
504-
} else if object.GetKind() == "PersistentVolumeClaim" && object.GetAPIVersion() == "v1" {
505-
// Remove volumeName which references a specific PV from the hub cluster that won't exist on member clusters.
506-
// The member cluster's storage provisioner will create and bind a new PV.
507-
unstructured.RemoveNestedField(object.Object, "spec", "volumeName")
508504
}
509505

510506
rawContent, err := object.MarshalJSON()

pkg/controllers/placement/resource_selector_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ func TestGenerateResourceContent(t *testing.T) {
272272
},
273273
},
274274
StorageClassName: ptr.To("standard"),
275-
VolumeName: "pvc-12345-from-hub-cluster",
276275
},
277276
},
278277
wantResource: corev1.PersistentVolumeClaim{
@@ -297,7 +296,6 @@ func TestGenerateResourceContent(t *testing.T) {
297296
},
298297
},
299298
StorageClassName: ptr.To("standard"),
300-
// VolumeName should be removed
301299
},
302300
},
303301
},

0 commit comments

Comments
 (0)