Skip to content

Commit a9bdde1

Browse files
Remove CephFS volume support from the Kubernetes provider
1 parent a443c94 commit a9bdde1

File tree

3 files changed

+0
-115
lines changed

3 files changed

+0
-115
lines changed

kubernetes/structure_persistent_volume_spec.go

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,6 @@ func flattenAzureFilePersistentVolumeSource(in *v1.AzureFilePersistentVolumeSour
6767
return []interface{}{att}
6868
}
6969

70-
func flattenCephFSVolumeSource(in *v1.CephFSVolumeSource) []interface{} {
71-
att := make(map[string]interface{})
72-
att["monitors"] = newStringSet(schema.HashString, in.Monitors)
73-
if in.Path != "" {
74-
att["path"] = in.Path
75-
}
76-
if in.User != "" {
77-
att["user"] = in.User
78-
}
79-
if in.SecretFile != "" {
80-
att["secret_file"] = in.SecretFile
81-
}
82-
if in.SecretRef != nil {
83-
att["secret_ref"] = flattenLocalObjectReference(in.SecretRef)
84-
}
85-
if in.ReadOnly {
86-
att["read_only"] = in.ReadOnly
87-
}
88-
return []interface{}{att}
89-
}
90-
9170
func flattenCephFSPersistentVolumeSource(in *v1.CephFSPersistentVolumeSource) []interface{} {
9271
att := make(map[string]interface{})
9372
att["monitors"] = newStringSet(schema.HashString, in.Monitors)
@@ -625,32 +604,6 @@ func expandAzureFilePersistentVolumeSource(l []interface{}) *v1.AzureFilePersist
625604
return obj
626605
}
627606

628-
func expandCephFSVolumeSource(l []interface{}) *v1.CephFSVolumeSource {
629-
if len(l) == 0 || l[0] == nil {
630-
return &v1.CephFSVolumeSource{}
631-
}
632-
in := l[0].(map[string]interface{})
633-
obj := &v1.CephFSVolumeSource{
634-
Monitors: sliceOfString(in["monitors"].(*schema.Set).List()),
635-
}
636-
if v, ok := in["path"].(string); ok {
637-
obj.Path = v
638-
}
639-
if v, ok := in["user"].(string); ok {
640-
obj.User = v
641-
}
642-
if v, ok := in["secret_file"].(string); ok {
643-
obj.SecretFile = v
644-
}
645-
if v, ok := in["secret_ref"].([]interface{}); ok && len(v) > 0 {
646-
obj.SecretRef = expandLocalObjectReference(v)
647-
}
648-
if v, ok := in["read_only"].(bool); ok {
649-
obj.ReadOnly = v
650-
}
651-
return obj
652-
}
653-
654607
func expandCephFSPersistentVolumeSource(l []interface{}) *v1.CephFSPersistentVolumeSource {
655608
if len(l) == 0 || l[0] == nil {
656609
return &v1.CephFSPersistentVolumeSource{}
@@ -1522,28 +1475,6 @@ func patchPersistentVolumeSource(pathPrefix, prefix string, d *schema.ResourceDa
15221475
}
15231476
}
15241477

1525-
if d.HasChange(prefix + "ceph_fs") {
1526-
oldIn, newIn := d.GetChange(prefix + "ceph_fs")
1527-
oldV, oldOk := oldIn.([]interface{})
1528-
newV, newOk := newIn.([]interface{})
1529-
1530-
if newOk && len(newV) > 0 {
1531-
if oldOk && len(oldV) > 0 {
1532-
ops = append(ops, &ReplaceOperation{
1533-
Path: pathPrefix + "/cephfs",
1534-
Value: expandCephFSVolumeSource(newV),
1535-
})
1536-
} else {
1537-
ops = append(ops, &AddOperation{
1538-
Path: pathPrefix + "/cephfs",
1539-
Value: expandCephFSVolumeSource(newV),
1540-
})
1541-
}
1542-
} else if oldOk && len(oldV) > 0 {
1543-
ops = append(ops, &RemoveOperation{Path: pathPrefix + "/cephfs"})
1544-
}
1545-
}
1546-
15471478
if d.HasChange(prefix + "fc") {
15481479
oldIn, newIn := d.GetChange(prefix + "fc")
15491480
oldV, oldOk := oldIn.([]interface{})

kubernetes/structures_pod.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ func flattenVolumes(volumes []v1.Volume) []interface{} {
410410
if v.Cinder != nil {
411411
obj["cinder"] = flattenCinderVolumeSource(v.Cinder)
412412
}
413-
if v.CephFS != nil {
414-
obj["ceph_fs"] = flattenCephFSVolumeSource(v.CephFS)
415-
}
416413
if v.CSI != nil {
417414
obj["csi"] = flattenCSIVolumeSource(v.CSI)
418415
}
@@ -1604,9 +1601,6 @@ func expandVolumes(volumes []interface{}) ([]v1.Volume, error) {
16041601
if v, ok := m["cinder"].([]interface{}); ok && len(v) > 0 {
16051602
vl[i].Cinder = expandCinderVolumeSource(v)
16061603
}
1607-
if v, ok := m["ceph_fs"].([]interface{}); ok && len(v) > 0 {
1608-
vl[i].CephFS = expandCephFSVolumeSource(v)
1609-
}
16101604
if v, ok := m["csi"].([]interface{}); ok && len(v) > 0 {
16111605
vl[i].CSI = expandCSIVolumeSource(v)
16121606
}

manifest/openapi/testdata/k8s-swagger.json

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -80318,42 +80318,6 @@
8031880318
}
8031980319
}
8032080320
},
80321-
"io.k8s.api.core.v1.CephFSVolumeSource": {
80322-
"description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.",
80323-
"type": "object",
80324-
"required": [
80325-
"monitors"
80326-
],
80327-
"properties": {
80328-
"monitors": {
80329-
"description": "Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it",
80330-
"type": "array",
80331-
"items": {
80332-
"type": "string"
80333-
}
80334-
},
80335-
"path": {
80336-
"description": "Optional: Used as the mounted root, rather than the full Ceph tree, default is /",
80337-
"type": "string"
80338-
},
80339-
"readOnly": {
80340-
"description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it",
80341-
"type": "boolean"
80342-
},
80343-
"secretFile": {
80344-
"description": "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it",
80345-
"type": "string"
80346-
},
80347-
"secretRef": {
80348-
"description": "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it",
80349-
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
80350-
},
80351-
"user": {
80352-
"description": "Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it",
80353-
"type": "string"
80354-
}
80355-
}
80356-
},
8035780321
"io.k8s.api.core.v1.CinderPersistentVolumeSource": {
8035880322
"description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.",
8035980323
"type": "object",
@@ -85481,10 +85445,6 @@
8548185445
"description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.",
8548285446
"$ref": "#/definitions/io.k8s.api.core.v1.AzureFileVolumeSource"
8548385447
},
85484-
"cephfs": {
85485-
"description": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime",
85486-
"$ref": "#/definitions/io.k8s.api.core.v1.CephFSVolumeSource"
85487-
},
8548885448
"cinder": {
8548985449
"description": "Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md",
8549085450
"$ref": "#/definitions/io.k8s.api.core.v1.CinderVolumeSource"

0 commit comments

Comments
 (0)