kube_cluster 0.20.1 → 1.0.0
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/.gitignore +1 -0
- data/CHANGELOG.md +34 -0
- data/Gemfile.lock +5 -37
- data/flake.nix +2 -1
- data/kube_cluster.gemspec +2 -4
- data/lib/kube/cluster/container.rb +17 -17
- data/lib/kube/cluster/manifest.rb +158 -158
- data/lib/kube/cluster/middleware/annotations.rb +42 -42
- data/lib/kube/cluster/middleware/hpa_for_deployment.rb +134 -134
- data/lib/kube/cluster/middleware/ingress_for_service.rb +75 -75
- data/lib/kube/cluster/middleware/labels.rb +58 -58
- data/lib/kube/cluster/middleware/pod_anti_affinity.rb +104 -104
- data/lib/kube/cluster/middleware/resource_preset.rb +145 -145
- data/lib/kube/cluster/middleware/security_context.rb +127 -127
- data/lib/kube/cluster/middleware/service_for_deployment.rb +120 -120
- data/lib/kube/cluster/middleware.rb +219 -221
- data/lib/kube/cluster/resource/dirty_tracking.rb +388 -388
- data/lib/kube/cluster/resource.rb +16 -16
- data/lib/kube/cluster/standard/cdi/data_volume.rb +13 -13
- data/lib/kube/cluster/standard/cloud_native_pg/cluster.rb +11 -11
- data/lib/kube/cluster/standard/cloud_native_pg/database_with_external_secret.rb +11 -11
- data/lib/kube/cluster/standard/cloud_native_pg/external_secret.rb +11 -11
- data/lib/kube/cluster/standard/cloud_native_pg/helm.rb +26 -26
- data/lib/kube/cluster/standard/config_map.rb +11 -11
- data/lib/kube/cluster/standard/cron_job.rb +13 -13
- data/lib/kube/cluster/standard/cron_job_with_service_account.rb +12 -12
- data/lib/kube/cluster/standard/custom_resource_definition.rb +12 -12
- data/lib/kube/cluster/standard/daemon_set.rb +12 -12
- data/lib/kube/cluster/standard/deployment_with_service.rb +82 -82
- data/lib/kube/cluster/standard/env_processing.rb +15 -15
- data/lib/kube/cluster/standard/eso/external_secret.rb +13 -13
- data/lib/kube/cluster/standard/forgejo/helm.rb +11 -11
- data/lib/kube/cluster/standard/gateway_api/http_route.rb +322 -19
- data/lib/kube/cluster/standard/job.rb +12 -12
- data/lib/kube/cluster/standard/job_with_service_account.rb +11 -11
- data/lib/kube/cluster/standard/kube_virt/virtual_machine.rb +11 -11
- data/lib/kube/cluster/standard/meta_controller/composite_controller.rb +13 -13
- data/lib/kube/cluster/standard/meta_controller/decorator_controller.rb +13 -13
- data/lib/kube/cluster/standard/perses/perses.rb +9 -9
- data/lib/kube/cluster/standard/perses/perses_datasource.rb +13 -13
- data/lib/kube/cluster/standard/persistent_volume_claim.rb +12 -12
- data/lib/kube/cluster/standard/role.rb +12 -12
- data/lib/kube/cluster/standard/role_binding.rb +10 -10
- data/lib/kube/cluster/standard/secret.rb +11 -11
- data/lib/kube/cluster/standard/service.rb +12 -12
- data/lib/kube/cluster/standard/service_account.rb +9 -9
- data/lib/kube/cluster/standard/service_account_with_role.rb +10 -10
- data/lib/kube/cluster/standard/victoria_metrics/vl_agent.rb +9 -9
- data/lib/kube/cluster/standard/victoria_metrics/vl_single.rb +9 -9
- data/lib/kube/cluster/standard/victoria_metrics/vm_agent.rb +9 -9
- data/lib/kube/cluster/standard/victoria_metrics/vm_node_scrape.rb +9 -9
- data/lib/kube/cluster/standard/victoria_metrics/vm_service_scrape.rb +9 -9
- data/lib/kube/cluster/standard/victoria_metrics/vm_single.rb +9 -9
- data/lib/kube/cluster/standard/volume_processing.rb +3 -3
- data/lib/kube/cluster/version.rb +1 -1
- data/lib/kube/cluster.rb +137 -1
- data/lib/kube/helm/chart.rb +323 -323
- data/lib/kube/helm/endpoint.rb +58 -58
- data/lib/kube/helm/repo.rb +160 -160
- metadata +7 -20
|
@@ -129,24 +129,24 @@ module Kube
|
|
|
129
129
|
end
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
132
|
+
__END__
|
|
133
|
+
|
|
134
|
+
class ExampleServiceSubclass < Kube::Cluster["Service"]
|
|
135
|
+
def initialize(name:, port:, **options, &block)
|
|
136
|
+
super() {
|
|
137
|
+
metadata.name = name
|
|
138
|
+
metadata.labels = { "app" => name }
|
|
139
|
+
spec.selector = { "app" => name }
|
|
140
|
+
spec.ports = [{ port: port, targetPort: port, protocol: "TCP" }]
|
|
141
|
+
|
|
142
|
+
instance_exec(&block) if block_given?
|
|
143
|
+
}
|
|
143
144
|
|
|
144
|
-
end
|
|
145
145
|
end
|
|
146
|
+
end
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
end
|
|
148
|
+
it "rebuilds properly" do
|
|
149
|
+
ExampleServiceSubclass.new(name: "example-service", port: 3000).tap do |service|
|
|
150
|
+
lambda{ service.rebuild(**service.to_h) }.should.not.raise
|
|
151
151
|
end
|
|
152
152
|
end
|
|
@@ -20,16 +20,16 @@ module Kube
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
end
|
|
23
|
+
__END__
|
|
24
|
+
|
|
25
|
+
#describe "CDI::DataVolume" do
|
|
26
|
+
# it "initializes without error" do
|
|
27
|
+
# Kube::Cluster::Standard::CDI::DataVolume
|
|
28
|
+
# .new(
|
|
29
|
+
# name: "my-example-volume"
|
|
30
|
+
# )
|
|
31
|
+
# .to_yaml
|
|
32
|
+
# .is_a?(String)
|
|
33
|
+
# .should == true
|
|
34
|
+
# end
|
|
35
|
+
#end
|
|
@@ -14,14 +14,14 @@ module Kube
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
17
|
+
__END__
|
|
18
|
+
|
|
19
|
+
#describe "CloudNativePg::Cluster" do
|
|
20
|
+
# it "initializes without error" do
|
|
21
|
+
# Kube::Cluster::Standard::CloudNativePg::Cluster
|
|
22
|
+
# .new()
|
|
23
|
+
# .to_yaml
|
|
24
|
+
# .is_a?(String)
|
|
25
|
+
# .should == true
|
|
26
|
+
# end
|
|
27
|
+
#end
|
|
@@ -29,16 +29,16 @@ module Kube
|
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
__END__
|
|
33
|
+
|
|
34
|
+
describe "CloudNativePg::DatabaseWithExternalSecret" do
|
|
35
|
+
it "initializes without error" do
|
|
36
|
+
Kube::Cluster::Standard::CloudNativePg::DatabaseWithExternalSecret
|
|
37
|
+
.new(
|
|
38
|
+
name: "my-example-cluster"
|
|
39
|
+
)
|
|
40
|
+
.to_yaml
|
|
41
|
+
.is_a?(String)
|
|
42
|
+
.should == true
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -42,16 +42,16 @@ module Kube
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
__END__
|
|
46
|
+
|
|
47
|
+
describe "CloudNativePg::ExternalSecret" do
|
|
48
|
+
it "initializes without error" do
|
|
49
|
+
Kube::Cluster::Standard::CloudNativePg::ExternalSecret
|
|
50
|
+
.new(
|
|
51
|
+
name: "my-external-secret"
|
|
52
|
+
)
|
|
53
|
+
.to_yaml
|
|
54
|
+
.is_a?(String)
|
|
55
|
+
.should == true
|
|
56
56
|
end
|
|
57
57
|
end
|
|
@@ -64,34 +64,34 @@ module Kube
|
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
__END__
|
|
68
|
+
|
|
69
|
+
describe "Operator" do
|
|
70
|
+
it "initializes without error" do
|
|
71
|
+
Kube::Cluster::Standard::CloudNativePg::Helm::Operator
|
|
72
|
+
.new()
|
|
73
|
+
.to_yaml
|
|
74
|
+
.is_a?(String)
|
|
75
|
+
.should == true
|
|
76
76
|
end
|
|
77
|
+
end
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
#describe "Cluster" do
|
|
80
|
+
# it "initializes without error" do
|
|
81
|
+
# Kube::Cluster::Standard::CloudNativePg::Helm::Cluster
|
|
82
|
+
# .new()
|
|
83
|
+
# .to_yaml
|
|
84
|
+
# .is_a?(String)
|
|
85
|
+
# .should == true
|
|
86
|
+
# end
|
|
87
|
+
#end
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
end
|
|
89
|
+
describe "Barman" do
|
|
90
|
+
it "initializes without error" do
|
|
91
|
+
Kube::Cluster::Standard::CloudNativePg::Helm::Barman
|
|
92
|
+
.new()
|
|
93
|
+
.to_yaml
|
|
94
|
+
.is_a?(String)
|
|
95
|
+
.should == true
|
|
96
96
|
end
|
|
97
97
|
end
|
|
@@ -30,16 +30,16 @@ module Kube
|
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
__END__
|
|
34
|
+
|
|
35
|
+
describe "ConfigMap" do
|
|
36
|
+
it "initializes without error" do
|
|
37
|
+
Kube::Cluster::Standard::ConfigMap
|
|
38
|
+
.new(
|
|
39
|
+
#name: "example-config"
|
|
40
|
+
)
|
|
41
|
+
.to_yaml
|
|
42
|
+
.is_a?(String)
|
|
43
|
+
.should == true
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -39,18 +39,18 @@ module Kube
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
__END__
|
|
43
|
+
|
|
44
|
+
describe "CronJob" do
|
|
45
|
+
it "initializes without error" do
|
|
46
|
+
Kube::Cluster::Standard::CronJob
|
|
47
|
+
.new(
|
|
48
|
+
name: "my-cron",
|
|
49
|
+
image: "nixery.dev/shell/kubectl",
|
|
50
|
+
schedule: "*/5 * * * *",
|
|
51
|
+
)
|
|
52
|
+
.to_yaml
|
|
53
|
+
.is_a?(String)
|
|
54
|
+
.should == true
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -54,18 +54,18 @@ module Kube
|
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
describe "CronJobWithServiceAccount" do
|
|
59
|
-
it "emits the RBAC trio plus the cron job" do
|
|
60
|
-
m = Kube::Cluster::Standard::CronJobWithServiceAccount.new(
|
|
61
|
-
name: "builder",
|
|
62
|
-
image: "nixery.dev/shell/kubectl",
|
|
63
|
-
schedule: "*/5 * * * *",
|
|
64
|
-
rules: ["secrets" => %w[get list]],
|
|
65
|
-
command: ["true"],
|
|
66
|
-
)
|
|
57
|
+
__END__
|
|
67
58
|
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
describe "CronJobWithServiceAccount" do
|
|
60
|
+
it "emits the RBAC trio plus the cron job" do
|
|
61
|
+
m = Kube::Cluster::Standard::CronJobWithServiceAccount.new(
|
|
62
|
+
name: "builder",
|
|
63
|
+
image: "nixery.dev/shell/kubectl",
|
|
64
|
+
schedule: "*/5 * * * *",
|
|
65
|
+
rules: ["secrets" => %w[get list]],
|
|
66
|
+
command: ["true"],
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
m.map { |r| r.to_h[:kind] }.sort.should == %w[CronJob Role RoleBinding ServiceAccount]
|
|
70
70
|
end
|
|
71
71
|
end
|
|
@@ -66,17 +66,17 @@ module Kube
|
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
__END__
|
|
70
|
+
|
|
71
|
+
describe "CustomResourceDefinition" do
|
|
72
|
+
it "initializes without error" do
|
|
73
|
+
Kube::Cluster::Standard::CustomResourceDefinition
|
|
74
|
+
.new(
|
|
75
|
+
kind: "Widget",
|
|
76
|
+
group: "example.com",
|
|
77
|
+
)
|
|
78
|
+
.to_yaml
|
|
79
|
+
.is_a?(String)
|
|
80
|
+
.should == true
|
|
81
81
|
end
|
|
82
82
|
end
|
|
@@ -54,17 +54,17 @@ module Kube
|
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
__END__
|
|
58
|
+
|
|
59
|
+
describe "DaemonSet" do
|
|
60
|
+
it "initializes without error" do
|
|
61
|
+
Kube::Cluster::Standard::DaemonSet
|
|
62
|
+
.new(
|
|
63
|
+
name: "my-daemon",
|
|
64
|
+
image: "busybox",
|
|
65
|
+
)
|
|
66
|
+
.to_yaml
|
|
67
|
+
.is_a?(String)
|
|
68
|
+
.should == true
|
|
69
69
|
end
|
|
70
70
|
end
|
|
@@ -154,91 +154,91 @@ module Kube
|
|
|
154
154
|
end
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
it "sets stdin/tty on the container when requested" do
|
|
172
|
-
yaml = Kube::Cluster::Standard::DeploymentWithService
|
|
173
|
-
.new(
|
|
174
|
-
name: "interactive",
|
|
175
|
-
image: "ruby/ruby",
|
|
176
|
-
port: 3000,
|
|
177
|
-
stdin: true,
|
|
178
|
-
tty: true,
|
|
179
|
-
)
|
|
180
|
-
.to_yaml
|
|
157
|
+
__END__
|
|
158
|
+
|
|
159
|
+
describe "DeploymentWithService" do
|
|
160
|
+
it "initializes without error" do
|
|
161
|
+
Kube::Cluster::Standard::DeploymentWithService
|
|
162
|
+
.new(
|
|
163
|
+
name: "pointless-ruby-container",
|
|
164
|
+
image: "ruby/ruby",
|
|
165
|
+
port: 3000,
|
|
166
|
+
)
|
|
167
|
+
.to_yaml
|
|
168
|
+
.is_a?(String)
|
|
169
|
+
.should == true
|
|
170
|
+
end
|
|
181
171
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
172
|
+
it "sets stdin/tty on the container when requested" do
|
|
173
|
+
yaml = Kube::Cluster::Standard::DeploymentWithService
|
|
174
|
+
.new(
|
|
175
|
+
name: "interactive",
|
|
176
|
+
image: "ruby/ruby",
|
|
177
|
+
port: 3000,
|
|
178
|
+
stdin: true,
|
|
179
|
+
tty: true,
|
|
180
|
+
)
|
|
181
|
+
.to_yaml
|
|
182
|
+
|
|
183
|
+
yaml.include?("stdin: true").should == true
|
|
184
|
+
yaml.include?("tty: true").should == true
|
|
185
|
+
end
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
187
|
+
it "renders limits from the block DSL" do
|
|
188
|
+
yaml = Kube::Cluster::Standard::DeploymentWithService
|
|
189
|
+
.new(
|
|
190
|
+
name: "limited",
|
|
191
|
+
image: "ruby/ruby",
|
|
192
|
+
port: 3000,
|
|
193
|
+
) {
|
|
194
|
+
limits.cpu = { "500m" => Float::INFINITY }
|
|
195
|
+
limits.memory = { "1Gi" => "2Gi" }
|
|
196
|
+
}
|
|
197
|
+
.to_yaml
|
|
198
|
+
|
|
199
|
+
yaml.include?("cpu: 500m").should == true
|
|
200
|
+
yaml.include?("memory: 1Gi").should == true
|
|
201
|
+
yaml.include?("memory: 2Gi").should == true
|
|
202
|
+
# Infinity means request-only — no cpu limit is emitted.
|
|
203
|
+
yaml.scan(/cpu:/).length.should == 1
|
|
204
|
+
end
|
|
204
205
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
206
|
+
it "renders probes from the block DSL" do
|
|
207
|
+
yaml = Kube::Cluster::Standard::DeploymentWithService
|
|
208
|
+
.new(
|
|
209
|
+
name: "probed",
|
|
210
|
+
image: "ruby/ruby",
|
|
211
|
+
port: 3000,
|
|
212
|
+
) {
|
|
213
|
+
probes.url = { path: "/healthz", port: "http" }
|
|
214
|
+
probes.liveness = { 120 => 30 }
|
|
215
|
+
probes.readiness = { 60 => 10 }
|
|
216
|
+
}
|
|
217
|
+
.to_yaml
|
|
218
|
+
|
|
219
|
+
yaml.include?("livenessProbe").should == true
|
|
220
|
+
yaml.include?("readinessProbe").should == true
|
|
221
|
+
yaml.include?("path: \"/healthz\"").should == true
|
|
222
|
+
yaml.include?("initialDelaySeconds: 120").should == true
|
|
223
|
+
yaml.include?("initialDelaySeconds: 60").should == true
|
|
224
|
+
end
|
|
224
225
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
end
|
|
226
|
+
it "renders limits and probes together" do
|
|
227
|
+
yaml = Kube::Cluster::Standard::DeploymentWithService
|
|
228
|
+
.new(
|
|
229
|
+
name: "both",
|
|
230
|
+
image: "ruby/ruby",
|
|
231
|
+
port: 3000,
|
|
232
|
+
) {
|
|
233
|
+
limits.memory = { "1Gi" => "2Gi" }
|
|
234
|
+
probes.url = { path: "/healthz", port: "http" }
|
|
235
|
+
probes.readiness = { 5 => 5 }
|
|
236
|
+
}
|
|
237
|
+
.to_yaml
|
|
238
|
+
|
|
239
|
+
# The probe pass must not clobber the limits pass (each rebuilds the
|
|
240
|
+
# deployment; the second must start from the first's result).
|
|
241
|
+
yaml.include?("memory: 2Gi").should == true
|
|
242
|
+
yaml.include?("readinessProbe").should == true
|
|
243
243
|
end
|
|
244
244
|
end
|
|
@@ -45,22 +45,22 @@ module Kube
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
describe "EnvProcessing" do
|
|
50
|
-
it "maps a Secret::KeyRef to a secretKeyRef env var" do
|
|
51
|
-
secret = Kube::Cluster::Standard::Secret.new(name: "passbolt-db-creds")
|
|
48
|
+
__END__
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{ name: "DB_PASSWORD", valueFrom: { secretKeyRef: { name: "passbolt-db-creds", key: "password" } } }
|
|
57
|
-
]
|
|
58
|
-
end
|
|
50
|
+
describe "EnvProcessing" do
|
|
51
|
+
it "maps a Secret::KeyRef to a secretKeyRef env var" do
|
|
52
|
+
secret = Kube::Cluster::Standard::Secret.new(name: "passbolt-db-creds")
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
Kube::Cluster::Standard::EnvProcessing
|
|
55
|
+
.process("DB_PASSWORD" => secret.key("password"))
|
|
56
|
+
.should == [
|
|
57
|
+
{ name: "DB_PASSWORD", valueFrom: { secretKeyRef: { name: "passbolt-db-creds", key: "password" } } }
|
|
58
|
+
]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "still maps plain string values to value env vars" do
|
|
62
|
+
Kube::Cluster::Standard::EnvProcessing
|
|
63
|
+
.process("FOO" => "bar")
|
|
64
|
+
.should == [{ name: "FOO", value: "bar" }]
|
|
65
65
|
end
|
|
66
66
|
end
|
|
@@ -79,18 +79,18 @@ module Kube
|
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
82
|
+
__END__
|
|
83
|
+
|
|
84
|
+
describe "ESO::ExternalSecret" do
|
|
85
|
+
it "initializes without error" do
|
|
86
|
+
Kube::Cluster::Standard::ESO::ExternalSecret
|
|
87
|
+
.new(
|
|
88
|
+
name: "my-external-secret",
|
|
89
|
+
store: "my-cluster-store",
|
|
90
|
+
remote_key: "secret/data/my-app",
|
|
91
|
+
)
|
|
92
|
+
.to_yaml
|
|
93
|
+
.is_a?(String)
|
|
94
|
+
.should == true
|
|
95
95
|
end
|
|
96
96
|
end
|
|
@@ -49,16 +49,16 @@ module Kube
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
__END__
|
|
53
|
+
|
|
54
|
+
describe "Forgejo::Helm" do
|
|
55
|
+
it "initializes without error" do
|
|
56
|
+
Kube::Cluster::Standard::Forgejo::Helm
|
|
57
|
+
.new(
|
|
58
|
+
domain: "git.facebook.com"
|
|
59
|
+
)
|
|
60
|
+
.to_yaml
|
|
61
|
+
.is_a?(String)
|
|
62
|
+
.should == true
|
|
63
63
|
end
|
|
64
64
|
end
|