-
Notifications
You must be signed in to change notification settings - Fork 100
Add NotificationsBusInstance API field #1591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,13 @@ type OpenStackControlPlaneSpec struct { | |
// Rabbitmq - Parameters related to the Rabbitmq service | ||
Rabbitmq RabbitmqSection `json:"rabbitmq,omitempty"` | ||
|
||
// +kubebuilder:validation:Optional | ||
// NotificationsBusInstance - the name of RabbitMQ Cluster CR to select a Messaging | ||
// Bus Service instance used by all services that produce or consume notifications. | ||
// Avoid colocating it with RabbitMQ services used for PRC. | ||
// That instance will be pushed down for services, unless overriden in templates. | ||
NotificationsBusInstance *string `json:"notificationsBusInstance,omitempty"` | ||
fmount marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK so the usual considerations:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to check if we need both "" and nil value here to mean different things. If not the we can either opt to use "" only, or define that "" and means the same for this field. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the linked top-scope impl patch follows the above (except we had reached no agreement for empty values meaning) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Correct, this is consistent with the current implementation for storage operators.
Correct, this is an assumption consistent with the top-down propagation model.
Correct, from an API perspective this is how we use to handle overrides at service level. I think the "complication" is something that might be handled by service operators, unless you envision some logic at the openstack-operator level. I think we might want to keep things easy here, and defer more logic (based on the input we receive) at service operator level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think checking if that what the user sets is not an empty string is something we can catch from webhooks, so we can cover updates of the same field (while kubebuilder would help us only at CR creation time) and we can decide to default it to nil. However, I think that raising an error (usual webhook flow) would be better to have a human operator fix the input or remove the parameter entirely. |
||
|
||
// +kubebuilder:validation:Optional | ||
// +operator-sdk:csv:customresourcedefinitions:type=spec | ||
// Memcached - Parameters related to the Memcached service | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,12 @@ func ReconcileCinder(ctx context.Context, instance *corev1beta1.OpenStackControl | |
instance.Spec.Cinder.Template.TopologyRef = instance.Spec.TopologyRef | ||
} | ||
|
||
// When no NotificationsBusInstance is referenced in the subCR (override) | ||
// try to inject the top-level one if defined | ||
if instance.Spec.Cinder.Template.NotificationsBusInstance == nil { | ||
instance.Spec.Cinder.Template.NotificationsBusInstance = instance.Spec.NotificationsBusInstance | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this inherits the "" value to the service level. We need to see if that is what we want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, how to handle empty values remained a gray area in the design. See in the #1402 descr:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you look at cinder/glance/manila implementation, for example [1], the parameter is the same, and at openstack-operator it realizes only a parameter inheritance, if required, so I don't see any problem w/ set/update/delete for storage CRs (basically it's the same thing we did for topologies). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this situation is no longer possible as empty strings became prohibited in webhook |
||
} | ||
|
||
Log.Info("Reconciling Cinder", "Cinder.Namespace", instance.Namespace, "Cinder.Name", cinderName) | ||
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), cinder, func() error { | ||
instance.Spec.Cinder.Template.CinderSpecBase.DeepCopyInto(&cinder.Spec.CinderSpecBase) | ||
|
Uh oh!
There was an error while loading. Please reload this page.