metatron 0.2.1 → 0.2.2

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: 668fa30d73c500f1a677d0424c480218b6438f75ff3fe1f369dbe81963d53dc3
4
- data.tar.gz: 2d71d21bf0555ba052f34465d9b27c2dfe4f33c06e9383a74b225888c5b40b5f
3
+ metadata.gz: 1c91b426279a0fdc0bc7403da99aad467346c6d9eed8ed662ba4224f51e35988
4
+ data.tar.gz: c9f9915e91f61eea3a78f8e201572f37ee24d74dc477e9678066f0b8225f9911
5
5
  SHA512:
6
- metadata.gz: d4859616cbe9ab91e9bd3d7595c44034ff80db1ebef4b7c08371b87d9cc32b4dc03b1a0afc0cca02b5dfe489f1c8015ebc4f42fa04d6cd6688f5795591fb8c20
7
- data.tar.gz: ec29f2ea71f5692427e857b72b7636087f257e9ecb963eea7895d10c37cd6032c61b9ba2868c9f055076cd4e10ad0f0c8ce9a2431431c20ccc34a42c33755ce8
6
+ metadata.gz: 2a3c97156c6dbd3aa2e368639825434be822d90a9bab663dfc8b19fee68fe45e2565ebc762c16381d5c3faeb1a4df91153d1e13302ffe9a18a9bcb1673b22067
7
+ data.tar.gz: dd31a78a1b92dcae20582921b33b0befc3560c43203b339f68617d736dc98cc358c4b4c8474d6f73f632eb1699857eba674ab578ede827bd6580ff8ca2478b5f
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ metatron-*.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.2.1)
4
+ metatron (0.2.2)
5
5
  json (~> 2.6)
6
6
  puma (~> 6.3)
7
7
  sinatra (~> 2.2)
@@ -11,7 +11,7 @@ module Metatron
11
11
  attr_accessor :additional_labels, :additional_pod_labels,
12
12
  :security_context, :volumes, :containers, :init_containers,
13
13
  :affinity, :termination_grace_period_seconds,
14
- :tolerations, :pod_annotations
14
+ :tolerations, :pod_annotations, :persistent_volume_claims
15
15
 
16
16
  initializer :pod_producer_initialize
17
17
 
@@ -31,6 +31,7 @@ module Metatron
31
31
  @pod_annotations = {}
32
32
  @termination_grace_period_seconds = nil
33
33
  @tolerations = []
34
+ @persistent_volume_claims = []
34
35
  end
35
36
 
36
37
  def formatted_affinity = affinity && !affinity.empty? ? { affinity: } : {}
@@ -45,6 +46,18 @@ module Metatron
45
46
 
46
47
  def formatted_tolerations = tolerations&.any? ? { tolerations: } : {}
47
48
  def formatted_volumes = volumes&.any? ? { volumes: } : {}
49
+
50
+ def volume_claim_templates
51
+ if persistent_volume_claims&.any?
52
+ {
53
+ volumeClaimTemplates: persistent_volume_claims.map do |c|
54
+ c.respond_to?(:render) ? c.render : c
55
+ end
56
+ }
57
+ else
58
+ {}
59
+ end
60
+ end
48
61
  end
49
62
  end
50
63
  end
@@ -9,6 +9,9 @@ module Metatron
9
9
 
10
10
  attr_accessor :additional_labels, :storage_class, :access_modes, :storage
11
11
 
12
+ alias storageClassName storage_class
13
+ alias accessModes access_modes
14
+
12
15
  def initialize(
13
16
  name,
14
17
  storage_class:,
@@ -31,8 +34,8 @@ module Metatron
31
34
  labels: { "#{label_namespace}/name": name }.merge(additional_labels)
32
35
  }.merge(formatted_annotations).merge(formatted_namespace),
33
36
  spec: {
34
- accessModes: access_modes,
35
- storageClassName: storage_class,
37
+ accessModes:,
38
+ storageClassName:,
36
39
  resources: {
37
40
  requests: {
38
41
  storage:
@@ -55,7 +55,7 @@ module Metatron
55
55
  .compact
56
56
  }
57
57
  }
58
- }
58
+ }.merge(volume_claim_templates)
59
59
  end
60
60
  # rubocop:enable Metrics/AbcSize
61
61
  # rubocop:enable Metrics/MethodLength
@@ -4,6 +4,6 @@ module Metatron
4
4
  VERSION = [
5
5
  0, # major
6
6
  2, # minor
7
- 1 # patch
7
+ 2 # patch
8
8
  ].join(".")
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy