Skip to content

Commit

Permalink
Set omitempty on DataSource for snapshot on PVCs
Browse files Browse the repository at this point in the history
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.

Kubernetes-commit: f866ca079a46fc97e584bef35363fd0f9036be73
  • Loading branch information
rmohr authored and k8s-publishing-bot committed Jan 10, 2019
1 parent ae57edb commit c140a59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c140a59

Please sign in to comment.