kuby-core 0.11.10 → 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: '0828619de266c13d61f0eafc6ce902d1500e07af158337439eba6f45415594c3'
4
- data.tar.gz: e296dc5858fe83e8eb9626d674a8c79a0e033559b168ee414d6afbf2f37f5b9e
3
+ metadata.gz: 78bc9ff66849f7b55046753a84be77fd64af68d28c1746245a463f5f240d0e9e
4
+ data.tar.gz: '079e0ccccc1ae12a18a2cb459e7a6b1f2b3ef05149d5bf347fed5ba1e6abbb2b'
5
5
  SHA512:
6
- metadata.gz: d215cfb16bdd4e784500c1c22364bdd086cf059c38a9696626ffc774158e803b9f72337de4eda09719b26d505c83e1bba533e8e49acc1dddd1304b27f3558d2b
7
- data.tar.gz: 6002bd6ee7a7cdd4d2568658fb8bdf8a9d8f42a19fa51ec846ceef5f35b458e9550d80e38aad168e2ce35e15bc91256570df160f1fec6d9cf763de362528ac04
6
+ metadata.gz: f27a9bd4698e6cdcb4c0308c91a78e5c86ac6eccd6dcd8f9ff1b28a73e8c1aa50f79512dc9ad3b5fdb43c024ba5054c1df1844bd74473c5bd9dd3c3cf034c7c4
7
+ data.tar.gz: fca6952c0bfe4cb5d2e6e9b0f4f50d46483bb43ad32d601dbdfcc14eeccb4070706043e786d18ade2730b9521443f55fb317620334f212fb88cfb92ab8672cb1
@@ -1,3 +1,8 @@
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
+
1
6
  ## 0.11.10
2
7
  * Fix spelling in error message.
3
8
 
@@ -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[\/]+/, '')}")
@@ -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
@@ -1,5 +1,5 @@
1
1
  # typed: true
2
2
 
3
3
  module Kuby
4
- VERSION = '0.11.10'.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
 
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.10
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-11-01 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