From 87e85e25f1351b8ddd8016a9bb192137bef3b4cd Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Fri, 8 May 2015 11:31:35 -0700 Subject: [PATCH] Revert "Added ISCSI to PV structs" --- pkg/api/types.go | 3 --- pkg/api/v1/conversion.go | 6 ------ pkg/api/v1/types.go | 3 --- pkg/api/v1beta1/types.go | 3 --- pkg/api/v1beta2/types.go | 3 --- pkg/api/v1beta3/conversion_generated.go | 16 ---------------- pkg/api/v1beta3/types.go | 3 --- pkg/api/validation/validation.go | 4 ---- pkg/volume/iscsi/iscsi_test.go | 22 ---------------------- 9 files changed, 63 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index 537d17f01d8..ed4f75bf133 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -220,9 +220,6 @@ type PersistentVolumeSource struct { // This is useful for development and testing only. // on-host storage is not supported in any way HostPath *HostPathVolumeSource `json:"hostPath"` - // ISCSIVolumeSource represents an ISCSI resource that is attached to a - // kubelet's host machine and then exposed to the pod. - ISCSI *ISCSIVolumeSource `json:"iscsi"` // Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod Glusterfs *GlusterfsVolumeSource `json:"glusterfs"` // NFS represents an NFS mount on the host that shares a pod's lifetime diff --git a/pkg/api/v1/conversion.go b/pkg/api/v1/conversion.go index 6bde50d5655..032c5300786 100644 --- a/pkg/api/v1/conversion.go +++ b/pkg/api/v1/conversion.go @@ -1606,9 +1606,6 @@ func init() { if err := s.Convert(&in.HostPath, &out.HostPath, 0); err != nil { return err } - if err := s.Convert(&in.ISCSI, &out.ISCSI, 0); err != nil { - return err - } if err := s.Convert(&in.Glusterfs, &out.Glusterfs, 0); err != nil { return err } @@ -1627,9 +1624,6 @@ func init() { if err := s.Convert(&in.HostPath, &out.HostPath, 0); err != nil { return err } - if err := s.Convert(&in.ISCSI, &out.ISCSI, 0); err != nil { - return err - } if err := s.Convert(&in.Glusterfs, &out.Glusterfs, 0); err != nil { return err } diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 97e3efb8f17..baa8b431653 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -245,9 +245,6 @@ type PersistentVolumeSource struct { // 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"` - // 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"` // 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"` // NFS represents an NFS mount on the host diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 1c61df2e820..de8ada33a15 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -143,9 +143,6 @@ type PersistentVolumeSource struct { // 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"` - // 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"` // 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"` // NFS represents an NFS mount on the host diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index bc1d15d81ef..6275b6784f2 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -105,9 +105,6 @@ type PersistentVolumeSource struct { // 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"` - // 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"` // 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"` // NFS represents an NFS mount on the host diff --git a/pkg/api/v1beta3/conversion_generated.go b/pkg/api/v1beta3/conversion_generated.go index 700dfa16c5a..9086345e268 100644 --- a/pkg/api/v1beta3/conversion_generated.go +++ b/pkg/api/v1beta3/conversion_generated.go @@ -2245,14 +2245,6 @@ func convert_v1beta3_PersistentVolumeSource_To_api_PersistentVolumeSource(in *Pe } else { out.HostPath = nil } - if in.ISCSI != nil { - out.ISCSI = new(newer.ISCSIVolumeSource) - if err := convert_v1beta3_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in.ISCSI, out.ISCSI, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } if in.Glusterfs != nil { out.Glusterfs = new(newer.GlusterfsVolumeSource) if err := convert_v1beta3_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in.Glusterfs, out.Glusterfs, s); err != nil { @@ -2300,14 +2292,6 @@ func convert_api_PersistentVolumeSource_To_v1beta3_PersistentVolumeSource(in *ne } else { out.HostPath = nil } - if in.ISCSI != nil { - out.ISCSI = new(ISCSIVolumeSource) - if err := convert_api_ISCSIVolumeSource_To_v1beta3_ISCSIVolumeSource(in.ISCSI, out.ISCSI, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } if in.Glusterfs != nil { out.Glusterfs = new(GlusterfsVolumeSource) if err := convert_api_GlusterfsVolumeSource_To_v1beta3_GlusterfsVolumeSource(in.Glusterfs, out.Glusterfs, s); err != nil { diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index b750f2ac7af..4482931d485 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -245,9 +245,6 @@ type PersistentVolumeSource struct { // 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"` - // 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"` // 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"` // NFS represents an NFS mount on the host diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go index 8e29503eb52..2889a91f6c6 100644 --- a/pkg/api/validation/validation.go +++ b/pkg/api/validation/validation.go @@ -461,10 +461,6 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) errs.ValidationErrorList numVolumes++ allErrs = append(allErrs, validateAWSElasticBlockStoreVolumeSource(pv.Spec.AWSElasticBlockStore).Prefix("awsElasticBlockStore")...) } - if pv.Spec.ISCSI != nil { - numVolumes++ - allErrs = append(allErrs, validateISCSIVolumeSource(pv.Spec.ISCSI).Prefix("iscsi")...) - } if pv.Spec.Glusterfs != nil { numVolumes++ allErrs = append(allErrs, validateGlusterfs(pv.Spec.Glusterfs).Prefix("glusterfs")...) diff --git a/pkg/volume/iscsi/iscsi_test.go b/pkg/volume/iscsi/iscsi_test.go index 82ec3cc5c9d..b3cdf9f494a 100644 --- a/pkg/volume/iscsi/iscsi_test.go +++ b/pkg/volume/iscsi/iscsi_test.go @@ -39,28 +39,6 @@ func TestCanSupport(t *testing.T) { } } -func TestGetAccessModes(t *testing.T) { - plugMgr := volume.VolumePluginMgr{} - plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) - - plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/iscsi") - if err != nil { - t.Errorf("Can't find the plugin by name") - } - if !contains(plug.GetAccessModes(), api.ReadWriteOnce) || !contains(plug.GetAccessModes(), api.ReadOnlyMany) { - t.Errorf("Expected two AccessModeTypes: %s and %s", api.ReadWriteOnce, api.ReadOnlyMany) - } -} - -func contains(modes []api.AccessModeType, mode api.AccessModeType) bool { - for _, m := range modes { - if m == mode { - return true - } - } - return false -} - type fakeDiskManager struct { attachCalled bool detachCalled bool