metatron 0.2.7 → 0.2.8

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: 36e8e6c44406c821d01c13c564acf765719ac6ac2572053afa5d4bd5b33df33f
4
- data.tar.gz: 3378c577112bdc28cfbdf4e33c6a5a739434ba4e38312a4147f574ca09b29139
3
+ metadata.gz: f308e72dd77b3d49526080eec9ad9de69365d4892b0fa4b113530d42ecf3305b
4
+ data.tar.gz: 5501df686f100f401984f103c42ebbe41f93eb2d8fb992f19cd2231a94175fa2
5
5
  SHA512:
6
- metadata.gz: a3857663d6044c885a46e1ff3bf5017281f4202273516bacb7a38e1aaa9cd84d689221c700fb4d4f55316f3b55eec379134eae12ba9d7727e233f051b9da9bb7
7
- data.tar.gz: dddb6a6dda8d5a54b44c14cc2579f570e099033e22b085a560827ca60344b2d8d3ef331cd9660526c358e3c80ed2c9f2dba309b8707b44f29f75e1b365854809
6
+ metadata.gz: 75604561c430cbdabe5093c7cc593c8e8c145b0bae8a0427d60e26ac368a27f3794beb3e956a0458ad95b90c1ac76c886896381fcd845120645b97d2dec48c86
7
+ data.tar.gz: ae099c61283a7b99b22e5f76a48f4ce24847f2ef8d50e5b477a00bc68a5f57654a5349ba63127451d7c9c43ba1db7cef4be31e110227db00e19d8a2143c570b0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.2.7)
4
+ metatron (0.2.8)
5
5
  json (~> 2.6)
6
6
  puma (~> 6.3)
7
7
  sinatra (~> 2.2)
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ module Templates
5
+ # Template for basic ClusterRole k8s resource
6
+ class ClusterRole < Template
7
+ include Concerns::Annotated
8
+
9
+ attr_accessor :rules, :aggregation_rule
10
+
11
+ alias aggregationRule aggregation_rule
12
+
13
+ def initialize(name)
14
+ super(name)
15
+ @api_version = "rbac.authorization.k8s.io/v1"
16
+ @rules = []
17
+ end
18
+
19
+ def render
20
+ {
21
+ apiVersion:,
22
+ kind:,
23
+ metadata: {
24
+ name:,
25
+ labels: { "#{label_namespace}/name": name }.merge(additional_labels)
26
+ }.merge(formatted_annotations).compact,
27
+ aggregationRule:,
28
+ rules:
29
+ }.compact
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ module Templates
5
+ # Template for basic ClusterRoleBinding k8s resource
6
+ class ClusterRoleBinding < Template
7
+ include Concerns::Annotated
8
+
9
+ attr_accessor :role_ref, :subjects, :role
10
+
11
+ alias roleRef role_ref
12
+
13
+ def initialize(name, role)
14
+ super(name)
15
+ @api_version = "rbac.authorization.k8s.io/v1"
16
+ @role = role
17
+ @role_ref = {
18
+ kind: "ClusterRole",
19
+ name: role.respond_to?(:name) ? role.name : role,
20
+ apiGroup: "rbac.authorization.k8s.io"
21
+ }
22
+ @subjects = []
23
+ end
24
+
25
+ def render
26
+ {
27
+ apiVersion:,
28
+ kind:,
29
+ metadata: {
30
+ name:,
31
+ labels: { "#{label_namespace}/name": name }.merge(additional_labels)
32
+ }.merge(formatted_annotations).compact,
33
+ roleRef:,
34
+ subjects:
35
+ }.compact
36
+ end
37
+ end
38
+ end
39
+ end
@@ -4,6 +4,6 @@ module Metatron
4
4
  VERSION = [
5
5
  0, # major
6
6
  2, # minor
7
- 7 # patch
7
+ 8 # patch
8
8
  ].join(".")
9
9
  end
data/lib/metatron.rb CHANGED
@@ -29,15 +29,17 @@ require "metatron/templates/concerns/annotated"
29
29
  require "metatron/templates/concerns/namespaced"
30
30
  require "metatron/templates/concerns/pod_producer"
31
31
  require "metatron/templates/container"
32
+ require "metatron/templates/pod"
32
33
  require "metatron/templates/job"
34
+ require "metatron/templates/config_map"
35
+ require "metatron/templates/cluster_role"
33
36
  require "metatron/templates/cron_job"
34
- require "metatron/templates/pod"
35
- require "metatron/templates/persistent_volume_claim"
37
+ require "metatron/templates/daemon_set"
36
38
  require "metatron/templates/deployment"
37
39
  require "metatron/templates/ingress"
38
40
  require "metatron/templates/namespace"
41
+ require "metatron/templates/persistent_volume_claim"
39
42
  require "metatron/templates/replica_set"
40
- require "metatron/templates/config_map"
41
43
  require "metatron/templates/secret"
42
44
  require "metatron/templates/service"
43
45
  require "metatron/templates/service_account"
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.2.7
4
+ version: 0.2.8
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-03 00:00:00.000000000 Z
11
+ date: 2023-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -256,6 +256,8 @@ files:
256
256
  - lib/metatron/controllers/ping.rb
257
257
  - lib/metatron/sync_controller.rb
258
258
  - lib/metatron/template.rb
259
+ - lib/metatron/templates/cluster_role.rb
260
+ - lib/metatron/templates/cluster_role_binding.rb
259
261
  - lib/metatron/templates/concerns/annotated.rb
260
262
  - lib/metatron/templates/concerns/namespaced.rb
261
263
  - lib/metatron/templates/concerns/pod_producer.rb