From 4d86e130079a3bd482dd00a7ccc6b6b57b4c4c32 Mon Sep 17 00:00:00 2001 From: Ian Ballou Date: Fri, 19 Jul 2024 16:11:00 +0000 Subject: [PATCH] Fixes #37668 - enable container push by default --- .../api/registry/registry_proxies_controller.rb | 10 ---------- .../api/registry/registry_proxies_controller_test.rb | 1 - 2 files changed, 11 deletions(-) diff --git a/app/controllers/katello/api/registry/registry_proxies_controller.rb b/app/controllers/katello/api/registry/registry_proxies_controller.rb index fa21f42727c..3f6f56e3fc3 100644 --- a/app/controllers/katello/api/registry/registry_proxies_controller.rb +++ b/app/controllers/katello/api/registry/registry_proxies_controller.rb @@ -84,7 +84,6 @@ def registry_authorize def container_push_prop_validation(props = nil) # Handle validation and repo creation for container pushes before talking to pulp - return false unless confirm_push_settings props = parse_blob_push_props if props.nil? return false unless check_blob_push_field_syntax(props) @@ -774,15 +773,6 @@ def confirm_settings :locals => { :message => "Registry not configured" }) end - def confirm_push_settings - return true if SETTINGS.dig(:katello, :container_image_registry, :allow_push) - render_podman_error( - "UNSUPPORTED", - _("Registry push is not enabled. To enable, add ':katello:'->':container_image_registry:'->':allow_push: true' in the katello settings file."), - :unprocessable_entity - ) - end - def request_url request.protocol + request.host_with_port end diff --git a/test/controllers/api/registry/registry_proxies_controller_test.rb b/test/controllers/api/registry/registry_proxies_controller_test.rb index 098699b9535..c5ba3a7a9a1 100644 --- a/test/controllers/api/registry/registry_proxies_controller_test.rb +++ b/test/controllers/api/registry/registry_proxies_controller_test.rb @@ -29,7 +29,6 @@ def setup_permissions setup_permissions setup_controller_defaults_api - SETTINGS[:katello][:container_image_registry] = {crane_url: 'https://localhost:5000', crane_ca_cert_file: '/etc/pki/katello/certs/katello-default-ca.crt', allow_push: true} File.delete("#{Rails.root}/tmp/manifest.json") if File.exist?("#{Rails.root}/tmp/manifest.json") end