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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c91b426279a0fdc0bc7403da99aad467346c6d9eed8ed662ba4224f51e35988
|
4
|
+
data.tar.gz: c9f9915e91f61eea3a78f8e201572f37ee24d74dc477e9678066f0b8225f9911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a3c97156c6dbd3aa2e368639825434be822d90a9bab663dfc8b19fee68fe45e2565ebc762c16381d5c3faeb1a4df91153d1e13302ffe9a18a9bcb1673b22067
|
7
|
+
data.tar.gz: dd31a78a1b92dcae20582921b33b0befc3560c43203b339f68617d736dc98cc358c4b4c8474d6f73f632eb1699857eba674ab578ede827bd6580ff8ca2478b5f
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -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
|
35
|
-
storageClassName
|
37
|
+
accessModes:,
|
38
|
+
storageClassName:,
|
36
39
|
resources: {
|
37
40
|
requests: {
|
38
41
|
storage:
|
data/lib/metatron/version.rb
CHANGED