kuby-core 0.11.6 → 0.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 231bc8c37af35418336ba5bb5853049e0d9192932a65eeb3e81a0471b5761953
4
- data.tar.gz: 9a4e4426e1d183505f09fac2761601c101c92423761647484c1dae3c3a75e235
3
+ metadata.gz: 78bc9ff66849f7b55046753a84be77fd64af68d28c1746245a463f5f240d0e9e
4
+ data.tar.gz: '079e0ccccc1ae12a18a2cb459e7a6b1f2b3ef05149d5bf347fed5ba1e6abbb2b'
5
5
  SHA512:
6
- metadata.gz: 64bd169c3454d196efcf0a21f400107ca8b8c584a20793a8ccf232767aba7ae52fab27307f01e104186b73f537d12907afc86c901538f86266773dacb740cbaa
7
- data.tar.gz: a54f9fa2eb0cdbfe52a0d4799c1f4fa9bd4677bef8ef4ed4f11caa4690d28f077918a0feb76926b94923ee6ba00e5065d8edabb1997d829d4f7ff5f9b9832708
6
+ metadata.gz: f27a9bd4698e6cdcb4c0308c91a78e5c86ac6eccd6dcd8f9ff1b28a73e8c1aa50f79512dc9ad3b5fdb43c024ba5054c1df1844bd74473c5bd9dd3c3cf034c7c4
7
+ data.tar.gz: fca6952c0bfe4cb5d2e6e9b0f4f50d46483bb43ad32d601dbdfcc14eeccb4070706043e786d18ade2730b9521443f55fb317620334f212fb88cfb92ab8672cb1
@@ -1,3 +1,21 @@
1
+ ## 0.11.11
2
+ * Add support for a Docker registry running on localhost.
3
+ - Correctly parse and handle URLs with specific ports.
4
+ - Only perform a Docker login if a username is provided.
5
+
6
+ ## 0.11.10
7
+ * Fix spelling in error message.
8
+
9
+ ## 0.11.9
10
+ * Use correct Docker Hub registry URL (index.docker.io).
11
+
12
+ ## 0.11.8
13
+ * Alias Rails `config_map` to `env`.
14
+
15
+ ## 0.11.7
16
+ * Properly namespace constant lookup for `Kubernetes::MissingPluginError`.
17
+ * Add missing `#storage` method for Postgres plugin.
18
+
1
19
  ## 0.11.6
2
20
  * Fix Rails generator.
3
21
  - Causing `undefined method 'module_parent_name'`. Apparently `module_parent_name` wasn't introduced until Rails 6.
@@ -8,7 +8,7 @@ module Kuby
8
8
  extend T::Sig
9
9
 
10
10
  DEFAULT_DISTRO = :debian
11
- DEFAULT_REGISTRY_HOST = T.let('https://www.docker.com'.freeze, String)
11
+ DEFAULT_REGISTRY_HOST = T.let('https://index.docker.io'.freeze, String)
12
12
  DEFAULT_REGISTRY_SCHEME = T.let('https', String)
13
13
  LATEST_TAG = T.let('latest'.freeze, String)
14
14
 
@@ -40,7 +40,8 @@ module Kuby
40
40
 
41
41
  sig { returns(String) }
42
42
  def image_host
43
- @image_host ||= "#{full_image_uri.scheme}://#{full_image_uri.host}"
43
+ uri = full_image_uri
44
+ @image_host ||= "#{uri.scheme}://#{uri.host}:#{uri.port}"
44
45
  end
45
46
 
46
47
  sig { returns(String) }
@@ -74,7 +75,7 @@ module Kuby
74
75
  def full_image_uri
75
76
  @full_image_uri ||= if image_url.include?('://')
76
77
  URI.parse(image_url)
77
- elsif image_url =~ /\A[^.]+\.[^\/]+\//
78
+ elsif image_url =~ /\A[^.:]+[\.:][^\/]+\//
78
79
  URI.parse("#{DEFAULT_REGISTRY_SCHEME}://#{image_url}")
79
80
  else
80
81
  URI.parse("#{DEFAULT_REGISTRY_HOST}/#{image_url.sub(/\A[\/]+/, '')}")
@@ -1,4 +1,5 @@
1
1
  # typed: true
2
+
2
3
  require 'fileutils'
3
4
  require 'securerandom'
4
5
  require 'yaml'
@@ -6,6 +7,8 @@ require 'yaml'
6
7
  module Kuby
7
8
  module Kubernetes
8
9
  class Deployer
10
+ extend T::Sig
11
+
9
12
  attr_reader :environment
10
13
  attr_accessor :logdev
11
14
 
@@ -93,7 +96,7 @@ module Kuby
93
96
  task.run!(verify_result: true, prune: false)
94
97
  ensure
95
98
  ENV['KUBECONFIG'] = old_kubeconfig
96
- FileUtils.rm_rf(tmpdir)
99
+ FileUtils.rm_rf(T.must(tmpdir))
97
100
  end
98
101
 
99
102
  def restart_rails_deployment_if_necessary
@@ -12,7 +12,7 @@ module Kuby
12
12
  plugins_by_env = plugins[plugin_name]
13
13
 
14
14
  unless plugins_by_env
15
- raise MissingPluginError, "no plugin registered with name #{plugin_name}, "\
15
+ raise Kubernetes::MissingPluginError, "no plugin registered with name #{plugin_name}, "\
16
16
  'do you need to add a gem to your Gemfile?'
17
17
  end
18
18
 
@@ -202,6 +202,8 @@ module Kuby
202
202
  @config_map
203
203
  end
204
204
 
205
+ alias_method :env, :config_map
206
+
205
207
  def app_secrets(&block)
206
208
  spec = self
207
209
 
@@ -63,6 +63,20 @@ module Kuby
63
63
  end
64
64
  end
65
65
  end
66
+
67
+ def storage(amount)
68
+ database do
69
+ spec do
70
+ storage do
71
+ resources do
72
+ requests do
73
+ set :storage, amount
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
66
80
 
67
81
  def secret(&block)
68
82
  context = self
@@ -43,7 +43,7 @@ module Kuby
43
43
 
44
44
  hostname = docker.metadata.image_hostname
45
45
 
46
- unless docker.cli.auths.include?(hostname)
46
+ if docker.credentials.username && !docker.cli.auths.include?(hostname)
47
47
  Kuby.logger.info("Attempting to log in to registry at #{hostname}")
48
48
 
49
49
  begin
@@ -66,7 +66,7 @@ module Kuby
66
66
  docker.cli.push(image_url, tag)
67
67
  end
68
68
  rescue Kuby::Docker::MissingTagError => e
69
- msg = "#{e.message} Run rake kuby:build to build the"\
69
+ msg = "#{e.message} Run kuby build to build the "\
70
70
  'Docker image before running this task.'
71
71
 
72
72
  Kuby.logger.fatal(msg)
@@ -1,5 +1,5 @@
1
1
  # typed: true
2
2
 
3
3
  module Kuby
4
- VERSION = '0.11.6'.freeze
4
+ VERSION = '0.11.11'.freeze
5
5
  end
@@ -19,18 +19,18 @@ describe Kuby::Docker::Metadata do
19
19
  describe '#image_host' do
20
20
  subject { metadata.image_host }
21
21
 
22
- it { is_expected.to eq(described_class::DEFAULT_REGISTRY_HOST) }
22
+ it { is_expected.to eq("#{described_class::DEFAULT_REGISTRY_HOST}:443") }
23
23
 
24
24
  context 'when the image URL contains an explicit host' do
25
25
  let(:docker_image_url) { 'registry.foo.com/foo/testapp' }
26
26
 
27
- it { is_expected.to eq('https://registry.foo.com') }
27
+ it { is_expected.to eq('https://registry.foo.com:443') }
28
28
  end
29
29
 
30
30
  context 'when the image URL contains an explicit host with scheme' do
31
31
  let(:docker_image_url) { 'http://registry.foo.com/foo/testapp' }
32
32
 
33
- it { is_expected.to eq('http://registry.foo.com') }
33
+ it { is_expected.to eq('http://registry.foo.com:80') }
34
34
  end
35
35
  end
36
36
 
@@ -49,7 +49,7 @@ describe Kuby::Docker::Metadata do
49
49
  describe '#image_hostname' do
50
50
  subject { metadata.image_hostname }
51
51
 
52
- it { is_expected.to eq('www.docker.com') }
52
+ it { is_expected.to eq('index.docker.io') }
53
53
 
54
54
  context 'when the image URL contains an explicit host' do
55
55
  let(:docker_image_url) { 'registry.foo.com/foo/testapp' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.6
4
+ version: 0.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-14 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize