From 2e4f6eca0e5c39dcef6d044144290f46ede763c2 Mon Sep 17 00:00:00 2001 From: Xing Yang Date: Mon, 27 Aug 2018 20:31:19 -0700 Subject: [PATCH] Clarify comments for DataSource --- pkg/apis/core/types.go | 4 +++- staging/src/k8s.io/api/core/v1/types.go | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkg/apis/core/types.go b/pkg/apis/core/types.go index e570af7d597..99f033a3ca2 100644 --- a/pkg/apis/core/types.go +++ b/pkg/apis/core/types.go @@ -415,7 +415,9 @@ type PersistentVolumeClaimSpec struct { VolumeMode *PersistentVolumeMode // If specified, volume will be prepopulated with data from the specified data source. // This depends on the provisioner for this volume being able to use the specified source. - // If the provisioner does not support it, it will create an empty volume. + // If the provisioner failed to populate the volume with the source, it will return an + // error and fail the create volume operation. If the provisioner does not support the + // data source, it will also return an error and fail the create volume operation. // It requires the VolumeSnapshotDataSource alpha feature gate to be enabled and // currently VolumeSnapshot is the only supported data source. // In the future, we will allow more data source types when new feature is ready. diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 70853933fd2..cad69a6d6a3 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -458,12 +458,14 @@ type PersistentVolumeClaimSpec struct { // This is an alpha feature and may change in the future. // +optional VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"` - // If specified, volume will be prepopulated with data from the specified data source. - // This depends on the provisioner for this volume being able to use the specified source. - // If the provisioner does not support it, it will create an empty volume. - // It requires the VolumeSnapshotDataSource alpha feature gate to be enabled and - // currently VolumeSnapshot is the only supported data source. - // In the future, we will allow more data source types when new feature is ready. + // If specified, volume will be prepopulated with data from the specified data source. + // This depends on the provisioner for this volume being able to use the specified source. + // If the provisioner failed to populate the volume with the source, it will return an + // error and fail the create volume operation. If the provisioner does not support the + // data source, it will also return an error and fail the create volume operation. + // It requires the VolumeSnapshotDataSource alpha feature gate to be enabled and + // currently VolumeSnapshot is the only supported data source. + // In the future, we will allow more data source types when new feature is ready. // +optional DataSource *TypedLocalObjectReference `json:"dataSource" protobuf:"bytes,7,opt,name=dataSource"` }