kucodiff 0.0.1 → 0.1.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/lib/kucodiff.rb +11 -3
- data/lib/kucodiff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2f57c5081372a36536d6a42ac6909ec0427b9a8
|
|
4
|
+
data.tar.gz: fc50d9e152b1101dca1f2b1eeb442a3eebc71480
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d60be03e647ef4f460b77227ea92f09d4c29524f090ca991d3ffc6468a4201931845492ef19d718ef7ac794b7304493aaa9ae84bea815ea3d51cd624296d638d
|
|
7
|
+
data.tar.gz: 657a4fe62f2cb54695483a311ff325e3ba0430fd9f3034f202c132dbcb1d45a48096bfcff2317a032439377ea24e0e15cca3de19a118e6c154c1d0c4b59cf93b
|
data/lib/kucodiff.rb
CHANGED
|
@@ -29,12 +29,14 @@ module Kucodiff
|
|
|
29
29
|
else raise ArgumentError, "unknown file format in #{file}"
|
|
30
30
|
end.first
|
|
31
31
|
|
|
32
|
-
hashify_container_env(content)
|
|
32
|
+
hashify_container_env!(content)
|
|
33
|
+
hashify_required_env!(content)
|
|
34
|
+
|
|
33
35
|
flat_hash(content)
|
|
34
36
|
end
|
|
35
37
|
|
|
36
|
-
# make env
|
|
37
|
-
def hashify_container_env(content)
|
|
38
|
+
# make env comparable
|
|
39
|
+
def hashify_container_env!(content)
|
|
38
40
|
containers = content.fetch('spec', {}).fetch('template', {}).fetch('spec', {}).fetch('containers', [])
|
|
39
41
|
containers.each do |container|
|
|
40
42
|
next unless container['env']
|
|
@@ -45,6 +47,12 @@ module Kucodiff
|
|
|
45
47
|
end
|
|
46
48
|
end
|
|
47
49
|
|
|
50
|
+
def hashify_required_env!(content)
|
|
51
|
+
key = 'required_env'
|
|
52
|
+
annotations = content.fetch('spec', {}).fetch('template', {}).fetch('metadata', {}).fetch('annotations', {})
|
|
53
|
+
annotations[key] = Hash[annotations[key].strip.split(/[\s,]/).map { |k| [k, true] }] if annotations[key]
|
|
54
|
+
end
|
|
55
|
+
|
|
48
56
|
def different_keys(a, b)
|
|
49
57
|
(a.keys + b.keys).uniq.select { |k| a[k] != b[k] }
|
|
50
58
|
end
|
data/lib/kucodiff/version.rb
CHANGED
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.0
|
|
4
|
+
version: 0.1.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: 2017-03-
|
|
11
|
+
date: 2017-03-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email: michael@grosser.it
|