diff --git a/pkg/api/types.go b/pkg/api/types.go index 558426da78c..5504ba2f213 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"` + 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"` + 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,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. @@ -214,28 +214,28 @@ 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 { // 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 e9cc86b9ec6..18855dd86e5 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -223,12 +223,12 @@ 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 { // 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"` @@ -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 c7100cd27e0..eb456722443 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,28 +142,28 @@ 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"` + 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 { // 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..ae654016fdc 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,28 +97,28 @@ 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"` + 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 { // 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/v1beta3/types.go b/pkg/api/v1beta3/types.go index 27956cb2a0b..c5fdb8180bd 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 { @@ -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 {