Skip to content

Commit

Permalink
Fixes #36772 - container gateway db timeout tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou committed Sep 22, 2023
1 parent 146218e commit bd7321b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions manifests/plugin/container_gateway.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#
# $sqlite_db_path:: Absolute path for the SQLite DB file to exist at
#
# $sqlite_timeout:: Database busy timeout in milliseconds
#
# === Advanced parameters:
#
# $enabled:: enables/disables the pulp plugin
Expand All @@ -21,6 +23,7 @@
Foreman_proxy::ListenOn $listen_on = 'https',
Stdlib::HTTPUrl $pulp_endpoint = "https://${facts['networking']['fqdn']}",
Stdlib::Absolutepath $sqlite_db_path = '/var/lib/foreman-proxy/smart_proxy_container_gateway.db',
Integer $sqlite_timeout = 30_000,
) {
foreman_proxy::plugin::module { 'container_gateway':
version => $version,
Expand Down
7 changes: 5 additions & 2 deletions spec/classes/foreman_proxy__plugin__container_gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
'---',
':enabled: https',
":pulp_endpoint: https://#{facts[:fqdn]}",
':sqlite_db_path: /var/lib/foreman-proxy/smart_proxy_container_gateway.db'
':sqlite_db_path: /var/lib/foreman-proxy/smart_proxy_container_gateway.db',
':sqlite_timeout: 30000'
])
end
end
Expand All @@ -22,14 +23,16 @@
let :params do {
:pulp_endpoint => 'https://test.example.com',
:sqlite_db_path => '/dev/null.db',
:sqlite_timeout => 12_345,
} end

it 'container_gateway.yml should contain the correct configuration' do
verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml', [
'---',
':enabled: https',
':pulp_endpoint: https://test.example.com',
':sqlite_db_path: /dev/null.db'
':sqlite_db_path: /dev/null.db',
':sqlite_timeout: 12345'
])
end
end
Expand Down
1 change: 1 addition & 0 deletions templates/plugin/container_gateway.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
:enabled: <%= @module_enabled %>
:pulp_endpoint: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::pulp_endpoint") %>
:sqlite_db_path: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_db_path") %>
:sqlite_timeout: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_timeout") %>

0 comments on commit bd7321b

Please sign in to comment.