diff --git a/sdk/RELEASE.md b/sdk/RELEASE.md index 6361420084f..f5f80a8d323 100644 --- a/sdk/RELEASE.md +++ b/sdk/RELEASE.md @@ -12,7 +12,7 @@ ## Bug Fixes and Other Changes * Fix duplicate function for `list_pipeline_versions()`. [\#6594](https://github.com/kubeflow/pipelines/pull/6594) - +* Support re-use of PVC with VolumeOp. [\#6582](https://github.com/kubeflow/pipelines/pull/6582) ## Documentation Updates # 1.8.2 diff --git a/sdk/python/kfp/dsl/_volume_op.py b/sdk/python/kfp/dsl/_volume_op.py index e242bec89dd..31887b1a077 100644 --- a/sdk/python/kfp/dsl/_volume_op.py +++ b/sdk/python/kfp/dsl/_volume_op.py @@ -48,6 +48,7 @@ class VolumeOp(ResourceOp): VolumeSnapshot name (Alpha feature) volume_name: VolumeName is the binding reference to the PersistentVolume backing this claim. + generate_unique_name: Generate unique name for the PVC kwargs: See :py:class:`kfp.dsl.ResourceOp` Raises: @@ -68,6 +69,7 @@ def __init__(self, annotations: Dict[str, str] = None, data_source=None, volume_name=None, + generate_unique_name: bool = True, **kwargs): # Add size to attribute outputs self.attribute_outputs = {"size": "{.status.capacity.storage}"} @@ -103,7 +105,7 @@ def __init__(self, if not match_serialized_pipelineparam(str(resource_name)): resource_name = sanitize_k8s_name(resource_name) pvc_metadata = V1ObjectMeta( - name="{{workflow.name}}-%s" % resource_name, + name="{{workflow.name}}-%s" % resource_name if generate_unique_name else resource_name, annotations=annotations) requested_resources = V1ResourceRequirements(requests={"storage": size}) pvc_spec = V1PersistentVolumeClaimSpec(