kerbi 0.0.6 → 0.0.10
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/base_handler.rb +33 -2
- data/lib/cli/entry_serializers.rb +7 -0
- data/lib/cli/release_handler.rb +3 -3
- data/lib/cli/root_handler.rb +4 -5
- data/lib/cli/state_handler.rb +8 -8
- data/lib/cli/values_handler.rb +0 -1
- data/lib/code-gen/new-project/kerbifile.rb.erb +2 -1
- data/lib/config/cli_schema.rb +49 -33
- data/lib/config/config_file.rb +6 -5
- data/lib/config/globals.rb +8 -0
- data/lib/config/run_opts.rb +21 -7
- data/lib/kerbi.rb +2 -0
- data/lib/main/mixer.rb +2 -2
- data/lib/mixins/entry_tag_logic.rb +3 -0
- data/lib/revision/fetcher.rb +15 -0
- data/lib/state/base_backend.rb +12 -1
- data/lib/state/config_map_backend.rb +7 -1
- data/lib/state/entry.rb +55 -2
- data/lib/state/entry_set.rb +22 -5
- data/lib/utils/cli.rb +10 -1
- data/spec/cli/release_handler_spec.rb +1 -1
- data/spec/cli/root_handler_spec.rb +7 -4
- data/spec/cli/state_handler_spec.rb +2 -2
- data/spec/cli/values_handler_spec.rb +0 -1
- data/spec/fixtures/expectations/state/list.txt +5 -5
- data/spec/fixtures/expectations/state/show.txt +4 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/common/metadata.yaml.erb +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/consts.rb +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/helpers.rb +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/kerbifile.rb +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/pod-and-service.yaml.erb +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/values/production.yaml +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/values/v2.yaml +0 -0
- data/spec/{mini-projects → fixtures/mini-projects}/hello-kerbi/values/values.yaml +0 -0
- data/spec/main/state_entry_spec.rb +1 -0
- data/spec/spec_helper.rb +3 -1
- metadata +51 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c54c442776af5f74fe8caac8eb74883a3e577f39077ea78972ee0fe0e19b5928
|
4
|
+
data.tar.gz: a7ad9356f2e18bc26d903f2e861a178efc41c6a468616db998dbf7041813eb71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04f5d11c0a023e23d294e41be06ca967ba61f7db97bff724b0c73ff37ec7c6f189988de7e8c57ba6993503403802cd69ee8188bd118ec90c65c1a34bd5f01cac
|
7
|
+
data.tar.gz: 6c5d3b70ccb829331666d581783a61c75b1d65de06cb4bd803ce1e5d60a7e44e4c2d797a9f1a27333e268acad2e0eb5d2b3e5aa4ed0f15dd47f3e19a16a453e4
|
data/lib/cli/base_handler.rb
CHANGED
@@ -15,8 +15,38 @@ module Kerbi
|
|
15
15
|
@_state_backend ||= generate_state_backend(**opts)
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
##
|
19
|
+
# Sets two very commonly used variables in the run_opts
|
20
|
+
# object, available to all subclasses.
|
21
|
+
def mem_dna(release_name, project_uri=nil)
|
22
|
+
run_opts.release_name = release_name
|
23
|
+
run_opts.project_uri = project_uri
|
24
|
+
end
|
25
|
+
|
26
|
+
def perform_templating
|
27
|
+
if run_opts.local_engine?
|
28
|
+
perform_local_templating
|
29
|
+
else
|
30
|
+
perform_remote_templating
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def perform_local_templating
|
35
|
+
Kerbi::Utils::Cli.run_mixers(
|
36
|
+
Kerbi::Globals.mixers,
|
37
|
+
compile_values,
|
38
|
+
run_opts.release_name
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def perform_remote_templating
|
43
|
+
Kerbi::Revision::Fetcher.post_template(
|
44
|
+
remote_engine_root_url,
|
45
|
+
run_opts.revision_tag
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
def remote_engine_root_url
|
20
50
|
end
|
21
51
|
|
22
52
|
##
|
@@ -84,6 +114,7 @@ module Kerbi
|
|
84
114
|
|
85
115
|
fname_exprs = run_opts.fname_exprs
|
86
116
|
fname_exprs = ["values", *fname_exprs] if run_opts.load_defaults?
|
117
|
+
fname_exprs = fname_exprs.reject{ |f| f.start_with?("r:") }
|
87
118
|
|
88
119
|
file_values = utils.from_files(
|
89
120
|
fname_exprs,
|
@@ -43,6 +43,8 @@ module Kerbi
|
|
43
43
|
|
44
44
|
has_attributes(
|
45
45
|
:tag,
|
46
|
+
:release,
|
47
|
+
:revision,
|
46
48
|
:message,
|
47
49
|
:created_at,
|
48
50
|
:values,
|
@@ -54,6 +56,10 @@ module Kerbi
|
|
54
56
|
#noinspection RubyResolve
|
55
57
|
colored_tag.bold
|
56
58
|
end
|
59
|
+
|
60
|
+
def release
|
61
|
+
object&.set&.release_name
|
62
|
+
end
|
57
63
|
end
|
58
64
|
|
59
65
|
class EntryRowSerializer < Kerbi::Cli::BaseSerializer
|
@@ -61,6 +67,7 @@ module Kerbi
|
|
61
67
|
|
62
68
|
has_attributes(
|
63
69
|
:tag,
|
70
|
+
:revision,
|
64
71
|
:message,
|
65
72
|
:assignments,
|
66
73
|
:overrides,
|
data/lib/cli/release_handler.rb
CHANGED
@@ -5,7 +5,7 @@ module Kerbi
|
|
5
5
|
cmd_meta Kerbi::Consts::CommandSchemas::INIT_RELEASE
|
6
6
|
# @param [String] release_name refers to a Kubernetes namespace
|
7
7
|
def init(release_name)
|
8
|
-
|
8
|
+
mem_dna(release_name)
|
9
9
|
state_backend.provision_missing_resources(verbose: run_opts.verbose?)
|
10
10
|
ns_key = Kerbi::Consts::OptionSchemas::NAMESPACE
|
11
11
|
Kerbi::ConfigFile.patch({ns_key => release_name})
|
@@ -13,7 +13,7 @@ module Kerbi
|
|
13
13
|
|
14
14
|
cmd_meta Kerbi::Consts::CommandSchemas::RELEASE_STATUS
|
15
15
|
def status(release_name)
|
16
|
-
|
16
|
+
mem_dna(release_name)
|
17
17
|
backend = state_backend
|
18
18
|
backend.test_connection(verbose: run_opts.verbose?)
|
19
19
|
end
|
@@ -29,7 +29,7 @@ module Kerbi
|
|
29
29
|
|
30
30
|
cmd_meta Kerbi::Consts::CommandSchemas::RELEASE_DELETE
|
31
31
|
def delete(release_name)
|
32
|
-
|
32
|
+
mem_dna(release_name)
|
33
33
|
backend = state_backend
|
34
34
|
return unless user_confirmed?
|
35
35
|
old_signature = backend.resource_signature
|
data/lib/cli/root_handler.rb
CHANGED
@@ -33,13 +33,12 @@ module Kerbi
|
|
33
33
|
|
34
34
|
cmd_meta Kerbi::Consts::CommandSchemas::TEMPLATE
|
35
35
|
# @param [String] release_name helm-like Kubernetes release name
|
36
|
-
|
37
|
-
|
36
|
+
# @param [String] project_uri local path like '.' or remote URI
|
37
|
+
def template(release_name, project_uri)
|
38
|
+
mem_dna(release_name, project_uri)
|
38
39
|
utils::Cli.load_kerbifile(run_opts.project_root)
|
39
|
-
|
40
|
+
res_dicts = perform_templating
|
40
41
|
persist_compiled_values
|
41
|
-
mixer_classes = Kerbi::Globals.mixers
|
42
|
-
res_dicts = utils::Cli.run_mixers(mixer_classes, values, release_name)
|
43
42
|
echo_data(res_dicts, coerce_type: "Array")
|
44
43
|
end
|
45
44
|
|
data/lib/cli/state_handler.rb
CHANGED
@@ -4,7 +4,7 @@ module Kerbi
|
|
4
4
|
cmd_meta Kerbi::Consts::CommandSchemas::LIST_STATE
|
5
5
|
def list(release_name)
|
6
6
|
prep_opts(Kerbi::Consts::OptionDefaults::LIST_STATE)
|
7
|
-
|
7
|
+
mem_dna(release_name)
|
8
8
|
echo_data(
|
9
9
|
state_backend.entries,
|
10
10
|
table_serializer: Kerbi::Cli::EntryRowSerializer,
|
@@ -16,7 +16,7 @@ module Kerbi
|
|
16
16
|
# @param [String] tag_expr e.g 1.9.1, @latest
|
17
17
|
def show(release_name, tag_expr)
|
18
18
|
prep_opts(Kerbi::Consts::OptionDefaults::LIST_STATE)
|
19
|
-
|
19
|
+
mem_dna(release_name)
|
20
20
|
entry = find_readable_entry(tag_expr)
|
21
21
|
echo_data(
|
22
22
|
entry,
|
@@ -29,7 +29,7 @@ module Kerbi
|
|
29
29
|
# @param [String] old_tag_expr e.g 1.9.1, @latest
|
30
30
|
# @param [String] new_tag_expr e.g 1.9.1, @latest
|
31
31
|
def retag(release_name, old_tag_expr, new_tag_expr)
|
32
|
-
|
32
|
+
mem_dna(release_name)
|
33
33
|
entry = find_readable_entry(old_tag_expr)
|
34
34
|
old_tag = entry.retag(new_tag_expr)
|
35
35
|
touch_and_save_entry(entry, tag: old_tag)
|
@@ -38,7 +38,7 @@ module Kerbi
|
|
38
38
|
cmd_meta Kerbi::Consts::CommandSchemas::PROMOTE_STATE
|
39
39
|
# @param [String] tag_expr e.g 1.9.1, @latest
|
40
40
|
def promote(release_name, tag_expr)
|
41
|
-
|
41
|
+
mem_dna(release_name)
|
42
42
|
entry = find_readable_entry(tag_expr)
|
43
43
|
old_name = entry.promote
|
44
44
|
touch_and_save_entry(entry, tag: old_name)
|
@@ -47,7 +47,7 @@ module Kerbi
|
|
47
47
|
cmd_meta Kerbi::Consts::CommandSchemas::DEMOTE_STATE
|
48
48
|
# @param [String] tag_expr e.g 1.9.1, @latest
|
49
49
|
def demote(release_name, tag_expr)
|
50
|
-
|
50
|
+
mem_dna(release_name)
|
51
51
|
entry = find_readable_entry(tag_expr)
|
52
52
|
old_name = entry.demote
|
53
53
|
touch_and_save_entry(entry, tag: old_name)
|
@@ -58,7 +58,7 @@ module Kerbi
|
|
58
58
|
# @param [String] attr_name e.g message
|
59
59
|
# @param [String] new_value e.g i am a new message
|
60
60
|
def set(release_name, tag_expr, attr_name, new_value)
|
61
|
-
|
61
|
+
mem_dna(release_name)
|
62
62
|
entry = find_readable_entry(tag_expr)
|
63
63
|
old_value = entry.assign_attr(attr_name, new_value)
|
64
64
|
touch_and_save_entry(entry, attr_name => old_value)
|
@@ -67,7 +67,7 @@ module Kerbi
|
|
67
67
|
cmd_meta Kerbi::Consts::CommandSchemas::DELETE_STATE
|
68
68
|
# @param [String] tag_expr e.g 1.9.1, @latest
|
69
69
|
def delete(release_name, tag_expr)
|
70
|
-
|
70
|
+
mem_dna(release_name)
|
71
71
|
entry = find_readable_entry(tag_expr)
|
72
72
|
state_backend.delete_entry(entry)
|
73
73
|
new_count = state_backend.entries.count
|
@@ -76,7 +76,7 @@ module Kerbi
|
|
76
76
|
|
77
77
|
cmd_meta Kerbi::Consts::CommandSchemas::PRUNE_CANDIDATES_STATE
|
78
78
|
def prune_candidates(release_name)
|
79
|
-
|
79
|
+
mem_dna(release_name)
|
80
80
|
old_count = entry_set.entries.count
|
81
81
|
entry_set.prune_candidates
|
82
82
|
state_backend.save
|
data/lib/cli/values_handler.rb
CHANGED
data/lib/config/cli_schema.rb
CHANGED
@@ -3,6 +3,8 @@ module Kerbi
|
|
3
3
|
|
4
4
|
module OptionKeys
|
5
5
|
PROJECT_ROOT = "project-root"
|
6
|
+
REVISION_TAG = "revision"
|
7
|
+
RELEASE_NAME = "release-name"
|
6
8
|
|
7
9
|
OUTPUT_FMT = "output-format"
|
8
10
|
INLINE_ASSIGNMENT = "inline-value"
|
@@ -66,22 +68,30 @@ module Kerbi
|
|
66
68
|
aliases: "-p"
|
67
69
|
}
|
68
70
|
|
71
|
+
REVISION_TAG = {
|
72
|
+
key: OptionKeys::REVISION_TAG,
|
73
|
+
desc: "Use this version of the Kerbi templating "\
|
74
|
+
"engine (given by [PROJECT_URI]).",
|
75
|
+
aliases: "-p"
|
76
|
+
}
|
77
|
+
|
69
78
|
K8S_AUTH_TYPE = {
|
70
79
|
key: OptionKeys::K8S_AUTH_TYPE,
|
71
|
-
desc: "
|
72
|
-
"
|
73
|
-
enum: %w[kube-config in-cluster
|
80
|
+
desc: "Kubernetes cluster authentication type. Uses " \
|
81
|
+
"kube-config if unspecified.",
|
82
|
+
enum: %w[kube-config in-cluster token]
|
74
83
|
}.freeze
|
75
84
|
|
76
85
|
KUBE_CONFIG_PATH = {
|
77
86
|
key: OptionKeys::KUBE_CONFIG_PATH,
|
78
|
-
desc: "
|
87
|
+
desc: "Path to your kube-config file. Uses " \
|
88
|
+
"~/.kube/config if unspecified."
|
79
89
|
}.freeze
|
80
90
|
|
81
91
|
KUBE_CONFIG_CONTEXT = {
|
82
92
|
key: OptionKeys::KUBE_CONFIG_CONTEXT,
|
83
|
-
desc: "
|
84
|
-
|
93
|
+
desc: "Context to use in your kube config. "\
|
94
|
+
"Uses current context if unspecified."
|
85
95
|
}.freeze
|
86
96
|
|
87
97
|
K8S_USERNAME = {
|
@@ -96,7 +106,7 @@ defaults to $(kubectl config current-context)"
|
|
96
106
|
|
97
107
|
LOAD_DEFAULT_VALUES = {
|
98
108
|
key: OptionKeys::LOAD_DEFAULT_VALUES,
|
99
|
-
desc: "
|
109
|
+
desc: "Whether or not to automatically load values.yaml.",
|
100
110
|
type: "boolean",
|
101
111
|
default: true
|
102
112
|
}.freeze
|
@@ -106,31 +116,35 @@ defaults to $(kubectl config current-context)"
|
|
106
116
|
desc: "Kubernetes auth bearer token for token auth"
|
107
117
|
}.freeze
|
108
118
|
|
119
|
+
RELEASE_NAME = {
|
120
|
+
key: OptionKeys::RELEASE_NAME,
|
121
|
+
desc: "Release name for commands where state I/O is optional"
|
122
|
+
}
|
123
|
+
|
109
124
|
STATE_BACKEND_TYPE = {
|
110
125
|
key: OptionKeys::STATE_BACKEND_TYPE,
|
111
|
-
desc: "
|
112
|
-
"values (configmap, secret)",
|
126
|
+
desc: "Type of persistent store to read/write this release's state.",
|
113
127
|
enum: %w[configmap secret]
|
114
128
|
}.freeze
|
115
129
|
|
116
130
|
OUTPUT_FMT = {
|
117
131
|
key: OptionKeys::OUTPUT_FMT,
|
118
132
|
aliases: "-o",
|
119
|
-
desc: "
|
133
|
+
desc: "In what format resulting data should be printed",
|
120
134
|
enum: %w[yaml json table]
|
121
135
|
}.freeze
|
122
136
|
|
123
137
|
INLINE_ASSIGNMENT = {
|
124
138
|
key: OptionKeys::INLINE_ASSIGNMENT,
|
125
139
|
aliases: "--set",
|
126
|
-
desc: "
|
127
|
-
"--set x.
|
140
|
+
desc: "Merge value from this assignment, "\
|
141
|
+
"e.g --set x.y=foo. Multiple --set are allowed.",
|
128
142
|
repeatable: true
|
129
143
|
}.freeze
|
130
144
|
|
131
145
|
READ_STATE = {
|
132
146
|
key: OptionKeys::READ_STATE,
|
133
|
-
desc: "Merge values from
|
147
|
+
desc: "Merge values from state with this tag.",
|
134
148
|
}.freeze
|
135
149
|
|
136
150
|
STRICT_READ_STATE = {
|
@@ -141,38 +155,41 @@ defaults to $(kubectl config current-context)"
|
|
141
155
|
|
142
156
|
WRITE_STATE = {
|
143
157
|
key: OptionKeys::WRITE_STATE,
|
144
|
-
desc: "
|
158
|
+
desc: "Write compiled values into new or existing state record" \
|
159
|
+
"with this tag."
|
145
160
|
}.freeze
|
146
161
|
|
147
162
|
NAMESPACE = {
|
148
163
|
key: OptionKeys::NAMESPACE,
|
149
164
|
aliases: "-n",
|
150
|
-
desc: "
|
151
|
-
|
165
|
+
desc: "Use this Kubernetes namespace instead of [RELEASE_NAME] "\
|
166
|
+
"for state I/O."
|
152
167
|
}.freeze
|
153
168
|
|
154
169
|
VALUE_FNAMES = {
|
155
170
|
key: OptionKeys::VALUE_FNAMES,
|
156
171
|
aliases: "-f",
|
157
|
-
desc: "
|
172
|
+
desc: "Merge all values read from this file. Multiple " \
|
173
|
+
"-f are allowed.",
|
158
174
|
repeatable: true
|
159
175
|
}.freeze
|
160
176
|
|
161
177
|
RUBY_VER = {
|
162
178
|
key: OptionKeys::RUBY_VER,
|
163
|
-
desc: "
|
179
|
+
desc: "Ruby version semver for autogenerated " \
|
180
|
+
"Gemfile."
|
164
181
|
}.freeze
|
165
182
|
|
166
183
|
VERBOSE = {
|
167
184
|
key: OptionKeys::VERBOSE,
|
168
185
|
desc: "Run in verbose mode",
|
169
|
-
|
186
|
+
type: "boolean"
|
170
187
|
}.freeze
|
171
188
|
|
172
189
|
PRE_CONFIRM = {
|
173
190
|
key: OptionKeys::PRE_CONFIRM,
|
174
|
-
desc: "Skip CLI confirmation",
|
175
|
-
|
191
|
+
desc: "Skip any CLI confirmation prompts",
|
192
|
+
type: "boolean"
|
176
193
|
}.freeze
|
177
194
|
|
178
195
|
KUBERNETES_OPTIONS = [
|
@@ -196,32 +213,32 @@ defaults to $(kubectl config current-context)"
|
|
196
213
|
|
197
214
|
VALUES_SUPER = {
|
198
215
|
name: "values",
|
199
|
-
desc: "Command group for values actions
|
216
|
+
desc: "Command group for values actions (see $ kerbi values help)"
|
200
217
|
}.freeze
|
201
218
|
|
202
219
|
PROJECT_SUPER = {
|
203
220
|
name: "project",
|
204
|
-
desc: "Command group for project actions
|
221
|
+
desc: "Command group for project actions (see $ kerbi project help)"
|
205
222
|
}.freeze
|
206
223
|
|
207
224
|
STATE_SUPER = {
|
208
225
|
name: "state",
|
209
|
-
desc: "Command group for state actions"
|
226
|
+
desc: "Command group for state actions (see $ kerbi state help)"
|
210
227
|
}.freeze
|
211
228
|
|
212
229
|
RELEASE_SUPER = {
|
213
230
|
name: "release",
|
214
|
-
desc: "Command group for release actions"
|
231
|
+
desc: "Command group for release actions (see $ kerbi release help)"
|
215
232
|
}.freeze
|
216
233
|
|
217
234
|
CONFIG_SUPER = {
|
218
235
|
name: "config",
|
219
|
-
desc: "Command group for config actions
|
236
|
+
desc: "Command group for config actions (see $ kerbi config help)"
|
220
237
|
}.freeze
|
221
238
|
|
222
239
|
TEMPLATE = {
|
223
|
-
name: "template [
|
224
|
-
desc: "
|
240
|
+
name: "template [RELEASE_NAME] [PROJECT_URI]",
|
241
|
+
desc: "Templates to YAML/JSON, using [RELEASE_NAME] for state I/O",
|
225
242
|
options: [
|
226
243
|
OptionSchemas::PROJECT_ROOT,
|
227
244
|
OptionSchemas::OUTPUT_FMT,
|
@@ -257,8 +274,7 @@ defaults to $(kubectl config current-context)"
|
|
257
274
|
|
258
275
|
RELEASE_STATUS = {
|
259
276
|
name: "status [RELEASE_NAME]",
|
260
|
-
desc: "
|
261
|
-
"state-tracking backend.",
|
277
|
+
desc: "Check readiness of release's ConfigMap/Secret backend.",
|
262
278
|
options: [
|
263
279
|
*OptionSchemas::KUBERNETES_OPTIONS,
|
264
280
|
OptionSchemas::VERBOSE
|
@@ -371,16 +387,16 @@ defaults to $(kubectl config current-context)"
|
|
371
387
|
|
372
388
|
SHOW_VERSION = {
|
373
389
|
name: "version",
|
374
|
-
desc: "Print kerbi version",
|
390
|
+
desc: "Print the kerbi gem's version.",
|
375
391
|
options: []
|
376
392
|
}.freeze
|
377
393
|
|
378
394
|
SHOW_VALUES = {
|
379
395
|
name: "show",
|
380
|
-
desc: "
|
396
|
+
desc: "Prints the final compiled values for the given sources",
|
381
397
|
options: [
|
382
|
-
OptionSchemas::PROJECT_ROOT,
|
383
398
|
OptionSchemas::OUTPUT_FMT,
|
399
|
+
OptionSchemas::PROJECT_ROOT,
|
384
400
|
*OptionSchemas::VALUES_OPTIONS,
|
385
401
|
*OptionSchemas::KUBERNETES_OPTIONS
|
386
402
|
]
|
data/lib/config/config_file.rb
CHANGED
@@ -3,7 +3,7 @@ module Kerbi
|
|
3
3
|
module ConfigFile
|
4
4
|
|
5
5
|
DIR_NAME = ".kerbi"
|
6
|
-
FILE_NAME = "config.
|
6
|
+
FILE_NAME = "config.json"
|
7
7
|
|
8
8
|
def self.file_path
|
9
9
|
"#{Dir.home}/#{DIR_NAME}/#{FILE_NAME}"
|
@@ -26,10 +26,11 @@ module Kerbi
|
|
26
26
|
def self.read
|
27
27
|
begin
|
28
28
|
create_file_if_missing
|
29
|
-
contents =
|
30
|
-
|
29
|
+
contents = File.read(file_path)
|
30
|
+
dict = JSON.parse(contents)
|
31
|
+
dict.slice(*legal_keys)
|
31
32
|
rescue StandardError => e
|
32
|
-
puts "[WARN] failed to read config #{file_path} (#{e})"
|
33
|
+
$stderr.puts "[WARN] failed to read config #{file_path} (#{e})"
|
33
34
|
{}
|
34
35
|
end
|
35
36
|
end
|
@@ -38,7 +39,7 @@ module Kerbi
|
|
38
39
|
def self.write(config, skip_check: false)
|
39
40
|
create_file_if_missing unless skip_check
|
40
41
|
config = config.deep_dup.stringify_keys.slice(*legal_keys)
|
41
|
-
File.write(file_path,
|
42
|
+
File.write(file_path, JSON.dump(config))
|
42
43
|
end
|
43
44
|
|
44
45
|
# @param [Hash] config
|
data/lib/config/globals.rb
CHANGED
data/lib/config/run_opts.rb
CHANGED
@@ -8,6 +8,7 @@ module Kerbi
|
|
8
8
|
|
9
9
|
attr_reader :options
|
10
10
|
attr_accessor :release_name
|
11
|
+
attr_accessor :project_uri
|
11
12
|
|
12
13
|
# @param [Hash{Symbol, Object}] cli_opts CLI args as a hash via Thor
|
13
14
|
# @param [Hash{Symbol, Object}] defaults contextual defaults (per cmd)
|
@@ -90,11 +91,6 @@ module Kerbi
|
|
90
91
|
write_state_to.present?
|
91
92
|
end
|
92
93
|
|
93
|
-
# @return [String]
|
94
|
-
def k8s_auth_type
|
95
|
-
options[consts::K8S_AUTH_TYPE]
|
96
|
-
end
|
97
|
-
|
98
94
|
# @return [String]
|
99
95
|
def kube_config_path
|
100
96
|
options[consts::KUBE_CONFIG_PATH]
|
@@ -138,12 +134,30 @@ module Kerbi
|
|
138
134
|
|
139
135
|
# @return [String]
|
140
136
|
def project_root
|
141
|
-
options[consts::PROJECT_ROOT].presence
|
137
|
+
options[consts::PROJECT_ROOT].presence || project_uri
|
138
|
+
end
|
139
|
+
|
140
|
+
# @return [?String]
|
141
|
+
def revision_tag
|
142
|
+
options[consts::REVISION_TAG].presence
|
143
|
+
end
|
144
|
+
|
145
|
+
def remote_engine?
|
146
|
+
revision_tag.present?
|
147
|
+
end
|
148
|
+
|
149
|
+
def local_engine?
|
150
|
+
!remote_engine?
|
151
|
+
end
|
152
|
+
|
153
|
+
# @return [String]
|
154
|
+
def k8s_auth_type
|
155
|
+
options[consts::K8S_AUTH_TYPE]
|
142
156
|
end
|
143
157
|
|
144
158
|
# @return [TrueClass, FalseClass]
|
145
159
|
def in_cluster?
|
146
|
-
|
160
|
+
k8s_auth_type == 'in-cluster'
|
147
161
|
end
|
148
162
|
|
149
163
|
# @return [TrueClass, FalseClass]
|
data/lib/kerbi.rb
CHANGED
@@ -58,6 +58,8 @@ require_relative './state/base_backend'
|
|
58
58
|
require_relative './state/mixers'
|
59
59
|
require_relative './state/config_map_backend'
|
60
60
|
|
61
|
+
require_relative './revision/fetcher'
|
62
|
+
|
61
63
|
require_relative './main/errors'
|
62
64
|
require_relative './cli/base_handler'
|
63
65
|
require_relative './cli/config_handler'
|
data/lib/main/mixer.rb
CHANGED
@@ -113,7 +113,7 @@ module Kerbi
|
|
113
113
|
# @param [String] chart_id using format 'jetstack/cert-manager'
|
114
114
|
# @param [Hash] opts filtering and other options for #dicts
|
115
115
|
# @return [Array<Hash>] processed and filtered dicts
|
116
|
-
def
|
116
|
+
def helm_chart(chart_id, **opts)
|
117
117
|
release = opts[:release] || release_name
|
118
118
|
helm_output = Utils::Helm.template(release, chart_id, **opts)
|
119
119
|
dicts(helm_output)
|
@@ -137,7 +137,7 @@ module Kerbi
|
|
137
137
|
end
|
138
138
|
|
139
139
|
##
|
140
|
-
# Any x-to-dict statements (e.g #dicts, #dir, #
|
140
|
+
# Any x-to-dict statements (e.g #dicts, #dir, #helm_chart) executed
|
141
141
|
# in the &block passed to this method will have their return values
|
142
142
|
# deep merged with the dict(s) passed.
|
143
143
|
# @param [Array<Hash>|Hash] dict
|
@@ -13,16 +13,19 @@ module Kerbi
|
|
13
13
|
CANDIDATE_WORD = "candidate"
|
14
14
|
NEW_CANDIDATE_WORD = "new-candidate"
|
15
15
|
LATEST_WORD = "latest"
|
16
|
+
LATEST_PLUS_WORD = "latest+\\."
|
16
17
|
OLDEST_WORD = "oldest"
|
17
18
|
RANDOM_WORD = "random"
|
18
19
|
|
19
20
|
SPECIAL_READ_WORDS = [
|
20
21
|
CANDIDATE_WORD,
|
22
|
+
LATEST_PLUS_WORD,
|
21
23
|
LATEST_WORD,
|
22
24
|
OLDEST_WORD
|
23
25
|
]
|
24
26
|
|
25
27
|
SPECIAL_WRITE_WORDS = [
|
28
|
+
LATEST_PLUS_WORD,
|
26
29
|
LATEST_WORD,
|
27
30
|
OLDEST_WORD,
|
28
31
|
CANDIDATE_WORD,
|
data/lib/state/base_backend.rb
CHANGED
@@ -2,6 +2,14 @@ module Kerbi
|
|
2
2
|
module State
|
3
3
|
class BaseBackend
|
4
4
|
|
5
|
+
##
|
6
|
+
# Made available to states, as a convenience
|
7
|
+
# @return [String] release name
|
8
|
+
attr_reader :release_name
|
9
|
+
|
10
|
+
##
|
11
|
+
# Whether the last connection attempt succeeded or failed
|
12
|
+
# @return [TrueClass|FalseClass] list of hashes
|
5
13
|
attr_reader :is_working
|
6
14
|
|
7
15
|
def initialize(options={})
|
@@ -9,7 +17,10 @@ module Kerbi
|
|
9
17
|
|
10
18
|
# @return [Kerbi::State::EntrySet]
|
11
19
|
def entry_set
|
12
|
-
@_entry_set ||= EntrySet.new(
|
20
|
+
@_entry_set ||= EntrySet.new(
|
21
|
+
read_entries,
|
22
|
+
release_name: release_name
|
23
|
+
)
|
13
24
|
end
|
14
25
|
|
15
26
|
# @return [Array<Kerbi::State::Entry>]
|
@@ -8,8 +8,14 @@ module Kerbi
|
|
8
8
|
class ConfigMapBackend < Kerbi::State::BaseBackend
|
9
9
|
include Kerbi::Mixins::CmBackendTesting
|
10
10
|
|
11
|
+
##
|
12
|
+
# Credentials generated by Utils::K8sAuth to use for auth
|
13
|
+
# @return [Hash] list of hashes
|
11
14
|
attr_reader :auth_bundle
|
12
|
-
|
15
|
+
|
16
|
+
##
|
17
|
+
# Kubernetes namespace where configmap lives
|
18
|
+
# @return [String] namespace
|
13
19
|
attr_reader :namespace
|
14
20
|
|
15
21
|
# @param [Hash] auth_bundle generated by Kerbi::Utils::K8sAuth
|
data/lib/state/entry.rb
CHANGED
@@ -5,19 +5,61 @@ module Kerbi
|
|
5
5
|
# Represents a single Kerbi state entry.
|
6
6
|
class Entry
|
7
7
|
|
8
|
+
##
|
9
|
+
# Tag prefix that identifies candidate states
|
10
|
+
# @return [String]
|
8
11
|
CANDIDATE_PREFIX = "[cand]-"
|
9
12
|
|
10
|
-
|
13
|
+
##
|
14
|
+
# Array of record attribute names in symbol form
|
15
|
+
# @return [Array<Symbol>]
|
16
|
+
ATTRS = %i[tag revision message values default_values created_at]
|
17
|
+
|
18
|
+
##
|
19
|
+
# Subset of attribute names (symbol form) that
|
20
|
+
# the user can mass update (i.e Rails' attr_accessible)
|
11
21
|
SETTABLE_ATTRS = %i[message created_at]
|
12
22
|
|
23
|
+
##
|
24
|
+
# Parent collection. Necessary for computation that involve
|
25
|
+
# comparision.
|
26
|
+
# @return [Array<Kerbi::State::EntrySet>]
|
13
27
|
attr_accessor :set
|
14
28
|
|
29
|
+
##
|
30
|
+
# Human readable string that identifies this state
|
31
|
+
# @return [String]
|
15
32
|
attr_accessor :tag
|
33
|
+
|
34
|
+
##
|
35
|
+
# SemVer of chart/mixer, for user info purposes only
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :revision
|
38
|
+
|
39
|
+
##
|
40
|
+
# Message for/by user, for user info purposes only
|
41
|
+
# @return [String]
|
16
42
|
attr_accessor :message
|
43
|
+
|
44
|
+
##
|
45
|
+
# The default values computed at templating time
|
46
|
+
# @return [Hash]
|
17
47
|
attr_accessor :default_values
|
48
|
+
|
49
|
+
##
|
50
|
+
# The final values computed at templating time
|
51
|
+
# @return [Hash]
|
18
52
|
attr_accessor :values
|
53
|
+
|
54
|
+
##
|
55
|
+
# The default values computed at templating time
|
56
|
+
# @return [Time]
|
19
57
|
attr_accessor :created_at
|
20
58
|
|
59
|
+
##
|
60
|
+
# List of errors, encoded in a simple struct, picked
|
61
|
+
# up during a validation run
|
62
|
+
# @return [Array<Hash>]
|
21
63
|
attr_reader :validation_errors
|
22
64
|
|
23
65
|
def initialize(set, dict)
|
@@ -136,6 +178,10 @@ module Kerbi
|
|
136
178
|
(delta = overrides_delta) ? delta.keys.map(&:to_s) : []
|
137
179
|
end
|
138
180
|
|
181
|
+
##
|
182
|
+
# Serializes the instance's recordable attributes to
|
183
|
+
# a string-keyed Hash
|
184
|
+
# @return Hash
|
139
185
|
def to_h
|
140
186
|
special_ser = {
|
141
187
|
values: values || {},
|
@@ -146,11 +192,18 @@ module Kerbi
|
|
146
192
|
end
|
147
193
|
alias_method :serialize, :to_h
|
148
194
|
|
195
|
+
##
|
196
|
+
# Serializes the instance's recordable attributes to a
|
197
|
+
# JSON string
|
198
|
+
# @return [String]
|
149
199
|
def to_json
|
150
200
|
JSON.dump(serialize)
|
151
201
|
end
|
152
202
|
|
153
|
-
|
203
|
+
##
|
204
|
+
# Deserializes a record in dict-form and returns the
|
205
|
+
# corresponding Entry instance.
|
206
|
+
# @param [Hash] serialized record
|
154
207
|
# @return [Kerbi::State::Entry]
|
155
208
|
def self.from_dict(set, dict={})
|
156
209
|
dict.deep_symbolize_keys!
|
data/lib/state/entry_set.rb
CHANGED
@@ -9,14 +9,27 @@ module Kerbi
|
|
9
9
|
|
10
10
|
include Kerbi::Mixins::EntryTagLogic
|
11
11
|
|
12
|
+
##
|
13
|
+
# Memoized list of state entries
|
14
|
+
# @return [Array<Kerbi::State::Entry>]
|
12
15
|
attr_reader :entries
|
13
16
|
|
17
|
+
##
|
18
|
+
# Made available to states, as a convenience
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :release_name
|
21
|
+
|
14
22
|
# @param [Array<Hash>] dicts
|
15
|
-
def initialize(dicts)
|
23
|
+
def initialize(dicts, **opts)
|
16
24
|
@entries = dicts.map { |h| Entry.from_dict(self, h) }
|
25
|
+
@release_name = opts[:release_name]
|
17
26
|
sort_by_created_at
|
18
27
|
end
|
19
28
|
|
29
|
+
##
|
30
|
+
# Performs simple validation logic, checking if each
|
31
|
+
# state is valid, doing noting if all are valid,
|
32
|
+
# and raising an exception otherwise.
|
20
33
|
def validate!
|
21
34
|
entries.each(&:validate)
|
22
35
|
if (bad_entries = entries.reject(&:valid?)).any?
|
@@ -32,7 +45,7 @@ module Kerbi
|
|
32
45
|
# ones that are NOT candidates.
|
33
46
|
# @return [Array<Kerbi::State::Entry>]
|
34
47
|
def committed
|
35
|
-
entries.select(&:committed?)
|
48
|
+
entries.select(&:committed?).to_a
|
36
49
|
end
|
37
50
|
|
38
51
|
##
|
@@ -40,7 +53,7 @@ module Kerbi
|
|
40
53
|
# ones that ARE candidates.
|
41
54
|
# @return [Array<Kerbi::State::Entry>]
|
42
55
|
def candidates
|
43
|
-
entries.reject(&:committed?)
|
56
|
+
entries.reject(&:committed?).to_a
|
44
57
|
end
|
45
58
|
|
46
59
|
##
|
@@ -121,11 +134,15 @@ module Kerbi
|
|
121
134
|
end
|
122
135
|
alias_method :get, :find_by_literal_tag
|
123
136
|
|
124
|
-
|
137
|
+
##
|
138
|
+
# Updates internal list of state entries to itself minus
|
139
|
+
# states marked as candidates. Does NOT save to backend.
|
125
140
|
def prune_candidates
|
126
|
-
entries.
|
141
|
+
entries.reject!(&:candidate?)
|
127
142
|
end
|
128
143
|
|
144
|
+
##
|
145
|
+
# Sorts internal list of candidates by age.
|
129
146
|
def sort_by_created_at
|
130
147
|
entries.sort! do |a, b|
|
131
148
|
both_defined = a.created_at && b.created_at
|
data/lib/utils/cli.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
module Kerbi
|
2
2
|
module Utils
|
3
|
+
|
4
|
+
##
|
5
|
+
# Mechanical work for all things CLI that does not deserve
|
6
|
+
# to be in the CLI helper mixin.
|
3
7
|
module Cli
|
4
8
|
##
|
5
9
|
# Convenience method for running and compiling the output
|
@@ -137,13 +141,18 @@ module Kerbi
|
|
137
141
|
end
|
138
142
|
end
|
139
143
|
|
144
|
+
def resolve_remote_engine_url
|
145
|
+
""
|
146
|
+
end
|
147
|
+
|
140
148
|
LIST_TABLE_STYLE = {
|
141
149
|
border_left: false,
|
142
150
|
border_right: false,
|
143
151
|
border_top: false,
|
144
152
|
border_x: "",
|
145
153
|
border_y: "",
|
146
|
-
border_i:
|
154
|
+
border_i: '',
|
155
|
+
padding_left: 0,
|
147
156
|
}.freeze
|
148
157
|
|
149
158
|
DESCRIBE_TABLE_STYLE = {
|
@@ -19,7 +19,7 @@ RSpec.describe "$ kerbi [COMMAND]" do
|
|
19
19
|
spec_bundles.each do |bundle|
|
20
20
|
context "with #{bundle[0].presence || "no args"}" do
|
21
21
|
it "echos the expected text" do
|
22
|
-
cmd = hello_kerbi("template foo #{bundle[0]}")
|
22
|
+
cmd = hello_kerbi("template foo . #{bundle[0]}")
|
23
23
|
exp_cli_eq_file(cmd, "root", bundle[1], "yaml")
|
24
24
|
end
|
25
25
|
end
|
@@ -42,7 +42,7 @@ RSpec.describe "$ kerbi [COMMAND]" do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def template_write_cmd(pod_image)
|
45
|
-
base_cmd = "template #{release_name} " \
|
45
|
+
base_cmd = "template #{release_name} . " \
|
46
46
|
"--set pod.image=#{pod_image}" \
|
47
47
|
" --write-state foo"
|
48
48
|
hello_kerbi(base_cmd)
|
@@ -82,14 +82,17 @@ RSpec.describe "$ kerbi [COMMAND]" do
|
|
82
82
|
|
83
83
|
context "without inline overrides" do
|
84
84
|
it "echos the expected text" do
|
85
|
-
|
85
|
+
base = "template #{release_name} . --read-state foo"
|
86
|
+
cmd = hello_kerbi(base)
|
86
87
|
exp_cli_eq_file(cmd, "root", "template-read", "yaml")
|
87
88
|
end
|
88
89
|
end
|
89
90
|
|
90
91
|
context "with inline overrides" do
|
91
92
|
it "echos the expected text, preferring the inline over the state" do
|
92
|
-
base = "template #{release_name}
|
93
|
+
base = "template #{release_name} . " \
|
94
|
+
"--read-state foo " \
|
95
|
+
"--set pod.image=busybox"
|
93
96
|
cmd = hello_kerbi(base)
|
94
97
|
exp_cli_eq_file(cmd, "root", "template-read-inlines", "yaml")
|
95
98
|
end
|
@@ -28,7 +28,7 @@ RSpec.describe "$ kerbi state [COMMAND]" do
|
|
28
28
|
cmd_group_spec("state list kerbi-spec", "state", "list")
|
29
29
|
end
|
30
30
|
|
31
|
-
describe "$ kerbi state show [TAG]" do
|
31
|
+
describe "$ kerbi state show [RELEASE_NAME] [TAG]" do
|
32
32
|
cmd_group_spec(
|
33
33
|
"state show kerbi-spec one",
|
34
34
|
"state",
|
@@ -39,7 +39,7 @@ RSpec.describe "$ kerbi state [COMMAND]" do
|
|
39
39
|
"state show kerbi-spec @oldest",
|
40
40
|
"state",
|
41
41
|
"show",
|
42
|
-
context_append: "
|
42
|
+
context_append: "using @oldest instead of a literal tag"
|
43
43
|
)
|
44
44
|
end
|
45
45
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
TAG
|
1
|
+
TAG REVISION MESSAGE ASSIGNMENTS OVERRIDES CREATED_AT
|
2
2
|
|
3
|
-
\e[0;33;49m[cand]-four\e[0m
|
4
|
-
\e[0;33;49m[cand]-three\e[0m
|
5
|
-
\e[0;34;49mtwo\e[0m
|
6
|
-
\e[0;34;49mone\e[0m
|
3
|
+
\e[0;33;49m[cand]-four\e[0m 0 0 2003-01-01 00:00:00 +0000
|
4
|
+
\e[0;33;49m[cand]-three\e[0m 0 0 2002-01-01 00:00:00 +0000
|
5
|
+
\e[0;34;49mtwo\e[0m message 0 0 2001-01-01 00:00:00 +0000
|
6
|
+
\e[0;34;49mone\e[0m 1 1 2000-01-01 00:00:00 +0000
|
@@ -1,5 +1,9 @@
|
|
1
1
|
--------------------------------------------
|
2
2
|
\e[1;39;49mTAG\e[0m \e[1;34;49mone\e[0m
|
3
|
+
--------------------------------------------
|
4
|
+
\e[1;39;49mRELEASE\e[0m kerbi-spec
|
5
|
+
--------------------------------------------
|
6
|
+
\e[1;39;49mREVISION\e[0m
|
3
7
|
--------------------------------------------
|
4
8
|
\e[1;39;49mMESSAGE\e[0m
|
5
9
|
--------------------------------------------
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -66,6 +66,7 @@ end
|
|
66
66
|
def corrupt_cm(backend)
|
67
67
|
cm_body = backend.template_resource([])
|
68
68
|
cm_body[:data][:entries] = "not json"
|
69
|
+
#noinspection RubyResolve
|
69
70
|
backend.send(:client).update_config_map(cm_body)
|
70
71
|
end
|
71
72
|
|
@@ -130,7 +131,7 @@ def exp_cli_eq_file(cmd, dir, file, ext='txt')
|
|
130
131
|
end
|
131
132
|
|
132
133
|
def hello_kerbi(cmd, namespace=nil)
|
133
|
-
target = "#{__dir__}/mini-projects/hello-kerbi"
|
134
|
+
target = "#{__dir__}/fixtures/mini-projects/hello-kerbi"
|
134
135
|
cmd = "#{cmd} --project-root #{target}"
|
135
136
|
cmd = "#{cmd} --namespace #{namespace}" if namespace
|
136
137
|
cmd
|
@@ -142,6 +143,7 @@ def cmd_group_spec(cmd, dir, file, opts={})
|
|
142
143
|
it "echos the expected text" do
|
143
144
|
extension = format == 'table' ? "txt" : format
|
144
145
|
cmd_with_fmt = "#{cmd} -o #{format}"
|
146
|
+
# puts cli(cmd_with_fmt, escaped: true)
|
145
147
|
exp_cli_eq_file(cmd_with_fmt, dir, file, extension)
|
146
148
|
end
|
147
149
|
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.10
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/mixins/cm_backend_testing.rb
|
145
145
|
- lib/mixins/entry_tag_logic.rb
|
146
146
|
- lib/mixins/mixer.rb
|
147
|
+
- lib/revision/fetcher.rb
|
147
148
|
- lib/state/base_backend.rb
|
148
149
|
- lib/state/config_map_backend.rb
|
149
150
|
- lib/state/entry.rb
|
@@ -194,19 +195,19 @@ files:
|
|
194
195
|
- spec/fixtures/expectations/state/show.txt
|
195
196
|
- spec/fixtures/expectations/state/show.yaml
|
196
197
|
- spec/fixtures/expectations/values/order-of-precedence.yaml
|
198
|
+
- spec/fixtures/mini-projects/hello-kerbi/common/metadata.yaml.erb
|
199
|
+
- spec/fixtures/mini-projects/hello-kerbi/consts.rb
|
200
|
+
- spec/fixtures/mini-projects/hello-kerbi/helpers.rb
|
201
|
+
- spec/fixtures/mini-projects/hello-kerbi/kerbifile.rb
|
202
|
+
- spec/fixtures/mini-projects/hello-kerbi/pod-and-service.yaml.erb
|
203
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/production.yaml
|
204
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/v2.yaml
|
205
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/values.yaml
|
197
206
|
- spec/main/configmap_backend_spec.rb
|
198
207
|
- spec/main/mixer_spec.rb
|
199
208
|
- spec/main/project_code_gen_spec.rb
|
200
209
|
- spec/main/state_entry_set_spec.rb
|
201
210
|
- spec/main/state_entry_spec.rb
|
202
|
-
- spec/mini-projects/hello-kerbi/common/metadata.yaml.erb
|
203
|
-
- spec/mini-projects/hello-kerbi/consts.rb
|
204
|
-
- spec/mini-projects/hello-kerbi/helpers.rb
|
205
|
-
- spec/mini-projects/hello-kerbi/kerbifile.rb
|
206
|
-
- spec/mini-projects/hello-kerbi/pod-and-service.yaml.erb
|
207
|
-
- spec/mini-projects/hello-kerbi/values/production.yaml
|
208
|
-
- spec/mini-projects/hello-kerbi/values/v2.yaml
|
209
|
-
- spec/mini-projects/hello-kerbi/values/values.yaml
|
210
211
|
- spec/mixins/mixer_mixin_spec.rb
|
211
212
|
- spec/spec_helper.rb
|
212
213
|
- spec/utils/helm_spec.rb
|
@@ -238,60 +239,60 @@ signing_key:
|
|
238
239
|
specification_version: 4
|
239
240
|
summary: Multi-strategy Kubernetes manifest templating engine.
|
240
241
|
test_files:
|
241
|
-
- spec/mini-projects/hello-kerbi/common/metadata.yaml.erb
|
242
|
-
- spec/mini-projects/hello-kerbi/consts.rb
|
243
|
-
- spec/mini-projects/hello-kerbi/pod-and-service.yaml.erb
|
244
|
-
- spec/mini-projects/hello-kerbi/values/values.yaml
|
245
|
-
- spec/mini-projects/hello-kerbi/values/v2.yaml
|
246
|
-
- spec/mini-projects/hello-kerbi/values/production.yaml
|
247
|
-
- spec/mini-projects/hello-kerbi/helpers.rb
|
248
|
-
- spec/mini-projects/hello-kerbi/kerbifile.rb
|
249
|
-
- spec/spec_helper.rb
|
250
|
-
- spec/mixins/mixer_mixin_spec.rb
|
251
|
-
- spec/main/mixer_spec.rb
|
252
242
|
- spec/main/project_code_gen_spec.rb
|
243
|
+
- spec/main/mixer_spec.rb
|
253
244
|
- spec/main/configmap_backend_spec.rb
|
254
245
|
- spec/main/state_entry_set_spec.rb
|
255
246
|
- spec/main/state_entry_spec.rb
|
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
|
255
|
+
- spec/utils/helm_spec.rb
|
256
|
+
- spec/utils/k8s_auth_spec.rb
|
257
|
+
- spec/mixins/mixer_mixin_spec.rb
|
258
|
+
- spec/fixtures/mini-projects/hello-kerbi/common/metadata.yaml.erb
|
259
|
+
- spec/fixtures/mini-projects/hello-kerbi/kerbifile.rb
|
260
|
+
- spec/fixtures/mini-projects/hello-kerbi/helpers.rb
|
261
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/v2.yaml
|
262
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/production.yaml
|
263
|
+
- spec/fixtures/mini-projects/hello-kerbi/values/values.yaml
|
264
|
+
- spec/fixtures/mini-projects/hello-kerbi/consts.rb
|
265
|
+
- spec/fixtures/mini-projects/hello-kerbi/pod-and-service.yaml.erb
|
256
266
|
- spec/fixtures/expectations/common/bad-tag.txt
|
257
|
-
- spec/fixtures/expectations/
|
258
|
-
- spec/fixtures/expectations/
|
259
|
-
- spec/fixtures/expectations/root/template-write.yaml
|
260
|
-
- spec/fixtures/expectations/root/template-read.yaml
|
261
|
-
- spec/fixtures/expectations/root/template-inlines.yaml
|
262
|
-
- spec/fixtures/expectations/root/template.yaml
|
263
|
-
- spec/fixtures/expectations/root/template-production.yaml
|
264
|
-
- spec/fixtures/expectations/release/list.txt
|
265
|
-
- spec/fixtures/expectations/release/status-all-working.txt
|
267
|
+
- spec/fixtures/expectations/release/init-already-existed.txt
|
268
|
+
- spec/fixtures/expectations/release/status-data-unreadable.txt
|
266
269
|
- spec/fixtures/expectations/release/init-both-created.txt
|
270
|
+
- spec/fixtures/expectations/release/status-all-working.txt
|
267
271
|
- spec/fixtures/expectations/release/status-not-provisioned.txt
|
272
|
+
- spec/fixtures/expectations/release/list.txt
|
268
273
|
- spec/fixtures/expectations/release/delete.txt
|
269
|
-
- spec/fixtures/expectations/release/init-already-existed.txt
|
270
|
-
- spec/fixtures/expectations/release/status-data-unreadable.txt
|
271
274
|
- spec/fixtures/expectations/values/order-of-precedence.yaml
|
272
275
|
- spec/fixtures/expectations/state/prune-candidates.txt
|
273
|
-
- spec/fixtures/expectations/state/list.
|
274
|
-
- spec/fixtures/expectations/state/list.json
|
275
|
-
- spec/fixtures/expectations/state/show.yaml
|
276
|
+
- spec/fixtures/expectations/state/list.yaml
|
276
277
|
- spec/fixtures/expectations/state/demote.txt
|
277
|
-
- spec/fixtures/expectations/state/
|
278
|
-
- spec/fixtures/expectations/state/
|
278
|
+
- spec/fixtures/expectations/state/show.yaml
|
279
|
+
- spec/fixtures/expectations/state/show.txt
|
279
280
|
- spec/fixtures/expectations/state/show.json
|
280
|
-
- spec/fixtures/expectations/state/
|
281
|
+
- spec/fixtures/expectations/state/set.txt
|
282
|
+
- spec/fixtures/expectations/state/list.txt
|
281
283
|
- spec/fixtures/expectations/state/promote.txt
|
284
|
+
- spec/fixtures/expectations/state/delete.txt
|
285
|
+
- spec/fixtures/expectations/state/list.json
|
282
286
|
- spec/fixtures/expectations/state/retag.txt
|
283
|
-
- spec/fixtures/expectations/
|
287
|
+
- spec/fixtures/expectations/config/show-default.yaml
|
284
288
|
- spec/fixtures/expectations/config/bad-set.txt
|
285
289
|
- spec/fixtures/expectations/config/set.txt
|
286
|
-
- spec/fixtures/expectations/
|
290
|
+
- spec/fixtures/expectations/root/template-write.yaml
|
291
|
+
- spec/fixtures/expectations/root/template-read.yaml
|
292
|
+
- spec/fixtures/expectations/root/template-production.yaml
|
293
|
+
- spec/fixtures/expectations/root/template-inlines.yaml
|
294
|
+
- spec/fixtures/expectations/root/values.json
|
295
|
+
- spec/fixtures/expectations/root/template-read-inlines.yaml
|
296
|
+
- spec/fixtures/expectations/root/template.yaml
|
287
297
|
- spec/fixtures/embedding.yaml.erb
|
288
|
-
- spec/
|
289
|
-
- spec/utils/helm_spec.rb
|
290
|
-
- spec/utils/values_utils_spec.rb
|
291
|
-
- spec/utils/mixing_utils_spec.rb
|
292
|
-
- spec/utils/misc_utils_spec.rb
|
293
|
-
- spec/cli/values_handler_spec.rb
|
294
|
-
- spec/cli/root_handler_spec.rb
|
295
|
-
- spec/cli/config_handler_spec.rb
|
296
|
-
- spec/cli/state_handler_spec.rb
|
297
|
-
- spec/cli/release_handler_spec.rb
|
298
|
+
- spec/spec_helper.rb
|