-
Notifications
You must be signed in to change notification settings - Fork 60
Rabbitmq vhost and user support #1052
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 |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ limitations under the License. | |
| package v1beta1 | ||
|
|
||
| import ( | ||
| rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1" | ||
| topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1" | ||
| condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
@@ -43,14 +44,18 @@ type NovaSpecCore struct { | |
| APIDatabaseInstance string `json:"apiDatabaseInstance"` | ||
|
|
||
| // +kubebuilder:validation:Optional | ||
| // +kubebuilder:default=rabbitmq | ||
| // APIMessageBusInstance is the name of the RabbitMqCluster CR to select | ||
| // the Message Bus Service instance used by the Nova top level services to | ||
| // communicate. | ||
| APIMessageBusInstance string `json:"apiMessageBusInstance"` | ||
| // Deprecated: Use MessagingBus.Cluster instead | ||
| APIMessageBusInstance string `json:"apiMessageBusInstance,omitempty"` | ||
|
|
||
| // +kubebuilder:validation:Optional | ||
| // +kubebuilder:default={cell0: {cellDatabaseAccount: nova-cell0, hasAPIAccess: true}, cell1: {cellDatabaseAccount: nova-cell1, cellDatabaseInstance: openstack-cell1, cellMessageBusInstance: rabbitmq-cell1, hasAPIAccess: true}} | ||
| // MessagingBus configuration (username, vhost, and cluster) | ||
| MessagingBus rabbitmqv1.RabbitMqConfig `json:"messagingBus,omitempty"` | ||
|
|
||
| // +kubebuilder:validation:Optional | ||
| // +kubebuilder:default={cell0: {cellDatabaseAccount: nova-cell0, hasAPIAccess: true}, cell1: {cellDatabaseAccount: nova-cell1, cellDatabaseInstance: openstack-cell1, messagingBus: {cluster: rabbitmq-cell1}, hasAPIAccess: true}} | ||
| // Cells is a mapping of cell names to NovaCellTemplate objects defining | ||
| // the cells in the deployment. The "cell0" cell is a mandatory cell in | ||
| // every deployment. Moreover any real deployment needs at least one | ||
|
|
@@ -130,7 +135,11 @@ type NovaSpecCore struct { | |
| // An empty value "" leaves the notification drivers unconfigured and emitting no notifications at all. | ||
| // Avoid colocating it with RabbitMqClusterName, APIMessageBusInstance or CellMessageBusInstance used for RPC. | ||
| // For particular Nova cells, notifications cannot be disabled, nor configured differently. | ||
| NotificationsBusInstance *string `json:"notificationsBusInstance,omitempty"` | ||
| NotificationsBusInstance *string `json:"notificationsBusInstance,omitempty" deprecated:"true" deprecatedNew:"notificationsBus.cluster"` | ||
|
|
||
| // +kubebuilder:validation:Optional | ||
| // NotificationsBus configuration (username, vhost, and cluster) for notifications | ||
| NotificationsBus *rabbitmqv1.RabbitMqConfig `json:"notificationsBus,omitempty"` | ||
|
Contributor
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. so the pre-commit failure is because of this while NotificationsBus is optional it has requried field internally and that is not sumethign that is supproted by kubebuilder ERROR: "NoNewRequiredFields": crd/nova.nova.openstack.org version/v1beta1 field/^.spec.cellTemplates[*].messagingBus.cluster is new and may not be required to fix that we need to chagne the type definiton for rabbitmqv1.RabbitMqConfig or we need to alter the pre-commti config for that check |
||
|
|
||
| // +kubebuilder:validation:Optional | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like we could/shoudl move some of these validation function into lib common and just take the field names/paths as inputs to them
we do no need to address this comment now but duplicating this logic in multiple operator is sub optimal so it would be a good thing to consolidate into lib common and reuse later.
to do that you may need ot use generics and im not sure if we have access to thos in our current go so just food for thought.