metatron 0.3.0 → 0.3.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/metatron/sync_controller.rb +12 -0
- data/lib/metatron/templates/container.rb +8 -2
- data/lib/metatron/version.rb +1 -1
- data/lib/metatron.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ccfd1e08895f074e8acfb5f5f5d5bea896b3bc2b721cf554bf63331fd678653
|
4
|
+
data.tar.gz: 2d51b181787cdd3c68d83cd69dbf7475e973cdd85edafd458a59a324328a6d9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68e7e4f205727a2224b1c3475a083a0f0977fe4f55bebb13791492e1fdf314f8ac4201296acccd0d3c02043d19bf496b90054df11d20938f519fcc7c843d52e9
|
7
|
+
data.tar.gz: 855ef7826fdd9e9a8a1fd3cc657acec1978dde48d8172b352cf8664953edd1b4c769c106f1e0dc22c2378a2c47b2fb6a3440a0078a253f03e0d1983495d9e278
|
data/Gemfile.lock
CHANGED
@@ -9,9 +9,21 @@ module Metatron
|
|
9
9
|
end
|
10
10
|
|
11
11
|
post "/" do
|
12
|
+
# TODO: move this to Sinatra's `etag` helper when Metacontroller is RFC compliant
|
13
|
+
if (provided_etag = calculate_etag) &&
|
14
|
+
(match_header = request.env["HTTP_IF_NONE_MATCH"]) &&
|
15
|
+
match_header.split(/,\s?/).include?("\"#{provided_etag}\"")
|
16
|
+
halt 304
|
17
|
+
end
|
18
|
+
|
19
|
+
# If the etag is available, use it, otherwise proceed with the sync
|
20
|
+
headers "ETag" => "\"#{provided_etag}\"" if provided_etag
|
12
21
|
data = sync
|
13
22
|
data[:children] = data[:children]&.map { |c| c.respond_to?(:render) ? c.render : c }
|
14
23
|
halt(data.to_json)
|
15
24
|
end
|
25
|
+
|
26
|
+
def calculate_etag = nil
|
27
|
+
def sync = raise NotImplementedError
|
16
28
|
end
|
17
29
|
end
|
@@ -6,13 +6,15 @@ module Metatron
|
|
6
6
|
class Container
|
7
7
|
attr_accessor :name, :image, :command, :args, :env, :envfrom, :resources, :volume_mounts,
|
8
8
|
:image_pull_policy, :lifecycle, :probes, :security_context, :ports,
|
9
|
-
:stdin, :tty
|
9
|
+
:stdin, :tty, :termination_message_path, :termination_message_policy
|
10
10
|
|
11
11
|
alias imagePullPolicy image_pull_policy
|
12
12
|
alias volumeMounts volume_mounts
|
13
13
|
alias securityContext security_context
|
14
14
|
alias environment env
|
15
15
|
alias envFrom envfrom
|
16
|
+
alias terminationMessagePath termination_message_path
|
17
|
+
alias terminationMessagePolicy termination_message_policy
|
16
18
|
|
17
19
|
def initialize(name, image = "gcr.io/google_containers/pause")
|
18
20
|
@name = name
|
@@ -27,6 +29,8 @@ module Metatron
|
|
27
29
|
@probes = {}
|
28
30
|
@stdin = true
|
29
31
|
@tty = true
|
32
|
+
@termination_message_path = nil
|
33
|
+
@termination_message_policy = nil
|
30
34
|
end
|
31
35
|
|
32
36
|
def render # rubocop:disable Metrics/AbcSize
|
@@ -36,7 +40,9 @@ module Metatron
|
|
36
40
|
image:,
|
37
41
|
imagePullPolicy:,
|
38
42
|
stdin:,
|
39
|
-
tty
|
43
|
+
tty:,
|
44
|
+
terminationMessagePath:,
|
45
|
+
terminationMessagePolicy:
|
40
46
|
}.merge(probes)
|
41
47
|
.merge(formatted_resources)
|
42
48
|
.merge(formatted_environment)
|
data/lib/metatron/version.rb
CHANGED
data/lib/metatron.rb
CHANGED
@@ -33,6 +33,7 @@ require "metatron/templates/pod"
|
|
33
33
|
require "metatron/templates/job"
|
34
34
|
require "metatron/templates/config_map"
|
35
35
|
require "metatron/templates/cluster_role"
|
36
|
+
require "metatron/templates/cluster_role_binding"
|
36
37
|
require "metatron/templates/cron_job"
|
37
38
|
require "metatron/templates/daemon_set"
|
38
39
|
require "metatron/templates/deployment"
|
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.3.
|
4
|
+
version: 0.3.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: 2023-08-
|
11
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|