minfra-cli 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/minfra/cli/version.rb +1 -1
- data/lib/minfra/cli.rb +9 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6145d8b76367e739eb7b93bcfdcaf22428004ab45de977215e874c8b59da64b
|
4
|
+
data.tar.gz: 8811fbed0e951e862888428e4370cc10d9c4fa199e9d9fa567b847ec1f689383
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61359dada17608504dac46c3af40fc94e8a7d53f468ca95f6bcec518c9d7c9b32a7a6ff14540286c1fcc9b14d6eee45df4df336e6156a0a8cea8c986c8188fd5
|
7
|
+
data.tar.gz: 9792bf505ded5f51f4955be00f13fae965aaaadf17caa1606f310ebbb600cc145929ab5e39b31c4c0dc707a1de24912dd830f2c6749077db8d42961539a594ce
|
data/CHANGELOG.md
CHANGED
data/lib/minfra/cli/version.rb
CHANGED
data/lib/minfra/cli.rb
CHANGED
@@ -68,7 +68,6 @@ module Minfra
|
|
68
68
|
env= @config.orch_env
|
69
69
|
raise("unknown environment #{env}, I expact a file at hiera/hieradata/environments/#{env}.eyaml") unless @hiera_root.join("hieradata/environments/#{env}.eyaml").exist?
|
70
70
|
|
71
|
-
|
72
71
|
scope={ "hieraroot" => @hiera_root.to_s, "env" => env}
|
73
72
|
special_lookups=hiera.lookup("lookup_options", {}, scope, nil, :priority)
|
74
73
|
|
@@ -76,15 +75,23 @@ module Minfra
|
|
76
75
|
scope=scope.merge(node_scope)
|
77
76
|
cache={}
|
78
77
|
Kernel.define_method(:l) do |value,default=nil|
|
78
|
+
|
79
79
|
return cache[value] if cache.has_key?(value)
|
80
80
|
|
81
|
+
values=value.split(".")
|
82
|
+
value=values.shift
|
83
|
+
|
81
84
|
if special_lookups[value]
|
82
85
|
lookup_type={ merge_behavior: special_lookups[value]["merge"].to_sym }
|
83
86
|
else
|
84
|
-
lookup_type=:
|
87
|
+
lookup_type=:deep
|
85
88
|
end
|
86
89
|
|
87
90
|
result=hiera.lookup(value, default, scope, nil, lookup_type)
|
91
|
+
unless values.empty?
|
92
|
+
result=result.dig(*values)
|
93
|
+
end
|
94
|
+
|
88
95
|
result=Hashie::Mash.new(result) if result.kind_of?(Hash)
|
89
96
|
cache[value] = result
|
90
97
|
result
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minfra-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Schrammel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
233
|
- !ruby/object:Gem::Version
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
|
-
rubygems_version: 3.
|
236
|
+
rubygems_version: 3.1.6
|
237
237
|
signing_key:
|
238
238
|
specification_version: 4
|
239
239
|
summary: A cli framework for k8s based development and deployment.
|