diff --git a/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml b/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml index ba77c98dd..0ea2d800d 100644 --- a/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml +++ b/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml @@ -94,12 +94,12 @@ spec: reported. properties: message: - description: String detailing the error encountered during snapshot - creation. This string may be logged, so it should not - contain sensitive information. + description: 'message is a string detailing the encountered error + during snapshot creation if specified. NOTE: message maybe logged, + thus it should not contain sensitive information.' type: string time: - description: Time the error was encountered. + description: time is the timestamp when the error was encountered. format: date-time type: string type: object diff --git a/pkg/apis/volumesnapshot/v1beta1/types.go b/pkg/apis/volumesnapshot/v1beta1/types.go index 91ed9aff8..2f6a3bb23 100644 --- a/pkg/apis/volumesnapshot/v1beta1/types.go +++ b/pkg/apis/volumesnapshot/v1beta1/types.go @@ -18,7 +18,6 @@ package v1beta1 import ( core_v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -127,7 +126,7 @@ type VolumeSnapshotStatus struct { // to decide whether they should continue on waiting for the snapshot to be created // based on the type of error reported. // +optional - Error *storage.VolumeError `json:"error,omitempty" protobuf:"bytes,4,opt,name=error,casttype=VolumeError"` + Error *VolumeSnapshotError `json:"error,omitempty" protobuf:"bytes,4,opt,name=error,casttype=VolumeSnapshotError"` } // +genclient @@ -282,3 +281,17 @@ const ( // The default policy is Retain if not specified. VolumeSnapshotContentRetain DeletionPolicy = "Retain" ) + +// VolumeSnapshotError describes an error encountered during snapshot creation. +type VolumeSnapshotError struct { + // time is the timestamp when the error was encountered. + // +optional + Time *metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"` + + // message is a string detailing the encountered error during snapshot + // creation if specified. + // NOTE: message maybe logged, thus it should not contain sensitive + // information. + // +optional + Message *string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` +}