From d338a7eaea1e58213846496ba2e44aa06085603a Mon Sep 17 00:00:00 2001 From: markturansky Date: Wed, 27 May 2015 13:21:48 -0400 Subject: [PATCH] rebased and added 'omitempty' to new volumes --- pkg/api/types.go | 16 ++++++++-------- pkg/api/v1/types.go | 4 ++-- pkg/api/v1beta1/types.go | 4 ++-- pkg/api/v1beta2/types.go | 4 ++-- pkg/api/v1beta3/types.go | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index e52e32f1031..5504ba2f213 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -197,7 +197,7 @@ type VolumeSource struct { // Secret represents a secret that should populate this volume. Secret *SecretVolumeSource `json:"secret,omitempty"` // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs"` + NFS *NFSVolumeSource `json:"nfs,omitempty"` // ISCSIVolumeSource represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"` @@ -214,23 +214,23 @@ type VolumeSource struct { type PersistentVolumeSource struct { // GCEPersistentDisk represents a GCE Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty"` // AWSElasticBlockStore represents an AWS EBS disk that is attached to a // kubelet's host machine and then exposed to the pod. - AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty"` // HostPath represents a directory on the host. // This is useful for development and testing only. // on-host storage is not supported in any way - HostPath *HostPathVolumeSource `json:"hostPath"` + HostPath *HostPathVolumeSource `json:"hostPath,omitempty"` // Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod - Glusterfs *GlusterfsVolumeSource `json:"glusterfs"` + Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"` // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs"` + NFS *NFSVolumeSource `json:"nfs,omitempty"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime - RBD *RBDVolumeSource `json:"rbd"` + RBD *RBDVolumeSource `json:"rbd,omitempty"` // ISCSIVolumeSource represents an ISCSI resource that is attached to a // kubelet's host machine and then exposed to the pod. - ISCSI *ISCSIVolumeSource `json:"iscsi"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"` } type PersistentVolumeClaimVolumeSource struct { diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 7ab4b317edb..18855dd86e5 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -252,10 +252,10 @@ type PersistentVolumeSource struct { // NFS represents an NFS mount on the host NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume resource provisioned by an admin"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime - RBD *RBDVolumeSource `json:"rbd" description:"rados block volume that will be mounted on the host machine"` + RBD *RBDVolumeSource `json:"rbd,omitempty" description:"rados block volume that will be mounted on the host machine"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - ISCSI *ISCSIVolumeSource `json:"iscsi" description:"an iSCSI disk resource provisioned by an admin"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"an iSCSI disk resource provisioned by an admin"` } type PersistentVolume struct { diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 3081afc80aa..eb456722443 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -155,10 +155,10 @@ type PersistentVolumeSource struct { // NFS represents an NFS mount on the host NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume resource provisioned by an admin"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime - RBD *RBDVolumeSource `json:"rbd" description:"rados block volume that will be mounted on the host machine"` + RBD *RBDVolumeSource `json:"rbd,omitempty" description:"rados block volume that will be mounted on the host machine"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - ISCSI *ISCSIVolumeSource `json:"iscsi" description:"an iSCSI disk resource provisioned by an admin"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"an iSCSI disk resource provisioned by an admin"` } type PersistentVolumeClaimVolumeSource struct { diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index f8fd5283c37..ae654016fdc 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -110,10 +110,10 @@ type PersistentVolumeSource struct { // NFS represents an NFS mount on the host NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume resource provisioned by an admin"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime - RBD *RBDVolumeSource `json:"rbd" description:"rados block volume that will be mounted on the host machine"` + RBD *RBDVolumeSource `json:"rbd,omitempty" description:"rados block volume that will be mounted on the host machine"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - ISCSI *ISCSIVolumeSource `json:"iscsi" description:"an iSCSI disk resource provisioned by an admin"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"an iSCSI disk resource provisioned by an admin"` } type PersistentVolumeClaimVolumeSource struct { diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 34fe05c5910..c5fdb8180bd 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -252,10 +252,10 @@ type PersistentVolumeSource struct { // NFS represents an NFS mount on the host NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume resource provisioned by an admin"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime - RBD *RBDVolumeSource `json:"rbd" description:"rados block volume that will be mounted on the host machine"` + RBD *RBDVolumeSource `json:"rbd,omitempty" description:"rados block volume that will be mounted on the host machine"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - ISCSI *ISCSIVolumeSource `json:"iscsi" description:"an iSCSI disk resource provisioned by an admin"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"an iSCSI disk resource provisioned by an admin"` } type PersistentVolume struct {