Skip to content

Commit 5e148e0

Browse files
Merge pull request #1876 from fmount/sharev1
Set ManilaShareV1 annotation via OpenStackVersion
2 parents 2e0be68 + bf20ef1 commit 5e148e0

7 files changed

Lines changed: 29 additions & 0 deletions

File tree

api/bases/core.openstack.org_openstackversions.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ spec:
252252
type: string
253253
glanceWsgi:
254254
type: string
255+
manilaSharev1:
256+
type: string
255257
rabbitmqVersion:
256258
type: string
257259
type: object
@@ -691,6 +693,8 @@ spec:
691693
type: string
692694
glanceWsgi:
693695
type: string
696+
manilaSharev1:
697+
type: string
694698
rabbitmqVersion:
695699
type: string
696700
type: object

api/core/v1beta1/openstackversion_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ type ServiceDefaults struct {
180180
GlanceWsgi *string `json:"glanceWsgi,omitempty"`
181181
RabbitmqVersion *string `json:"rabbitmqVersion,omitempty"`
182182
GlanceLocationAPI *string `json:"glanceLocationAPI,omitempty"`
183+
ManilaSharev1 *string `json:"manilaSharev1,omitempty"`
183184
}
184185

185186
// OpenStackVersionStatus defines the observed state of OpenStackVersion

api/core/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindata/crds/crds.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21478,6 +21478,8 @@ spec:
2147821478
type: string
2147921479
glanceWsgi:
2148021480
type: string
21481+
manilaSharev1:
21482+
type: string
2148121483
rabbitmqVersion:
2148221484
type: string
2148321485
type: object
@@ -21917,6 +21919,8 @@ spec:
2191721919
type: string
2191821920
glanceWsgi:
2191921921
type: string
21922+
manilaSharev1:
21923+
type: string
2192021924
rabbitmqVersion:
2192121925
type: string
2192221926
type: object

config/crd/bases/core.openstack.org_openstackversions.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ spec:
252252
type: string
253253
glanceWsgi:
254254
type: string
255+
manilaSharev1:
256+
type: string
255257
rabbitmqVersion:
256258
type: string
257259
type: object
@@ -691,6 +693,8 @@ spec:
691693
type: string
692694
glanceWsgi:
693695
type: string
696+
manilaSharev1:
697+
type: string
694698
rabbitmqVersion:
695699
type: string
696700
type: object

internal/openstack/manila.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ func ReconcileManila(ctx context.Context, instance *corev1beta1.OpenStackControl
216216
//manila.Spec.DatabaseInstance = instance.Name // name of MariaDB we create here
217217
manila.Spec.DatabaseInstance = "openstack" //FIXME: see above
218218
}
219+
if manila.GetAnnotations() == nil {
220+
manila.SetAnnotations(make(map[string]string))
221+
}
222+
if version.Status.ServiceDefaults.ManilaSharev1 != nil && *version.Status.ServiceDefaults.ManilaSharev1 == "true" {
223+
manila.GetAnnotations()[manilav1.ManilaShareV1Label] = "true"
224+
} else {
225+
manila.GetAnnotations()[manilav1.ManilaShareV1Label] = "false"
226+
}
219227
// Append globally defined extraMounts to the service's own list.
220228
for _, ev := range instance.Spec.ExtraMounts {
221229
manila.Spec.ExtraMounts = append(manila.Spec.ExtraMounts, manilav1.ManilaExtraVolMounts{

internal/openstack/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ func InitializeOpenStackVersionServiceDefaults(ctx context.Context) *corev1beta1
232232
trueString := "true"
233233
defaults.GlanceWsgi = &trueString // all new glance deployments use WSGI by default (FR3 and later)
234234
defaults.GlanceLocationAPI = ptr.To("false") // disable location-api for RHOSO 18: this boolean can be switched to true with RHOSO 19 release
235+
// NOTE: In 18 Manila creates sharev1 service and endpoints. From 19 do not create sharev1 anymore
236+
// https://review.opendev.org/q/topic:%22remove-v1%22+and+project:openstack/manila
237+
defaults.ManilaSharev1 = &trueString // all Manila deployments create sharev1 endpoints by default
235238

236239
versionString := "4.2"
237240
defaults.RabbitmqVersion = &versionString // all new rabbitmq deployments will have rabbitmq-server 4.2 (FR5)

0 commit comments

Comments
 (0)