Skip to content

Commit

Permalink
WIP: Use github.com/dprince/lib-common/modules/storage
Browse files Browse the repository at this point in the history
  • Loading branch information
dprince committed Oct 15, 2024
1 parent af5e27b commit 138fb6a
Show file tree
Hide file tree
Showing 16 changed files with 4,683 additions and 6,576 deletions.
1,122 changes: 465 additions & 657 deletions api/bases/cinder.openstack.org_cinderapis.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions api/bases/cinder.openstack.org_cinderbackups.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions api/bases/cinder.openstack.org_cinders.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions api/bases/cinder.openstack.org_cinderschedulers.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions api/bases/cinder.openstack.org_cindervolumes.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ require (
// mschuppert: map to latest commit from release-4.16 tag
// must consistent within modules and service operators
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 //allow-merging

replace github.com/openstack-k8s-operators/lib-common/modules/storage => github.com/dprince/lib-common/modules/storage v0.0.0-20241015131309-7eba2ebf2792
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dprince/lib-common/modules/storage v0.0.0-20241015131309-7eba2ebf2792 h1:q/P/uUs0XWvjxEgQDSUAXaraf2eFQn4Z5sCkdkU5tyc=
github.com/dprince/lib-common/modules/storage v0.0.0-20241015131309-7eba2ebf2792/go.mod h1:cGynoLGY9NfyIeWXI3zZ+hgZdHF3SUi8ht5ygZ8CmhI=
github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU=
github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
Expand Down Expand Up @@ -74,8 +76,6 @@ github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20241014140317-e5c35d28f3af h1:MNNuYPfaXWf14lfsWGay3WjLjIIu9KN5+iHrLdCMQac=
github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20241014140317-e5c35d28f3af/go.mod h1:EKfyFMU2brJYqR4M2Hwfo5ZLBQxAJXAYfHjpdqX6N5g=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.4.1-0.20241014140317-e5c35d28f3af h1:l8GXJhv4P/fy7Amz9XPEi8sn+hvxrQf1gICpmOaqOuE=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.4.1-0.20241014140317-e5c35d28f3af/go.mod h1:cGynoLGY9NfyIeWXI3zZ+hgZdHF3SUi8ht5ygZ8CmhI=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/cinder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const (
// DBPurgeDefaultSchedule - Default cron schedule for purging the DB
DBPurgeDefaultSchedule = "1 0 * * *"
// APITimeoutDefault - Default timeout in seconds for HAProxy, Apache, and RPCs
APITimeoutDefault = 60
APITimeoutDefault = 60
)

type CinderSpecBase struct {
Expand Down
1,122 changes: 465 additions & 657 deletions config/crd/bases/cinder.openstack.org_cinderapis.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions config/crd/bases/cinder.openstack.org_cinderbackups.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions config/crd/bases/cinder.openstack.org_cinders.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions config/crd/bases/cinder.openstack.org_cinderschedulers.yaml

Large diffs are not rendered by default.

1,122 changes: 465 additions & 657 deletions config/crd/bases/cinder.openstack.org_cindervolumes.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ replace github.com/openstack-k8s-operators/cinder-operator/api => ./api
// mschuppert: map to latest commit from release-4.16 tag
// must consistent within modules and service operators
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 //allow-merging

replace github.com/openstack-k8s-operators/lib-common/modules/storage => github.com/dprince/lib-common/modules/storage v0.0.0-20241015131309-7eba2ebf2792
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dprince/lib-common/modules/storage v0.0.0-20241015131309-7eba2ebf2792 h1:q/P/uUs0XWvjxEgQDSUAXaraf2eFQn4Z5sCkdkU5tyc=
github.com/dprince/lib-common/modules/storage v0.0.0-20241015131309-7eba2ebf2792/go.mod h1:cGynoLGY9NfyIeWXI3zZ+hgZdHF3SUi8ht5ygZ8CmhI=
github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU=
github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
Expand Down Expand Up @@ -85,8 +87,6 @@ github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.2024101414
github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20241014140317-e5c35d28f3af/go.mod h1:EKfyFMU2brJYqR4M2Hwfo5ZLBQxAJXAYfHjpdqX6N5g=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20241014140317-e5c35d28f3af h1:fevDUHmqcnI4wDTKupKe/CcgVdgNpZXWkJx8u0/xEXs=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20241014140317-e5c35d28f3af/go.mod h1:djfljx3jfHqywhY3oDvPg/GLKwiFVkds6v7P7/Yg+8g=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.4.1-0.20241014140317-e5c35d28f3af h1:l8GXJhv4P/fy7Amz9XPEi8sn+hvxrQf1gICpmOaqOuE=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.4.1-0.20241014140317-e5c35d28f3af/go.mod h1:cGynoLGY9NfyIeWXI3zZ+hgZdHF3SUi8ht5ygZ8CmhI=
github.com/openstack-k8s-operators/lib-common/modules/test v0.4.1-0.20241014140317-e5c35d28f3af h1:u5yJ/rV9VBMjKIcsu16/3rhiPcBxZN2sPqxnZHoRrNc=
github.com/openstack-k8s-operators/lib-common/modules/test v0.4.1-0.20241014140317-e5c35d28f3af/go.mod h1:LV0jo5etIsGyINpmB37i4oWR8zU6ApIuh7fsqGGA41o=
github.com/openstack-k8s-operators/mariadb-operator/api v0.4.1-0.20241015090956-b0954ab72dcd h1:PqJByNFRxjnhcEMv9vrXX1wH4qOYOt+fSdGmOEkC5gA=
Expand Down
25 changes: 24 additions & 1 deletion pkg/cinder/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,30 @@ func GetVolumes(name string, storageSvc bool, extraVol []cinderv1beta1.CinderExt

for _, exv := range extraVol {
for _, vol := range exv.Propagate(svc) {
res = append(res, vol.Volumes...)
for _, v := range vol.Volumes {
convertedVolume := corev1.Volume{
Name: v.Name,
VolumeSource: corev1.VolumeSource{
HostPath: v.VolumeSource.HostPath,
EmptyDir: v.VolumeSource.EmptyDir,
Secret: v.VolumeSource.Secret,
NFS: v.VolumeSource.NFS,
ISCSI: v.VolumeSource.ISCSI,
PersistentVolumeClaim: v.VolumeSource.PersistentVolumeClaim,
CephFS: v.VolumeSource.CephFS,
DownwardAPI: v.VolumeSource.DownwardAPI,
FC: v.VolumeSource.FC,
ConfigMap: v.VolumeSource.ConfigMap,
PhotonPersistentDisk: v.VolumeSource.PhotonPersistentDisk,
Projected: v.VolumeSource.Projected,
ScaleIO: v.VolumeSource.ScaleIO,
StorageOS: v.VolumeSource.StorageOS,
CSI: v.VolumeSource.CSI,
Ephemeral: v.VolumeSource.Ephemeral,
},
}
res = append(res, convertedVolume)
}
}
}
return res
Expand Down

0 comments on commit 138fb6a

Please sign in to comment.