metatron 0.1.5 → 0.1.7

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: 992800d829a067dfad529abd2b4ff606df206b32f214e5851a5d30325d087c5a
4
- data.tar.gz: 209c07d8463fdca044763ad0a4cf07b7284ebefd0a4cdf2372d5e80af3b62faf
3
+ metadata.gz: 0fda98cad9b41601c8d028c589e9283480d3320914b8c04055f25863b09cf6ac
4
+ data.tar.gz: f894ee38131cf57ba700ecf88ab047297f455d8df75aabb14540c53e425876ce
5
5
  SHA512:
6
- metadata.gz: 5c66266c6808288c3709631e4cac70d0c60122a5589255c9110a0b4ec09460df22fea9ec43fcc3da5339bb935e2d4a5435f3768f95fda63ce47da78ddfebce99
7
- data.tar.gz: 0cf374089c8cc38975cbb96c484c54c37cd769dcc402ceaf4857ba11cd709e4869db951a620d795befc39d900435fbd11fa68bfc5079d3237cf55b6ca012a997
6
+ metadata.gz: 796b1c32cba1876e03e70fbf1c580825a9fcb24a28fac0fc0bbdb559ac7810823de4bd1c0852dd5ee4f3c16af72147e643d51d7a9568f2022c8cd102054f2205
7
+ data.tar.gz: 2d5c10480b359d1c8ae19dcb7c5fc8a4109b0a37999ff0ed031bac42b148fd75c1f482379dd9bfaffa4c3051dc29c26c623c5a13385e1be30a983ddddf30da04
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.1
1
+ 3.2.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.1.5)
4
+ metatron (0.1.7)
5
5
  json (~> 2.6)
6
6
  puma (~> 5.6)
7
7
  sinatra (~> 2.2)
@@ -26,13 +26,13 @@ GEM
26
26
  multi_json (1.15.0)
27
27
  mustermann (2.0.2)
28
28
  ruby2_keywords (~> 0.0.1)
29
- nio4r (2.5.8)
29
+ nio4r (2.5.9)
30
30
  nokogiri (1.14.2-arm64-darwin)
31
31
  racc (~> 1.4)
32
32
  nokogiri (1.14.2-x86_64-linux)
33
33
  racc (~> 1.4)
34
34
  parallel (1.22.1)
35
- parser (3.2.1.1)
35
+ parser (3.2.2.0)
36
36
  ast (~> 2.4.1)
37
37
  puma (5.6.5)
38
38
  nio4r (~> 2.0)
@@ -57,21 +57,21 @@ GEM
57
57
  rspec-expectations (3.12.2)
58
58
  diff-lcs (>= 1.2.0, < 2.0)
59
59
  rspec-support (~> 3.12.0)
60
- rspec-mocks (3.12.4)
60
+ rspec-mocks (3.12.5)
61
61
  diff-lcs (>= 1.2.0, < 2.0)
62
62
  rspec-support (~> 3.12.0)
63
63
  rspec-support (3.12.0)
64
- rubocop (1.48.1)
64
+ rubocop (1.49.0)
65
65
  json (~> 2.3)
66
66
  parallel (~> 1.10)
67
67
  parser (>= 3.2.0.0)
68
68
  rainbow (>= 2.2.2, < 4.0)
69
69
  regexp_parser (>= 1.8, < 3.0)
70
70
  rexml (>= 3.2.5, < 4.0)
71
- rubocop-ast (>= 1.26.0, < 2.0)
71
+ rubocop-ast (>= 1.28.0, < 2.0)
72
72
  ruby-progressbar (~> 1.7)
73
73
  unicode-display_width (>= 2.4.0, < 3.0)
74
- rubocop-ast (1.27.0)
74
+ rubocop-ast (1.28.0)
75
75
  parser (>= 3.2.1.0)
76
76
  rubocop-capybara (2.17.1)
77
77
  rubocop (~> 1.41)
@@ -8,11 +8,11 @@ module Metatron
8
8
  def self.included(base)
9
9
  # base.extend ClassMethods
10
10
  base.class_eval do
11
- attr_accessor :image, :image_pull_policy, :additional_labels, :env, :envfrom,
11
+ attr_accessor :image, :image_pull_policy, :additional_labels, :additional_pod_labels,
12
12
  :resource_limits, :resource_requests, :probes, :ports, :security_context,
13
- :volume_mounts, :volumes, :additional_containers,
13
+ :volume_mounts, :volumes, :additional_containers, :env, :envfrom,
14
14
  :container_security_context, :affinity, :termination_grace_period_seconds,
15
- :tolerations
15
+ :tolerations, :pod_annotations
16
16
 
17
17
  initializer :pod_producer_initialize
18
18
 
@@ -40,6 +40,8 @@ module Metatron
40
40
  @container_security_context = {}
41
41
  @additional_containers = []
42
42
  @additional_labels = {}
43
+ @additional_pod_labels = {}
44
+ @pod_annotations = {}
43
45
  @termination_grace_period_seconds = 60
44
46
  @tolerations = []
45
47
  end
@@ -58,6 +60,10 @@ module Metatron
58
60
  end
59
61
  end
60
62
 
63
+ def formatted_pod_annotations
64
+ pod_annotations && !pod_annotations.empty? ? { annotations: pod_annotations } : {}
65
+ end
66
+
61
67
  def formatted_ports = ports&.any? ? { ports: } : {}
62
68
 
63
69
  def formatted_security_context
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ module Templates
5
+ # The ConfigMap Kubernetes resource
6
+ class ConfigMap < Template
7
+ include Concerns::Annotated
8
+
9
+ attr_accessor :additional_labels, :type, :data
10
+
11
+ def initialize(name, data = {})
12
+ super(name)
13
+ @data = data
14
+ @additional_labels = {}
15
+ end
16
+
17
+ def render
18
+ {
19
+ apiVersion:,
20
+ kind:,
21
+ metadata: {
22
+ name:,
23
+ labels: { "#{label_namespace}/name": name }.merge(additional_labels)
24
+ }.merge(formatted_annotations),
25
+ data:
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -7,18 +7,11 @@ module Metatron
7
7
  include Concerns::Annotated
8
8
  include Concerns::PodProducer
9
9
 
10
- attr_accessor :replicas, :pod_annotations,
11
- :additional_labels, :additional_pod_labels
10
+ attr_accessor :replicas, :additional_labels
12
11
 
13
12
  def initialize(name)
14
13
  super(name)
15
14
  @api_version = "apps/v1"
16
- @pod_annotations = {}
17
- @additional_pod_labels = {}
18
- end
19
-
20
- def formatted_pod_annotations
21
- pod_annotations && !pod_annotations.empty? ? { annotations: pod_annotations } : {}
22
15
  end
23
16
 
24
17
  # rubocop:disable Metrics/MethodLength
@@ -7,19 +7,12 @@ module Metatron
7
7
  include Concerns::Annotated
8
8
  include Concerns::PodProducer
9
9
 
10
- attr_accessor :replicas, :pod_annotations,
11
- :additional_labels, :additional_pod_labels
10
+ attr_accessor :replicas, :additional_labels
12
11
 
13
12
  def initialize(name, replicas: 2)
14
13
  super(name)
15
14
  @api_version = "apps/v1"
16
15
  @replicas = replicas
17
- @pod_annotations = {}
18
- @additional_pod_labels = {}
19
- end
20
-
21
- def formatted_pod_annotations
22
- pod_annotations && !pod_annotations.empty? ? { annotations: pod_annotations } : {}
23
16
  end
24
17
 
25
18
  # rubocop:disable Metrics/MethodLength
@@ -7,19 +7,12 @@ module Metatron
7
7
  include Concerns::Annotated
8
8
  include Concerns::PodProducer
9
9
 
10
- attr_accessor :replicas, :pod_annotations,
11
- :additional_labels, :additional_pod_labels
10
+ attr_accessor :replicas, :additional_labels
12
11
 
13
12
  def initialize(name, replicas: 2)
14
13
  super(name)
15
14
  @api_version = "apps/v1"
16
15
  @replicas = replicas
17
- @pod_annotations = {}
18
- @additional_pod_labels = {}
19
- end
20
-
21
- def formatted_pod_annotations
22
- pod_annotations && !pod_annotations.empty? ? { annotations: pod_annotations } : {}
23
16
  end
24
17
 
25
18
  # rubocop:disable Metrics/MethodLength
@@ -7,17 +7,13 @@ module Metatron
7
7
  include Concerns::Annotated
8
8
  include Concerns::PodProducer
9
9
 
10
- attr_accessor :replicas, :pod_annotations, :service_name,
11
- :pod_management_policy, :enable_service_links,
12
- :additional_pod_labels
10
+ attr_accessor :replicas, :service_name, :pod_management_policy, :enable_service_links
13
11
 
14
12
  def initialize(name, replicas: 1)
15
13
  super(name)
16
14
  @replicas = replicas
17
15
  @api_version = "apps/v1"
18
- @pod_annotations = {}
19
16
  @pod_management_policy = "OrderedReady"
20
- @additional_pod_labels = {}
21
17
  @enable_service_links = true
22
18
  @service_name = name
23
19
  end
@@ -26,10 +22,6 @@ module Metatron
26
22
  alias podManagementPolicy pod_management_policy
27
23
  alias serviceName service_name
28
24
 
29
- def formatted_pod_annotations
30
- pod_annotations && !pod_annotations.empty? ? { annotations: pod_annotations } : {}
31
- end
32
-
33
25
  # rubocop:disable Metrics/MethodLength
34
26
  # rubocop:disable Metrics/AbcSize
35
27
  def render
@@ -4,6 +4,6 @@ module Metatron
4
4
  VERSION = [
5
5
  0, # major
6
6
  1, # minor
7
- 5 # patch
7
+ 7 # patch
8
8
  ].join(".")
9
9
  end
data/lib/metatron.rb CHANGED
@@ -11,7 +11,7 @@ require "logger"
11
11
  require "sinatra/base"
12
12
  require "sinatra/custom_logger"
13
13
 
14
- # The top-level module for Bullion
14
+ # The top-level module for Metatron
15
15
  module Metatron
16
16
  class Error < StandardError; end
17
17
  class ConfigError < Error; end
@@ -32,6 +32,7 @@ require "metatron/templates/persistent_volume_claim"
32
32
  require "metatron/templates/deployment"
33
33
  require "metatron/templates/ingress"
34
34
  require "metatron/templates/replica_set"
35
+ require "metatron/templates/config_map"
35
36
  require "metatron/templates/secret"
36
37
  require "metatron/templates/service"
37
38
  require "metatron/templates/stateful_set"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-23 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -258,6 +258,7 @@ files:
258
258
  - lib/metatron/template.rb
259
259
  - lib/metatron/templates/concerns/annotated.rb
260
260
  - lib/metatron/templates/concerns/pod_producer.rb
261
+ - lib/metatron/templates/config_map.rb
261
262
  - lib/metatron/templates/daemon_set.rb
262
263
  - lib/metatron/templates/deployment.rb
263
264
  - lib/metatron/templates/ingress.rb
@@ -293,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
294
  - !ruby/object:Gem::Version
294
295
  version: '0'
295
296
  requirements: []
296
- rubygems_version: 3.4.6
297
+ rubygems_version: 3.4.10
297
298
  signing_key:
298
299
  specification_version: 4
299
300
  summary: So meta