From f866ca079a46fc97e584bef35363fd0f9036be73 Mon Sep 17 00:00:00 2001 From: Roman Mohr Date: Thu, 10 Jan 2019 08:57:32 +0100 Subject: [PATCH] Set omitempty on DataSource for snapshot on PVCs Add "omitempty" to spec.dataSource like it is done for all other optional fields too. Serialized code creates otherwise "null" fields and some introspection tools rely on that value to determine if a value is optional or required. --- staging/src/k8s.io/api/core/v1/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 43e70b9bad5..c8c9fc451fc 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -467,7 +467,7 @@ type PersistentVolumeClaimSpec struct { // In the future, we plan to support more data source types and the behavior // of the provisioner may change. // +optional - DataSource *TypedLocalObjectReference `json:"dataSource" protobuf:"bytes,7,opt,name=dataSource"` + DataSource *TypedLocalObjectReference `json:"dataSource,omitempty" protobuf:"bytes,7,opt,name=dataSource"` } // PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type