kerbi 0.0.14 → 0.0.17
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/lib/cli/config_handler.rb +3 -1
- data/lib/cli/root_handler.rb +6 -2
- data/lib/config/cli_schema.rb +9 -7
- data/lib/config/run_opts.rb +5 -1
- data/spec/cli/values_handler_spec.rb +8 -0
- metadata +39 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87229b0de18f42ad900623b45d25453eadeb1a5610e6d297481d9f72c8580489
|
4
|
+
data.tar.gz: 9135a837301c4b7c564d9970e10b5c5c9d649b41b2cbbfc0750ff7203b07c415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10e993d8a7193e052a7fcd2040f811a41177d7d59f80129fff0f4573b69ed0cb0d48e7bc707e4a01ee784fea909f7d04248a8e2a7e786240843c3deaf90070e7
|
7
|
+
data.tar.gz: 4c4b5ce1c2bd3f14a74694a3070aa7c299be96a5e5bdacca9ddd22ef040b1dea253dbde788558bc3c44dd9ffc6bf4d4e50e44e93468d25f6498c0d2d6eb5588f
|
data/lib/cli/config_handler.rb
CHANGED
@@ -25,7 +25,9 @@ module Kerbi
|
|
25
25
|
|
26
26
|
cmd_meta Kerbi::Consts::CommandSchemas::CONFIG_SHOW
|
27
27
|
def show
|
28
|
-
|
28
|
+
src = run_opts.options
|
29
|
+
hash = Hash[legal_keys.map { |k| [k, src[k]] }]
|
30
|
+
echo_data(hash)
|
29
31
|
end
|
30
32
|
|
31
33
|
cmd_meta Kerbi::Consts::CommandSchemas::CONFIG_RESET
|
data/lib/cli/root_handler.rb
CHANGED
@@ -2,9 +2,11 @@ module Kerbi
|
|
2
2
|
|
3
3
|
class Console
|
4
4
|
attr_reader :values
|
5
|
+
attr_reader :default_values
|
5
6
|
|
6
|
-
def initialize(values)
|
7
|
+
def initialize(values, default_values)
|
7
8
|
@values = values
|
9
|
+
@default_values = default_values
|
8
10
|
end
|
9
11
|
|
10
12
|
def to_s
|
@@ -46,9 +48,11 @@ module Kerbi
|
|
46
48
|
def console
|
47
49
|
utils::Cli.load_kerbifile(run_opts.project_root)
|
48
50
|
values = compile_values
|
51
|
+
default_values = compile_default_values
|
49
52
|
ARGV.clear
|
50
53
|
IRB.setup(eval("__FILE__"), argv: [])
|
51
|
-
|
54
|
+
wrapper = Console.new(values, default_values)
|
55
|
+
workspace = IRB::WorkSpace.new(wrapper)
|
52
56
|
IRB::Irb.new(workspace).run(IRB.conf)
|
53
57
|
end
|
54
58
|
|
data/lib/config/cli_schema.rb
CHANGED
@@ -28,15 +28,15 @@ module Kerbi
|
|
28
28
|
KUBE_ACCESS_TOKEN = "k8s-access-token"
|
29
29
|
K8S_USERNAME = "k8s-username"
|
30
30
|
K8S_PASSWORD = "k8s-password"
|
31
|
-
K8S_TOKEN = "k8s-access-token"
|
32
31
|
|
33
32
|
LEGAL_CONFIG_FILE_KEYS = [
|
33
|
+
LOAD_DEFAULT_VALUES,
|
34
|
+
OUTPUT_FMT,
|
34
35
|
STATE_BACKEND_TYPE,
|
35
36
|
K8S_AUTH_TYPE,
|
37
|
+
KUBE_CONFIG_PATH,
|
36
38
|
KUBE_CONFIG_CONTEXT,
|
37
|
-
|
38
|
-
K8S_PASSWORD,
|
39
|
-
KUBE_ACCESS_TOKEN
|
39
|
+
KUBE_ACCESS_TOKEN,
|
40
40
|
]
|
41
41
|
end
|
42
42
|
|
@@ -111,8 +111,8 @@ module Kerbi
|
|
111
111
|
default: true
|
112
112
|
}.freeze
|
113
113
|
|
114
|
-
|
115
|
-
key: OptionKeys::
|
114
|
+
KUBE_ACCESS_TOKEN = {
|
115
|
+
key: OptionKeys::KUBE_ACCESS_TOKEN,
|
116
116
|
desc: "Kubernetes auth bearer token for token auth"
|
117
117
|
}.freeze
|
118
118
|
|
@@ -199,7 +199,8 @@ module Kerbi
|
|
199
199
|
WRITE_STATE,
|
200
200
|
K8S_AUTH_TYPE,
|
201
201
|
KUBE_CONFIG_PATH,
|
202
|
-
KUBE_CONFIG_CONTEXT
|
202
|
+
KUBE_CONFIG_CONTEXT,
|
203
|
+
KUBE_ACCESS_TOKEN
|
203
204
|
].freeze
|
204
205
|
|
205
206
|
VALUES_OPTIONS = [
|
@@ -397,6 +398,7 @@ module Kerbi
|
|
397
398
|
options: [
|
398
399
|
OptionSchemas::OUTPUT_FMT,
|
399
400
|
OptionSchemas::PROJECT_ROOT,
|
401
|
+
OptionSchemas::RELEASE_NAME,
|
400
402
|
*OptionSchemas::VALUES_OPTIONS,
|
401
403
|
*OptionSchemas::KUBERNETES_OPTIONS
|
402
404
|
]
|
data/lib/config/run_opts.rb
CHANGED
@@ -26,6 +26,10 @@ module Kerbi
|
|
26
26
|
value || default
|
27
27
|
end
|
28
28
|
|
29
|
+
def release_name
|
30
|
+
@release_name || options[consts::RELEASE_NAME]
|
31
|
+
end
|
32
|
+
|
29
33
|
# @return [TrueClass, FalseClass]
|
30
34
|
def output_yaml?
|
31
35
|
self.output_format == 'yaml'
|
@@ -124,7 +128,7 @@ module Kerbi
|
|
124
128
|
|
125
129
|
# @return [String]
|
126
130
|
def k8s_auth_token
|
127
|
-
options[consts::
|
131
|
+
options[consts::KUBE_ACCESS_TOKEN]
|
128
132
|
end
|
129
133
|
|
130
134
|
# @return [String]
|
@@ -12,5 +12,13 @@ RSpec.describe "$ kerbi values [COMMAND]" do
|
|
12
12
|
exp_cli_eq_file(cmd, "values", "order-of-precedence", "yaml")
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
context "with state" do
|
17
|
+
it "parses RELEASE_NAME correctly" do
|
18
|
+
# base = "values show --release-name foo"
|
19
|
+
# puts cli(base)
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
15
23
|
end
|
16
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kerbi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Millot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -239,60 +239,60 @@ signing_key:
|
|
239
239
|
specification_version: 4
|
240
240
|
summary: Multi-strategy Kubernetes manifest templating engine.
|
241
241
|
test_files:
|
242
|
-
- spec/
|
242
|
+
- spec/spec_helper.rb
|
243
243
|
- spec/main/mixer_spec.rb
|
244
|
+
- spec/main/state_entry_spec.rb
|
244
245
|
- spec/main/configmap_backend_spec.rb
|
245
246
|
- spec/main/state_entry_set_spec.rb
|
246
|
-
- spec/main/
|
247
|
-
- spec/cli/release_handler_spec.rb
|
248
|
-
- spec/cli/config_handler_spec.rb
|
249
|
-
- spec/cli/values_handler_spec.rb
|
250
|
-
- spec/cli/state_handler_spec.rb
|
251
|
-
- spec/cli/root_handler_spec.rb
|
252
|
-
- spec/utils/values_utils_spec.rb
|
253
|
-
- spec/utils/mixing_utils_spec.rb
|
254
|
-
- spec/utils/misc_utils_spec.rb
|
247
|
+
- spec/main/project_code_gen_spec.rb
|
255
248
|
- spec/utils/helm_spec.rb
|
249
|
+
- spec/utils/mixing_utils_spec.rb
|
256
250
|
- spec/utils/k8s_auth_spec.rb
|
251
|
+
- spec/utils/misc_utils_spec.rb
|
252
|
+
- spec/utils/values_utils_spec.rb
|
257
253
|
- spec/mixins/mixer_mixin_spec.rb
|
258
|
-
- spec/
|
259
|
-
- spec/
|
260
|
-
- spec/
|
261
|
-
- spec/
|
262
|
-
- spec/
|
263
|
-
- spec/fixtures/
|
264
|
-
- spec/fixtures/mini-projects/hello-kerbi/consts.rb
|
265
|
-
- spec/fixtures/mini-projects/hello-kerbi/pod-and-service.yaml.erb
|
266
|
-
- spec/fixtures/expectations/common/bad-tag.txt
|
267
|
-
- spec/fixtures/expectations/release/init-already-existed.txt
|
268
|
-
- spec/fixtures/expectations/release/status-data-unreadable.txt
|
269
|
-
- spec/fixtures/expectations/release/init-both-created.txt
|
270
|
-
- spec/fixtures/expectations/release/status-all-working.txt
|
271
|
-
- spec/fixtures/expectations/release/status-not-provisioned.txt
|
272
|
-
- spec/fixtures/expectations/release/list.txt
|
273
|
-
- spec/fixtures/expectations/release/delete.txt
|
254
|
+
- spec/cli/state_handler_spec.rb
|
255
|
+
- spec/cli/values_handler_spec.rb
|
256
|
+
- spec/cli/release_handler_spec.rb
|
257
|
+
- spec/cli/config_handler_spec.rb
|
258
|
+
- spec/cli/root_handler_spec.rb
|
259
|
+
- spec/fixtures/embedding.yaml.erb
|
274
260
|
- spec/fixtures/expectations/values/order-of-precedence.yaml
|
275
|
-
- spec/fixtures/expectations/
|
261
|
+
- spec/fixtures/expectations/common/bad-tag.txt
|
276
262
|
- spec/fixtures/expectations/state/list.yaml
|
277
|
-
- spec/fixtures/expectations/state/
|
263
|
+
- spec/fixtures/expectations/state/delete.txt
|
278
264
|
- spec/fixtures/expectations/state/show.yaml
|
265
|
+
- spec/fixtures/expectations/state/prune-candidates.txt
|
266
|
+
- spec/fixtures/expectations/state/list.txt
|
267
|
+
- spec/fixtures/expectations/state/demote.txt
|
279
268
|
- spec/fixtures/expectations/state/show.txt
|
280
269
|
- spec/fixtures/expectations/state/show.json
|
281
|
-
- spec/fixtures/expectations/state/set.txt
|
282
|
-
- spec/fixtures/expectations/state/list.txt
|
283
270
|
- spec/fixtures/expectations/state/promote.txt
|
284
|
-
- spec/fixtures/expectations/state/delete.txt
|
285
271
|
- spec/fixtures/expectations/state/list.json
|
286
272
|
- spec/fixtures/expectations/state/retag.txt
|
273
|
+
- spec/fixtures/expectations/state/set.txt
|
274
|
+
- spec/fixtures/expectations/release/delete.txt
|
275
|
+
- spec/fixtures/expectations/release/status-not-provisioned.txt
|
276
|
+
- spec/fixtures/expectations/release/status-data-unreadable.txt
|
277
|
+
- spec/fixtures/expectations/release/list.txt
|
278
|
+
- spec/fixtures/expectations/release/init-both-created.txt
|
279
|
+
- spec/fixtures/expectations/release/init-already-existed.txt
|
280
|
+
- spec/fixtures/expectations/release/status-all-working.txt
|
287
281
|
- spec/fixtures/expectations/config/show-default.yaml
|
288
282
|
- spec/fixtures/expectations/config/bad-set.txt
|
289
283
|
- spec/fixtures/expectations/config/set.txt
|
284
|
+
- spec/fixtures/expectations/root/values.json
|
285
|
+
- spec/fixtures/expectations/root/template-production.yaml
|
286
|
+
- spec/fixtures/expectations/root/template.yaml
|
287
|
+
- spec/fixtures/expectations/root/template-read-inlines.yaml
|
290
288
|
- spec/fixtures/expectations/root/template-write.yaml
|
291
289
|
- spec/fixtures/expectations/root/template-read.yaml
|
292
|
-
- spec/fixtures/expectations/root/template-production.yaml
|
293
290
|
- spec/fixtures/expectations/root/template-inlines.yaml
|
294
|
-
- spec/fixtures/
|
295
|
-
- spec/fixtures/
|
296
|
-
- spec/fixtures/
|
297
|
-
- spec/fixtures/
|
298
|
-
- spec/
|
291
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/values.yaml
|
292
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/v2.yaml
|
293
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/production.yaml
|
294
|
+
- spec/fixtures/mini-projects/hello-kerbi/common/metadata.yaml.erb
|
295
|
+
- spec/fixtures/mini-projects/hello-kerbi/consts.rb
|
296
|
+
- spec/fixtures/mini-projects/hello-kerbi/kerbifile.rb
|
297
|
+
- spec/fixtures/mini-projects/hello-kerbi/pod-and-service.yaml.erb
|
298
|
+
- spec/fixtures/mini-projects/hello-kerbi/helpers.rb
|