metatron 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e624bf8ef1365843b3a1af54bdb89b377776358f84693d7f1a2dad737494393
4
- data.tar.gz: e6c7576f3b2a6d3ca1d81aa1a6ee3295ae7d19811854173eb3e850343d34b19f
3
+ metadata.gz: 172d36a4cdb46cbfce74e2f31002c3b6706b1ff9a328d6b44dc919c444d8bed3
4
+ data.tar.gz: 8ebd13c4d65b6b2f07eab819a3ba7ed2d50dbfc63f2b83fcaafe642bdf51b7cd
5
5
  SHA512:
6
- metadata.gz: 3c1002350e83eb88f492b81930bde8636dd7de7ff7b21abb28b1f1d719ebc8f07e334495270d5440bcf92f8af5493add44a6d9e852e42eda6cde4efa52e734c4
7
- data.tar.gz: 3628be437221e7d0608afd2944510bc05f65a5d388feb01fd044d3f0c24f6d84e7788360b04286525a4bddc90697246f9611f4ab693c39544062cac21d1245c5
6
+ metadata.gz: bca6a3fbe34796dfbf322222f0f10b02cd31a33a99940a6e11789ea01066df8ea1f13701a91a2bae6918b3e5cb8f89ba3d0e768d711fb9dba7205a46b905b8b9
7
+ data.tar.gz: 62e5d5740817bf1767d2eab44309cf5ced41380dcd8ad1015ff89ce3ebc1bf9d7dc5debd3ffba15d5fa5f312edebddb6f979203954bb22eee8f93b87cbfc746c
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.11.0"
2
+ ".": "0.11.2"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.11.2](https://github.com/jgnagy/metatron/compare/metatron/v0.11.1...metatron/v0.11.2) (2025-06-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * Add additional features to cron job template ([5585c58](https://github.com/jgnagy/metatron/commit/5585c58148ce45c222a58b50a420979d4ae672cb))
9
+
10
+ ## [0.11.1](https://github.com/jgnagy/metatron/compare/metatron/v0.11.0...metatron/v0.11.1) (2025-04-11)
11
+
12
+
13
+ ### Features
14
+
15
+ * **templates:** add volume snapshot and content ([b969ce6](https://github.com/jgnagy/metatron/commit/b969ce6dc93503eb08c15d72356691acf88f7db9))
16
+
3
17
  ## [0.11.0](https://github.com/jgnagy/metatron/compare/metatron/v0.10.1...metatron/v0.11.0) (2025-03-28)
4
18
 
5
19
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.11.0)
4
+ metatron (0.11.2)
5
5
  base64
6
6
  json (~> 2.6)
7
7
  rack (>= 2.2.8, < 4)
@@ -25,9 +25,9 @@ GEM
25
25
  language_server-protocol (3.17.0.4)
26
26
  lint_roller (1.1.0)
27
27
  logger (1.6.6)
28
- nokogiri (1.18.4-arm64-darwin)
28
+ nokogiri (1.18.8-arm64-darwin)
29
29
  racc (~> 1.4)
30
- nokogiri (1.18.4-x86_64-linux-gnu)
30
+ nokogiri (1.18.8-x86_64-linux-gnu)
31
31
  racc (~> 1.4)
32
32
  observer (0.1.2)
33
33
  ostruct (0.6.1)
@@ -36,7 +36,7 @@ GEM
36
36
  ast (~> 2.4.1)
37
37
  racc
38
38
  racc (1.8.1)
39
- rack (3.1.12)
39
+ rack (3.1.16)
40
40
  rack-test (2.2.0)
41
41
  rack (>= 1.3)
42
42
  rainbow (3.1.1)
@@ -10,13 +10,16 @@ module Metatron
10
10
 
11
11
  attr_accessor :schedule, :suspend, :concurrency_policy, :starting_deadline_seconds,
12
12
  :successful_jobs_history_limit, :failed_jobs_history_limit,
13
- :backoff_limit
13
+ :job_active_deadline_seconds, :ttl_seconds_after_finished,
14
+ :backoff_limit, :time_zone
14
15
 
15
16
  alias backoffLimit backoff_limit
16
17
  alias concurrencyPolicy concurrency_policy
17
18
  alias startingDeadlineSeconds starting_deadline_seconds
18
19
  alias successfulJobsHistoryLimit successful_jobs_history_limit
19
20
  alias failedJobsHistoryLimit failed_jobs_history_limit
21
+ alias timeZone time_zone
22
+ alias ttlSecondsAfterFinished ttl_seconds_after_finished
20
23
 
21
24
  def initialize(name, schedule = "* * * * *")
22
25
  super(name)
@@ -40,9 +43,12 @@ module Metatron
40
43
  startingDeadlineSeconds:,
41
44
  successfulJobsHistoryLimit:,
42
45
  failedJobsHistoryLimit:,
46
+ timeZone:,
43
47
  jobTemplate: {
44
48
  spec: {
45
- backoffLimit:
49
+ activeDeadlineSeconds: job_active_deadline_seconds,
50
+ backoffLimit:,
51
+ ttlSecondsAfterFinished:
46
52
  }.merge(pod_template).compact
47
53
  }.merge(formatted_tolerations).compact
48
54
  }.compact
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ module Templates
5
+ # The VolumeSnapshot Kubernetes resource
6
+ class VolumeSnapshot < Template
7
+ include Concerns::Annotated
8
+ include Concerns::Namespaced
9
+
10
+ attr_accessor :source, :volume_snapshot_class_name
11
+
12
+ alias volumeSnapshotClassName volume_snapshot_class_name
13
+
14
+ def initialize(name, source: {}, volume_snapshot_class_name: nil)
15
+ super(name)
16
+ @source = source
17
+ @volume_snapshot_class_name = volume_snapshot_class_name
18
+ @api_version = "snapshot.storage.k8s.io/v1"
19
+ end
20
+
21
+ def render
22
+ {
23
+ apiVersion:,
24
+ kind:,
25
+ metadata: {
26
+ name:,
27
+ labels: base_labels.merge(additional_labels)
28
+ }.merge(formatted_annotations).merge(formatted_namespace).compact,
29
+ spec: {}.merge(formatted_source).merge(formatted_volume_snapshot_class_name).compact
30
+ }.compact
31
+ end
32
+
33
+ def formatted_source
34
+ case source
35
+ when Hash
36
+ { source: }
37
+ when Metatron::Templates::VolumeSnapshotContent
38
+ { source: { volumeSnapshotContentName: source.name } }
39
+ when Metatron::Templates::PersistentVolumeClaim
40
+ { source: { persistentVolumeClaimName: source.name } }
41
+ when nil
42
+ {}
43
+ else
44
+ raise ArgumentError,
45
+ "Invalid source type: #{source.class}. " \
46
+ "Expected Hash, VolumeSnapshotContent, or PersistentVolumeClaim."
47
+ end
48
+ end
49
+
50
+ def formatted_volume_snapshot_class_name
51
+ return {} unless volume_snapshot_class_name
52
+
53
+ if volume_snapshot_class_name.is_a?(String)
54
+ { volumeSnapshotClassName: }
55
+ elsif volume_snapshot_class_name.respond_to?(:name)
56
+ { volumeSnapshotClassName: volume_snapshot_class_name.name }
57
+ else
58
+ raise ArgumentError,
59
+ "Invalid volume_snapshot_class_name type: #{volume_snapshot_class_name.class}."
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ module Templates
5
+ # The VolumeSnapshotContent Kubernetes resource
6
+ class VolumeSnapshotContent < Template
7
+ include Concerns::Annotated
8
+ include Concerns::Namespaced
9
+
10
+ attr_accessor :source, :deletion_policy, :driver, :source_volume_mode, :volume_snapshot_ref
11
+
12
+ alias deletionPolicy deletion_policy
13
+ alias sourceVolumeMode source_volume_mode
14
+ alias volumeSnapshotRef volume_snapshot_ref
15
+
16
+ def initialize(name, driver:, source: {}, deletion_policy: "Delete",
17
+ volume_snapshot_ref: nil, source_volume_mode: "Filesystem")
18
+ super(name)
19
+ @api_version = "snapshot.storage.k8s.io/v1"
20
+ @driver = driver
21
+ @source = source
22
+ @source_volume_mode = source_volume_mode
23
+ @deletion_policy = deletion_policy
24
+ @volume_snapshot_ref = volume_snapshot_ref
25
+ end
26
+
27
+ def render
28
+ {
29
+ apiVersion:,
30
+ kind:,
31
+ metadata: {
32
+ name:,
33
+ labels: base_labels.merge(additional_labels)
34
+ }.merge(formatted_annotations).merge(formatted_namespace).compact,
35
+ spec: {
36
+ driver:,
37
+ deletionPolicy:,
38
+ sourceVolumeMode:
39
+ }.merge(formatted_source).merge(formatted_volume_snapshot_ref).compact
40
+ }.compact
41
+ end
42
+
43
+ def formatted_source
44
+ return {} unless source
45
+ raise ArgumentError, "Invalid source type: #{source.class}." unless source.is_a?(Hash)
46
+
47
+ { source: }
48
+ end
49
+
50
+ def formatted_volume_snapshot_ref
51
+ return {} unless volume_snapshot_ref
52
+
53
+ if volume_snapshot_ref.is_a?(Hash)
54
+ { volumeSnapshotRef: }
55
+ elsif volume_snapshot_ref.is_a?(VolumeSnapshot)
56
+ {
57
+ volumeSnapshotRef: {
58
+ name: volume_snapshot_ref.name,
59
+ namespace: volume_snapshot_ref.namespace
60
+ }.compact
61
+ }
62
+ else
63
+ raise ArgumentError,
64
+ "Invalid volume_snapshot_ref type: #{volume_snapshot_ref.class}."
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metatron
4
- VERSION = "0.11.0"
4
+ VERSION = "0.11.2"
5
5
  end
data/lib/metatron.rb CHANGED
@@ -47,6 +47,8 @@ require "metatron/templates/secret"
47
47
  require "metatron/templates/service"
48
48
  require "metatron/templates/service_account"
49
49
  require "metatron/templates/stateful_set"
50
+ require "metatron/templates/volume_snapshot"
51
+ require "metatron/templates/volume_snapshot_content"
50
52
  require "metatron/controller"
51
53
  require "metatron/composite_controller"
52
54
  require "metatron/controllers/ping"
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.11.0
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-28 00:00:00.000000000 Z
11
+ date: 2025-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -281,6 +281,8 @@ files:
281
281
  - lib/metatron/templates/service.rb
282
282
  - lib/metatron/templates/service_account.rb
283
283
  - lib/metatron/templates/stateful_set.rb
284
+ - lib/metatron/templates/volume_snapshot.rb
285
+ - lib/metatron/templates/volume_snapshot_content.rb
284
286
  - lib/metatron/version.rb
285
287
  - metatron.gemspec
286
288
  - release-please-config.json