From f7ede600455a29c38ddc37dfa2e87df9a7fa03e1 Mon Sep 17 00:00:00 2001 From: markturansky Date: Mon, 25 May 2015 12:03:10 -0400 Subject: [PATCH 1/4] normalized json tags across volumes --- pkg/api/types.go | 2 +- pkg/api/v1/types.go | 2 +- pkg/api/v1beta3/types.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index 558426da78c..9a473187f88 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -204,7 +204,7 @@ type VolumeSource struct { // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime Glusterfs *GlusterfsVolumeSource `json:"glusterfs"` // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace - PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` + PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime RBD *RBDVolumeSource `json:"rbd"` } diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index e9cc86b9ec6..c94b9f6f668 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -223,7 +223,7 @@ type VolumeSource struct { // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" description:"a reference to a PersistentVolumeClaim in the same namespace"` // 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"` } type PersistentVolumeClaimVolumeSource struct { diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 27956cb2a0b..34fe05c5910 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -223,7 +223,7 @@ type VolumeSource struct { // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" description:"a reference to a PersistentVolumeClaim in the same namespace"` // 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"` } type PersistentVolumeClaimVolumeSource struct { From e15fd2b0e75d31837ccd6dc9be0abc0b5c60f9f2 Mon Sep 17 00:00:00 2001 From: markturansky Date: Mon, 25 May 2015 13:10:14 -0400 Subject: [PATCH 2/4] normalized omitempty across volumes for all versions --- pkg/api/types.go | 22 +++++++++++----------- pkg/api/v1/types.go | 2 +- pkg/api/v1beta1/types.go | 32 ++++++++++++++++---------------- pkg/api/v1beta2/types.go | 34 ++++++++++++++++------------------ 4 files changed, 44 insertions(+), 46 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index 9a473187f88..e52e32f1031 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -183,30 +183,30 @@ type VolumeSource struct { // machine. Most containers will NOT need this. // TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not // mount host directories as read/write. - HostPath *HostPathVolumeSource `json:"hostPath"` + HostPath *HostPathVolumeSource `json:"hostPath,omitempty"` // EmptyDir represents a temporary directory that shares a pod's lifetime. - EmptyDir *EmptyDirVolumeSource `json:"emptyDir"` + EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty"` // 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"` // GitRepo represents a git repository at a particular revision. - GitRepo *GitRepoVolumeSource `json:"gitRepo"` + GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty"` // Secret represents a secret that should populate this volume. - Secret *SecretVolumeSource `json:"secret"` + Secret *SecretVolumeSource `json:"secret,omitempty"` // NFS represents an NFS mount on the host that shares a pod's lifetime NFS *NFSVolumeSource `json:"nfs"` // 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"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"` // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime - Glusterfs *GlusterfsVolumeSource `json:"glusterfs"` + Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"` // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace - PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim"` + PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,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"` } // Similar to VolumeSource but meant for the administrator who creates PVs. @@ -235,7 +235,7 @@ type PersistentVolumeSource struct { type PersistentVolumeClaimVolumeSource struct { // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume - ClaimName string `json:"claimName,omitempty" description:"the name of the claim in the same namespace to be mounted as a volume"` + ClaimName string `json:"claimName" description:"the name of the claim in the same namespace to be mounted as a volume"` // Optional: Defaults to false (read/write). ReadOnly here // will force the ReadOnly setting in VolumeMounts ReadOnly bool `json:"readOnly,omitempty"` diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index c94b9f6f668..7ab4b317edb 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -228,7 +228,7 @@ type VolumeSource struct { type PersistentVolumeClaimVolumeSource struct { // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume - ClaimName string `json:"claimName,omitempty" description:"the name of the claim in the same namespace to be mounted as a volume"` + ClaimName string `json:"claimName" description:"the name of the claim in the same namespace to be mounted as a volume"` // Optional: Defaults to false (read/write). ReadOnly here // will force the ReadOnly setting in VolumeMounts ReadOnly bool `json:"readOnly,omitempty" description:"mount volume as read-only when true; default false"` diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index c7100cd27e0..3081afc80aa 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -111,30 +111,30 @@ type VolumeSource struct { // things that are allowed to see the host machine. Most containers will NOT need this. // TODO(jonesdl) We need to restrict who can use host directory mounts and // who can/can not mount host directories as read/write. - HostDir *HostPathVolumeSource `json:"hostDir" description:"pre-existing host file or directory; generally for privileged system daemons or other agents tied to the host"` + HostDir *HostPathVolumeSource `json:"hostDir,omitempty" description:"pre-existing host file or directory; generally for privileged system daemons or other agents tied to the host"` // EmptyDir represents a temporary directory that shares a pod's lifetime. - EmptyDir *EmptyDirVolumeSource `json:"emptyDir" description:"temporary directory that shares a pod's lifetime"` + EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" description:"temporary directory that shares a pod's lifetime"` // GCEPersistentDisk represents a GCE Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk,omitempty" description:"GCE disk resource attached to the host machine on demand"` // AWSElasticBlockStore represents an AWS Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore" description:"AWS disk resource attached to the host machine on demand"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" description:"AWS disk resource attached to the host machine on demand"` // GitRepo represents a git repository at a particular revision. - GitRepo *GitRepoVolumeSource `json:"gitRepo" description:"git repository at a particular revision"` + GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" description:"git repository at a particular revision"` // Secret represents a secret to populate the volume with - Secret *SecretVolumeSource `json:"secret" description:"secret to populate volume with"` + Secret *SecretVolumeSource `json:"secret,omitempty" description:"secret to populate volume with"` // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine "` + NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume that will be mounted in 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:"iSCSI disk attached to host machine on demand"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"iSCSI disk attached to host machine on demand"` // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime - Glusterfs *GlusterfsVolumeSource `json:"glusterfs" description:"Glusterfs volume that will be mounted on the host machine "` + Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" description:"Glusterfs volume that will be mounted on the host machine "` // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" description:"a reference to a PersistentVolumeClaim in the same namespace"` // 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"` } // Similar to VolumeSource but meant for the administrator who creates PVs. @@ -142,18 +142,18 @@ 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:"persistentDisk" description:"GCE disk resource provisioned by an admin"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk,omitempty" description:"GCE disk resource provisioned by an admin"` // AWSElasticBlockStore represents an AWS EBS volume that is attached to a // kubelet's host machine and then exposed to the pod. - AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore" description:"AWS disk resource provisioned by an admin"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" description:"AWS disk resource provisioned by an admin"` // 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" description:"a HostPath provisioned by a developer or tester; for develment use only"` + HostPath *HostPathVolumeSource `json:"hostPath,omitempty" description:"a HostPath provisioned by a developer or tester; for develment use only"` // Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod - Glusterfs *GlusterfsVolumeSource `json:"glusterfs" description:"Glusterfs volume resource provisioned by an admin"` + Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" description:"Glusterfs volume resource provisioned by an admin"` // NFS represents an NFS mount on the host - NFS *NFSVolumeSource `json:"nfs" description:"NFS volume resource provisioned by an admin"` + 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"` // ISCSI represents an ISCSI Disk resource that is attached to a @@ -163,7 +163,7 @@ type PersistentVolumeSource struct { type PersistentVolumeClaimVolumeSource struct { // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume - ClaimName string `json:"claimName,omitempty" description:"the name of the claim in the same namespace to be mounted as a volume"` + ClaimName string `json:"claimName" description:"the name of the claim in the same namespace to be mounted as a volume"` // Optional: Defaults to false (read/write). ReadOnly here // will force the ReadOnly setting in VolumeMounts ReadOnly bool `json:"readOnly,omitempty" description:"mount volume as read-only when true; default false"` diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 0c03f7c12b3..f8fd5283c37 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -60,38 +60,36 @@ type Volume struct { // VolumeSource represents the source location of a volume to mount. // Only one of its members may be specified. -// -// http://docs.k8s.io/volumes.md#types-of-volumes type VolumeSource struct { // HostDir represents a pre-existing directory on the host machine that is directly // exposed to the container. This is generally used for system agents or other privileged // things that are allowed to see the host machine. Most containers will NOT need this. // TODO(jonesdl) We need to restrict who can use host directory mounts and // who can/can not mount host directories as read/write. - HostDir *HostPathVolumeSource `json:"hostDir" description:"pre-existing host file or directory; generally for privileged system daemons or other agents tied to the host"` + HostDir *HostPathVolumeSource `json:"hostDir,omitempty" description:"pre-existing host file or directory; generally for privileged system daemons or other agents tied to the host"` // EmptyDir represents a temporary directory that shares a pod's lifetime. - EmptyDir *EmptyDirVolumeSource `json:"emptyDir" description:"temporary directory that shares a pod's lifetime"` + EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" description:"temporary directory that shares a pod's lifetime"` // A persistent disk that is mounted to the // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk,omitempty" description:"GCE disk resource attached to the host machine on demand"` // An AWS persistent disk that is mounted to the // kubelet's host machine and then exposed to the pod. - AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore" description:"AWS disk resource attached to the host machine on demand"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" description:"AWS disk resource attached to the host machine on demand"` // GitRepo represents a git repository at a particular revision. - GitRepo *GitRepoVolumeSource `json:"gitRepo" description:"git repository at a particular revision"` + GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" description:"git repository at a particular revision"` // Secret is a secret to populate the volume with - Secret *SecretVolumeSource `json:"secret" description:"secret to populate volume"` + Secret *SecretVolumeSource `json:"secret,omitempty" description:"secret to populate volume"` // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine"` + NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume that will be mounted in 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:"iSCSI disk attached to host machine on demand"` + ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"iSCSI disk attached to host machine on demand"` // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime - Glusterfs *GlusterfsVolumeSource `json:"glusterfs" description:"Glusterfs volume that will be mounted on the host machine "` + Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" description:"Glusterfs volume that will be mounted on the host machine "` // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" description:"a reference to a PersistentVolumeClaim in the same namespace"` // 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"` } // Similar to VolumeSource but meant for the administrator who creates PVs. @@ -99,18 +97,18 @@ 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:"persistentDisk" description:"GCE disk resource provisioned by an admin"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk,omitempty" description:"GCE disk resource provisioned by an admin"` // AWSElasticBlockStore represents an AWS Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. - AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore" description:"AWS disk resource provisioned by an admin"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" description:"AWS disk resource provisioned by an admin"` // 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" description:"a HostPath provisioned by a developer or tester; for develment use only"` + HostPath *HostPathVolumeSource `json:"hostPath,omitempty" description:"a HostPath provisioned by a developer or tester; for develment use only"` // Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod - Glusterfs *GlusterfsVolumeSource `json:"glusterfs" description:"Glusterfs volume resource provisioned by an admin"` + Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" description:"Glusterfs volume resource provisioned by an admin"` // NFS represents an NFS mount on the host - NFS *NFSVolumeSource `json:"nfs" description:"NFS volume resource provisioned by an admin"` + 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"` // ISCSI represents an ISCSI Disk resource that is attached to a @@ -120,7 +118,7 @@ type PersistentVolumeSource struct { type PersistentVolumeClaimVolumeSource struct { // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume - ClaimName string `json:"claimName,omitempty" description:"the name of the claim in the same namespace to be mounted as a volume"` + ClaimName string `json:"claimName" description:"the name of the claim in the same namespace to be mounted as a volume"` // Optional: Defaults to false (read/write). ReadOnly here // will force the ReadOnly setting in VolumeMounts ReadOnly bool `json:"readOnly,omitempty" description:"mount volume as read-only when true; default false"` From d338a7eaea1e58213846496ba2e44aa06085603a Mon Sep 17 00:00:00 2001 From: markturansky Date: Wed, 27 May 2015 13:21:48 -0400 Subject: [PATCH 3/4] 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 { From 60b9652500feb5e85024566b359ddfbb00383314 Mon Sep 17 00:00:00 2001 From: markturansky Date: Wed, 27 May 2015 13:58:29 -0400 Subject: [PATCH 4/4] added generated deep copy funcs --- pkg/api/deep_copy_generated.go | 18 ++++++++++++++++++ pkg/api/v1/deep_copy_generated.go | 18 ++++++++++++++++++ pkg/api/v1beta3/deep_copy_generated.go | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/pkg/api/deep_copy_generated.go b/pkg/api/deep_copy_generated.go index fbc74c98483..97bad4c3165 100644 --- a/pkg/api/deep_copy_generated.go +++ b/pkg/api/deep_copy_generated.go @@ -1199,6 +1199,14 @@ func deepCopy_api_PersistentVolumeSource(in PersistentVolumeSource, out *Persist } else { out.RBD = nil } + if in.ISCSI != nil { + out.ISCSI = new(ISCSIVolumeSource) + if err := deepCopy_api_ISCSIVolumeSource(*in.ISCSI, out.ISCSI, c); err != nil { + return err + } + } else { + out.ISCSI = nil + } return nil } @@ -1836,6 +1844,16 @@ func deepCopy_api_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conv } else { out.Secrets = nil } + if in.ImagePullSecrets != nil { + out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) + for i := range in.ImagePullSecrets { + if err := deepCopy_api_LocalObjectReference(in.ImagePullSecrets[i], &out.ImagePullSecrets[i], c); err != nil { + return err + } + } + } else { + out.ImagePullSecrets = nil + } return nil } diff --git a/pkg/api/v1/deep_copy_generated.go b/pkg/api/v1/deep_copy_generated.go index a9c6328b6fe..c365033e4ba 100644 --- a/pkg/api/v1/deep_copy_generated.go +++ b/pkg/api/v1/deep_copy_generated.go @@ -1130,6 +1130,14 @@ func deepCopy_v1_PersistentVolumeSource(in PersistentVolumeSource, out *Persiste } else { out.RBD = nil } + if in.ISCSI != nil { + out.ISCSI = new(ISCSIVolumeSource) + if err := deepCopy_v1_ISCSIVolumeSource(*in.ISCSI, out.ISCSI, c); err != nil { + return err + } + } else { + out.ISCSI = nil + } return nil } @@ -1772,6 +1780,16 @@ func deepCopy_v1_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conve } else { out.Secrets = nil } + if in.ImagePullSecrets != nil { + out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) + for i := range in.ImagePullSecrets { + if err := deepCopy_v1_LocalObjectReference(in.ImagePullSecrets[i], &out.ImagePullSecrets[i], c); err != nil { + return err + } + } + } else { + out.ImagePullSecrets = nil + } return nil } diff --git a/pkg/api/v1beta3/deep_copy_generated.go b/pkg/api/v1beta3/deep_copy_generated.go index abe95f7ca40..15ed66e26b0 100644 --- a/pkg/api/v1beta3/deep_copy_generated.go +++ b/pkg/api/v1beta3/deep_copy_generated.go @@ -1134,6 +1134,14 @@ func deepCopy_v1beta3_PersistentVolumeSource(in PersistentVolumeSource, out *Per } else { out.RBD = nil } + if in.ISCSI != nil { + out.ISCSI = new(ISCSIVolumeSource) + if err := deepCopy_v1beta3_ISCSIVolumeSource(*in.ISCSI, out.ISCSI, c); err != nil { + return err + } + } else { + out.ISCSI = nil + } return nil } @@ -1771,6 +1779,16 @@ func deepCopy_v1beta3_ServiceAccount(in ServiceAccount, out *ServiceAccount, c * } else { out.Secrets = nil } + if in.ImagePullSecrets != nil { + out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) + for i := range in.ImagePullSecrets { + if err := deepCopy_v1beta3_LocalObjectReference(in.ImagePullSecrets[i], &out.ImagePullSecrets[i], c); err != nil { + return err + } + } + } else { + out.ImagePullSecrets = nil + } return nil }