Skip to content
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

Halt upgrades if evr is not owned by foreman #953

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ianballou
Copy link
Contributor

Halts upgrades if the evr extension in Katello external DBs are not owned by foreman. Skips the checks if the evr extension does not exist.

Related installer PR: theforeman/foreman-installer#984

@ianballou ianballou force-pushed the halt-upgrade-remote-db-evr-permissions branch 2 times, most recently from 4cd6c7a to a54ac48 Compare November 18, 2024 16:39
@ianballou ianballou force-pushed the halt-upgrade-remote-db-evr-permissions branch from a54ac48 to d4d3d5b Compare November 18, 2024 16:43
@ianballou
Copy link
Contributor Author

All the comments should be addressed now.

unless evr_owned_by_postgres.empty?
return evr_owned_by_postgres.first['evr_owned_by_postgres'] == '0'
end
fail!('Could not determine if the evr extension is owned by the foreman DB owner')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we expect a user that hits this fail statement to do next? Can we give them some direction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only failures reasons I can think of would be if the DB connection failed or if the config doesn't have the correct username information. I've updated the error message.

@ianballou ianballou force-pushed the halt-upgrade-remote-db-evr-permissions branch from 40e70cd to d86def9 Compare November 18, 2024 18:55
@ianballou
Copy link
Contributor Author

I stopped hardcoding 'foreman' as the DB name just in case. We are hardcoding it in the installer check, but I figured why not here since it seems to be supported.

@ehelms
Copy link
Member

ehelms commented Nov 18, 2024

I had just a minor nit, @evgeni please also do a final review

@ianballou ianballou force-pushed the halt-upgrade-remote-db-evr-permissions branch from d86def9 to e6dc6f1 Compare November 18, 2024 19:23
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.

2 participants