coredns 1.0.1 → 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: 52025bbcaee2fdfe7f2c95c92244aaddb95c210b6efd538d8b0d30c344d8e8f3
4
- data.tar.gz: f5f720ceef14e15bd418841735a2242a335997da8db61b3988e96f875e74da00
3
+ metadata.gz: 8a4c7ff802b7253b55229b164cc204da10755e64e20892cc30b9fd71c88dfa69
4
+ data.tar.gz: fccf62fc7990b4a4dcf0406ef8dd2af70059d048643d9b869f015c0abc20d87e
5
5
  SHA512:
6
- metadata.gz: 272a5cc3050c263eaa5aff2c2aa08ce15e07bd7e013f1a85623a45640ba9f820661631360df31ede4a011c971b048a20addee6ebb5020ba6afd5ac372b5f8a38
7
- data.tar.gz: ee0cf13788de602302cae6bc239099ccc895823b9099842e20e40aff813ceaa1e9ee57f2d830baf63e7f4a9dbaaa5b0aa0def71eacd0fffe3736ed9f2391ba4e
6
+ metadata.gz: e880296a9d647302e262f0e69ecfa5e07801211eddc94d37b7d8756699937ae91bf4a1f5c2dce784275dbaa8966a4c7dcf38868b77957ba9e3dbd3042334cd0b
7
+ data.tar.gz: c21419d3d99c0a38591f4cd5dbe82c611249598d6398ad2f959820a72cdd96af36d2d79d2775357d3e243afde3150fef039743c362f89572c070e89422037852
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coredns (1.0)
4
+ coredns (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -60,6 +60,7 @@ GEM
60
60
  unicode-display_width (2.1.0)
61
61
 
62
62
  PLATFORMS
63
+ arm64-darwin-23
63
64
  x86_64-linux
64
65
 
65
66
  DEPENDENCIES
data/README.md CHANGED
@@ -92,5 +92,5 @@ ENV["COREDNS_VERSION"], default is "v3" (also tested v3beta)
92
92
  > coredns.domain('domain1.your.zone').show
93
93
 
94
94
  # Delete domain
95
- > coredns.domain('domain1.your.zone').delete
95
+ > coredns.domain('domain1.your.zone').delete({:params})
96
96
  ```
data/lib/etcd/dns_zone.rb CHANGED
@@ -28,7 +28,7 @@ class CoreDns::Etcd::DnsZone < CoreDns::Etcd::Domain
28
28
 
29
29
  def parent_zone
30
30
  @namespace = @namespace.split(".")[1..].join(".")
31
- return nil if @namespace.empty?
31
+ return nil if @namespace.empty? || !@namespace.include?(".")
32
32
 
33
33
  zone_hash = @client.zone(@namespace).show
34
34
  return @client.zone(@namespace) if zone_hash
data/lib/etcd/domain.rb CHANGED
@@ -15,7 +15,7 @@ module CoreDns
15
15
  data = HashWithIndifferentAccessCustom.new(data).attributes
16
16
  hostname = nil
17
17
  if data[:name]
18
- hostname = "#{data.delete(:name)}.#{@namespace}./#{@client.prefix}".split(".").reverse.join("/")
18
+ hostname = "#{data.delete(:name)}.#{@namespace}./#{@client.prefix}".split(".").compact.reverse.join("/")
19
19
  elsif data[:host]
20
20
  hostname = list.select { |record| record["host"] == data[:host] }[0]["hostname"]
21
21
  end
data/lib/etcd.rb CHANGED
@@ -16,11 +16,19 @@ class CoreDns::Etcd
16
16
  end
17
17
 
18
18
  def domain(hostname)
19
+ unless hostname.empty?
20
+ raise RuntimeError.new "Invalid hostname" unless hostname.match?(/\A(?:(?!-)(?!.*--)[a-zA-Z0-9_][a-zA-Z0-9-_]{1,62}\.)+[a-zA-Z]{2,}\z/)
21
+ end
22
+
19
23
  CoreDns::Etcd::Domain.new(self, hostname)
20
24
  end
21
25
 
22
- def zone(hostname)
23
- CoreDns::Etcd::DnsZone.new(self, hostname)
26
+ def zone(domain)
27
+ unless domain.empty?
28
+ raise RuntimeError.new "Invalid domain" unless domain.match? /\A(?:(?!-)(?!.*--)[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,}\z/
29
+ end
30
+
31
+ CoreDns::Etcd::DnsZone.new(self, domain)
24
32
  end
25
33
 
26
34
  private
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoreDns
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coredns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aliaksei Hrechushkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-23 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Gem which provide simple way to control DNS records.
14
14
  email:
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
- rubygems_version: 3.2.33
63
+ rubygems_version: 3.4.21
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: Wrapper for coredns-etcd application