Skip to content

Commit

Permalink
Fixes #37822 - Re-raise non-container push repo validation errors (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 authored Sep 26, 2024
1 parent c87ef0f commit 9456160
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/lib/actions/katello/repository/create_root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ class CreateRoot < Actions::EntryAction
def plan(root, relative_path = nil)
begin
root.save!
rescue ActiveRecord::RecordInvalid
if root.is_container_push
rescue ActiveRecord::RecordInvalid => e
if root.is_container_push && e.message.include?("Container Repository Name") && e.message.include?("conflicts with an existing repository")
logger.warn("Skipping repository creation as container push repository already exists: #{root.container_push_name}")
return
end
raise e
end
repository = ::Katello::Repository.new(:environment => root.organization.library,
:content_view_version => root.organization.library.default_content_view_version,
Expand Down

0 comments on commit 9456160

Please sign in to comment.