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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/metatron/templates/cluster_role.rb +33 -0
- data/lib/metatron/templates/cluster_role_binding.rb +39 -0
- data/lib/metatron/version.rb +1 -1
- data/lib/metatron.rb +5 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f308e72dd77b3d49526080eec9ad9de69365d4892b0fa4b113530d42ecf3305b
|
4
|
+
data.tar.gz: 5501df686f100f401984f103c42ebbe41f93eb2d8fb992f19cd2231a94175fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75604561c430cbdabe5093c7cc593c8e8c145b0bae8a0427d60e26ac368a27f3794beb3e956a0458ad95b90c1ac76c886896381fcd845120645b97d2dec48c86
|
7
|
+
data.tar.gz: ae099c61283a7b99b22e5f76a48f4ce24847f2ef8d50e5b477a00bc68a5f57654a5349ba63127451d7c9c43ba1db7cef4be31e110227db00e19d8a2143c570b0
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/metatron/version.rb
CHANGED
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/
|
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.
|
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-
|
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
|