metatron 0.1.4 → 0.1.5

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: 37a819a08c08352f187437129f83f9998a84ddf8519ca2b9b59f2e809c95f757
4
- data.tar.gz: ff428cba5a1c1d80d4dff0b54a6e6da81b787c66dd83332fc6ead84c62a14ffd
3
+ metadata.gz: 992800d829a067dfad529abd2b4ff606df206b32f214e5851a5d30325d087c5a
4
+ data.tar.gz: 209c07d8463fdca044763ad0a4cf07b7284ebefd0a4cdf2372d5e80af3b62faf
5
5
  SHA512:
6
- metadata.gz: b53f3d0572ded8a3f88c83501616fb67782e71bf8a54e504733461d468674b8f09ca2af67eba0c840708a47c3a6d803d004454a11941d8fb8f62a85592a74ee7
7
- data.tar.gz: 6b371bff00705c714220a36062bca85038aa14344648de4ee7b9d030b2bd115552b24f6ae48625790c73d5c7886424afb8f3f2c01daf8673da49e20bb8891a32
6
+ metadata.gz: 5c66266c6808288c3709631e4cac70d0c60122a5589255c9110a0b4ec09460df22fea9ec43fcc3da5339bb935e2d4a5435f3768f95fda63ce47da78ddfebce99
7
+ data.tar.gz: 0cf374089c8cc38975cbb96c484c54c37cd769dcc402ceaf4857ba11cd709e4869db951a620d795befc39d900435fbd11fa68bfc5079d3237cf55b6ca012a997
data/.roxanne.yml CHANGED
@@ -1,14 +1,14 @@
1
1
  version: 1.0
2
2
  stages:
3
3
  build:
4
- image: ruby:3.1
4
+ image: ruby:3.2
5
5
  scripts:
6
6
  - ./scripts/build.sh
7
7
  test:
8
- image: ruby:3.1
8
+ image: ruby:3.2
9
9
  scripts:
10
10
  - ./scripts/test.sh
11
11
  release:
12
- image: ruby:3.1
12
+ image: ruby:3.2
13
13
  only:
14
14
  - main
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.1.4)
4
+ metatron (0.1.5)
5
5
  json (~> 2.6)
6
6
  puma (~> 5.6)
7
7
  sinatra (~> 2.2)
@@ -32,15 +32,15 @@ GEM
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.0)
35
+ parser (3.2.1.1)
36
36
  ast (~> 2.4.1)
37
37
  puma (5.6.5)
38
38
  nio4r (~> 2.0)
39
39
  racc (1.6.2)
40
- rack (2.2.6.3)
40
+ rack (2.2.6.4)
41
41
  rack-protection (2.2.4)
42
42
  rack
43
- rack-test (2.0.2)
43
+ rack-test (2.1.0)
44
44
  rack (>= 1.3)
45
45
  rainbow (3.1.1)
46
46
  rake (12.3.3)
@@ -57,11 +57,11 @@ 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.3)
60
+ rspec-mocks (3.12.4)
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.47.0)
64
+ rubocop (1.48.1)
65
65
  json (~> 2.3)
66
66
  parallel (~> 1.10)
67
67
  parser (>= 3.2.0.0)
@@ -77,7 +77,7 @@ GEM
77
77
  rubocop (~> 1.41)
78
78
  rubocop-rake (0.6.0)
79
79
  rubocop (~> 1.0)
80
- rubocop-rspec (2.18.1)
80
+ rubocop-rspec (2.19.0)
81
81
  rubocop (~> 1.33)
82
82
  rubocop-capybara (~> 2.17)
83
83
  ruby-progressbar (1.13.0)
@@ -10,6 +10,7 @@ module Metatron
10
10
  @name = name
11
11
  @label_namespace = "metatron.therubyist.org"
12
12
  @api_version = "v1"
13
+ @kind = self.class.name.split("::").last
13
14
  run_initializers
14
15
  end
15
16
 
@@ -13,7 +13,6 @@ module Metatron
13
13
  def initialize(name)
14
14
  super(name)
15
15
  @api_version = "apps/v1"
16
- @kind = "DaemonSet"
17
16
  @pod_annotations = {}
18
17
  @additional_pod_labels = {}
19
18
  end
@@ -13,7 +13,6 @@ module Metatron
13
13
  def initialize(name, replicas: 2)
14
14
  super(name)
15
15
  @api_version = "apps/v1"
16
- @kind = "Deployment"
17
16
  @replicas = replicas
18
17
  @pod_annotations = {}
19
18
  @additional_pod_labels = {}
@@ -9,10 +9,8 @@ module Metatron
9
9
 
10
10
  def initialize(name, ingress_class = "nginx")
11
11
  super(name)
12
- @name = name
13
12
  @ingress_class = ingress_class
14
13
  @api_version = "networking.k8s.io/v1"
15
- @kind = "Ingress"
16
14
  @additional_labels = {}
17
15
  @additional_annotations = {}
18
16
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ module Templates
5
+ # The PersistentVolumeClaim Kubernetes resource
6
+ class PersistentVolumeClaim < Template
7
+ include Concerns::Annotated
8
+
9
+ attr_accessor :additional_labels, :storage_class, :access_modes, :storage
10
+
11
+ def initialize(
12
+ name,
13
+ storage_class:,
14
+ storage:,
15
+ access_modes: ["ReadWriteOnce"]
16
+ )
17
+ super(name)
18
+ @storage_class = storage_class
19
+ @access_modes = access_modes
20
+ @storage = storage
21
+ @additional_labels = {}
22
+ end
23
+
24
+ def render
25
+ {
26
+ apiVersion:,
27
+ kind:,
28
+ metadata: {
29
+ name:,
30
+ labels: { "#{label_namespace}/name": name }.merge(additional_labels)
31
+ }.merge(formatted_annotations),
32
+ spec: {
33
+ accessModes: access_modes,
34
+ storageClassName: storage_class,
35
+ resources: {
36
+ requests: {
37
+ storage:
38
+ }
39
+ }
40
+ }
41
+ }
42
+ end
43
+ end
44
+ end
45
+ end
@@ -7,11 +7,6 @@ module Metatron
7
7
  include Concerns::Annotated
8
8
  include Concerns::PodProducer
9
9
 
10
- def initialize(name)
11
- super(name)
12
- @kind = "Pod"
13
- end
14
-
15
10
  # rubocop:disable Metrics/MethodLength
16
11
  # rubocop:disable Metrics/AbcSize
17
12
  def render
@@ -13,7 +13,6 @@ module Metatron
13
13
  def initialize(name, replicas: 2)
14
14
  super(name)
15
15
  @api_version = "apps/v1"
16
- @kind = "ReplicaSet"
17
16
  @replicas = replicas
18
17
  @pod_annotations = {}
19
18
  @additional_pod_labels = {}
@@ -12,7 +12,6 @@ module Metatron
12
12
  super(name)
13
13
  @data = data
14
14
  @additional_labels = {}
15
- @kind = "Secret"
16
15
  @type = "Opaque"
17
16
  end
18
17
 
@@ -11,7 +11,6 @@ module Metatron
11
11
 
12
12
  def initialize(name, port = nil)
13
13
  super(name)
14
- @kind = "Service"
15
14
  @type = "ClusterIP"
16
15
  @selector = { "#{label_namespace}/name": name }
17
16
  @additional_labels = {}
@@ -15,7 +15,6 @@ module Metatron
15
15
  super(name)
16
16
  @replicas = replicas
17
17
  @api_version = "apps/v1"
18
- @kind = "StatefulSet"
19
18
  @pod_annotations = {}
20
19
  @pod_management_policy = "OrderedReady"
21
20
  @additional_pod_labels = {}
@@ -4,6 +4,6 @@ module Metatron
4
4
  VERSION = [
5
5
  0, # major
6
6
  1, # minor
7
- 4 # patch
7
+ 5 # patch
8
8
  ].join(".")
9
9
  end
data/lib/metatron.rb CHANGED
@@ -28,6 +28,7 @@ require "metatron/template"
28
28
  require "metatron/templates/concerns/annotated"
29
29
  require "metatron/templates/concerns/pod_producer"
30
30
  require "metatron/templates/pod"
31
+ require "metatron/templates/persistent_volume_claim"
31
32
  require "metatron/templates/deployment"
32
33
  require "metatron/templates/ingress"
33
34
  require "metatron/templates/replica_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.4
4
+ version: 0.1.5
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-04 00:00:00.000000000 Z
11
+ date: 2023-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -261,6 +261,7 @@ files:
261
261
  - lib/metatron/templates/daemon_set.rb
262
262
  - lib/metatron/templates/deployment.rb
263
263
  - lib/metatron/templates/ingress.rb
264
+ - lib/metatron/templates/persistent_volume_claim.rb
264
265
  - lib/metatron/templates/pod.rb
265
266
  - lib/metatron/templates/replica_set.rb
266
267
  - lib/metatron/templates/secret.rb
@@ -292,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
293
  - !ruby/object:Gem::Version
293
294
  version: '0'
294
295
  requirements: []
295
- rubygems_version: 3.3.7
296
+ rubygems_version: 3.4.6
296
297
  signing_key:
297
298
  specification_version: 4
298
299
  summary: So meta