smart_proxy_container_gateway 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a911ad6150f04b74e216b6f23aa6ac56e95d40b9e356a9a10ff371910e3f417
4
- data.tar.gz: d4555205824e57baadc3dbadb8e27a417dea5c473d9ad8523d48364a87bc3116
3
+ metadata.gz: ed0a914e50f04c3851c5ddde3f117ed6ab10d87912c1736cd229d270e44f9043
4
+ data.tar.gz: cc6e50ca1142aa6e4a8103092033bafb8c0b29e342bc8edb303b7ecf4e53ddf7
5
5
  SHA512:
6
- metadata.gz: dde5105d42b3b1c566f8713e2e0727dd8af35417266f44bc74b86ea06263c290272f92d2caaa023cc0a23cc7ca9551e2f5b1c7e7b57e1fc061ea13e53aca51ae
7
- data.tar.gz: 2710e2eed201d458c22193ae9f06ccd78b3de6e9a669585de93970646d2cdeff2f1f88aee428d4b1c7f9c46108f00f61aa115b2dcfca7ed5b2ee2bb7fbd3aa88
6
+ metadata.gz: 87a98b19c70679c4e1529adf4b080e8b9c5bd78fdde4db87709f76743eb43ad8b6ee0552a42bfc03465d36679da768e4d4f8c5ef8daca58dcd31d07e256bd9d2
7
+ data.tar.gz: 470244c840404138894b8f22991cc65cbdb429b0764632ac4e1a87444f7e0d67319a7277c7f9bac22665c3b2808d47e3b0ed05f519aec16bf6081d84878f5ea8
@@ -5,22 +5,24 @@ module Proxy
5
5
  class Plugin < ::Proxy::Plugin
6
6
  plugin 'container_gateway', Proxy::ContainerGateway::VERSION
7
7
 
8
- begin
9
- SETTINGS = Proxy::Settings.initialize_global_settings
8
+ default_settings :pulp_endpoint => "https://#{`hostname`.strip}",
9
+ :katello_registry_path => '/v2/',
10
+ :sqlite_db_path => '/var/lib/foreman-proxy/smart_proxy_container_gateway.db'
10
11
 
11
- default_settings :pulp_endpoint => "https://#{`hostname`.strip}",
12
- :pulp_client_ssl_ca => SETTINGS.foreman_ssl_ca,
13
- :pulp_client_ssl_cert => SETTINGS.foreman_ssl_cert,
14
- :pulp_client_ssl_key => SETTINGS.foreman_ssl_key,
15
- :katello_registry_path => '/v2/',
16
- :sqlite_db_path => '/var/lib/foreman-proxy/smart_proxy_container_gateway.db'
17
- rescue Errno::ENOENT
18
- logger.warn("Default settings could not be loaded. Default certs will not be set.")
19
- default_settings :pulp_endpoint => "https://#{`hostname`.strip}",
20
- :katello_registry_path => '/v2/',
21
- :sqlite_db_path => '/var/lib/foreman-proxy/smart_proxy_container_gateway.db'
12
+ # Load defaults that copy values from SETTINGS. This is done as
13
+ # programmable settings since SETTINGS isn't initialized during plugin
14
+ # loading.
15
+ load_programmable_settings do |settings|
16
+ settings[:pulp_client_ssl_ca] ||= SETTINGS.foreman_ssl_ca
17
+ settings[:pulp_client_ssl_cert] ||= SETTINGS.foreman_ssl_cert
18
+ settings[:pulp_client_ssl_key] ||= SETTINGS.foreman_ssl_key
22
19
  end
23
20
 
21
+ # TODO: sqlite_db_path should able be readable or creatable. There's no
22
+ # test for creatable
23
+ validate_readable :pulp_client_ssl_ca, :pulp_client_ssl_cert, :pulp_client_ssl_key
24
+ validate :pulp_endpoint, url: true
25
+
24
26
  rackup_path File.join(__dir__, 'container_gateway_http_config.ru')
25
27
  end
26
28
  end
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  module ContainerGateway
3
- VERSION = '1.0.2'.freeze
3
+ VERSION = '1.0.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_container_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ballou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-02 00:00:00.000000000 Z
11
+ date: 2021-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel