Skip to content

Always import default data if rabbit_table:needs_default_data/0 is true #7722

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

Closed
wants to merge 1 commit into from

Conversation

lukebakken
Copy link
Collaborator

Fixes #7678

References:

PR #2396 preserved the old behavior where definitions import took priority over the default data and environment data that may be present. This behavior continues to confuse users where they expect RABBITMQ_DEFAULT_USER / RABBITMQ_DEFAULT_PASS to be imported, especially if there is no users data in the definitions file.

This PR allows default data and the environment to be imported first, then possibly overwritten by the definitions file.

Fixes #7678

References:
* #2384
* #2396

PR #2396 preserved the old behavior where definitions import took
priority over the default data and environment data that may be present.
This behavior continues to confuse users where they expect
`RABBITMQ_DEFAULT_USER` / `RABBITMQ_DEFAULT_PASS` to be imported,
especially if there is no `users` data in the definitions file.

This PR allows default data and the environment to be imported first,
then possibly overwritten by the definitions file.
@lukebakken lukebakken self-assigned this Mar 22, 2023
@dumbbell
Copy link
Collaborator

dumbbell commented Mar 22, 2023

Can this be broken down per type of default data?

  1. Import definitions
  2. If there are no virtual hosts (which means there are no imported queues/exchanges), create the default virtual host
  3. If there are no users, create the default user

Instead of treating the default user and the default virtual host as an atomic thing.

@lukebakken lukebakken closed this Mar 22, 2023
@lukebakken lukebakken deleted the rabbitmq-server-7678 branch March 22, 2023 14:52
@lukebakken
Copy link
Collaborator Author

@dumbbell that's not a bad idea. I didn't like the way I was approaching in this PR anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RABBITMQ_DEFAULT_USER / RABBITMQ_DEFAULT_PASS behavior continues to confuse users
2 participants