kucodiff 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kucodiff/version.rb +1 -1
- data/lib/kucodiff.rb +17 -10
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0c86b43c39bc7d8aa5fcb41035d254e8ce47e89969d97b4b1d0e5829ffeb139
|
4
|
+
data.tar.gz: b2da356c812dd537b04dfb5c327165ce895d182f1dc5a180cb1c335df93640d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ab4d4c2642f15fdf86798402f60115afd74787a81b49e6ce664f39e8d36873af440316c0c297d2543721ec43b11a4d22301810948786b5e4a6fc4b545b1f4e2
|
7
|
+
data.tar.gz: fdd69911a3a957c611a947044cf8f16293eac9fcc707c4d712409dd019fef6c979bb9f2ddec1f5098da167beab165d63dbd460a16b06c36e303e5ce2e74d2731
|
data/lib/kucodiff/version.rb
CHANGED
data/lib/kucodiff.rb
CHANGED
@@ -42,21 +42,28 @@ module Kucodiff
|
|
42
42
|
raise ArgumentError, "unknown file format in #{file}"
|
43
43
|
end.first
|
44
44
|
|
45
|
-
|
45
|
+
template = template(content)
|
46
|
+
template.dig("spec", "containers")&.each do |container|
|
47
|
+
hashify_named_array!(container, "env", first: true)
|
48
|
+
hashify_named_array!(container, "volumeMounts", first: false)
|
49
|
+
end
|
50
|
+
hashify_named_array!(template["spec"], "volumes", first: false)
|
46
51
|
hashify_required_env!(content)
|
47
52
|
|
48
53
|
flat_hash(content)
|
49
54
|
end
|
50
55
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
def hashify_named_array!(object, key, first:)
|
57
|
+
return if !object || !(array = object[key])
|
58
|
+
object[key] = array.to_h do |v|
|
59
|
+
keep = (v.keys - ['name'])
|
60
|
+
value =
|
61
|
+
if first
|
62
|
+
v.fetch(keep.first)
|
63
|
+
else
|
64
|
+
v.slice(*keep)
|
65
|
+
end
|
66
|
+
[v.fetch('name'), value]
|
60
67
|
end
|
61
68
|
end
|
62
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kucodiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|
@@ -31,14 +31,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.
|
34
|
+
version: 2.6.0
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
|
-
rubygems_version: 3.1.
|
41
|
+
rubygems_version: 3.1.6
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Smart diff for kubernetes configs to ensure symmetric configuration
|