15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/skull_island/helpers/migration.rb', line 15
def migrate_0_14_to_1_1(config)
new_config = config.dup
config['plugins']&.each_with_index do |plugin, plugin_index|
%w[consumer route service].each do |rtype|
if plugin["#{rtype}_id"]&.start_with?('<%=')
new_config['plugins'][plugin_index][rtype] = plugin["#{rtype}_id"].dup
new_config['plugins'][plugin_index].delete("#{rtype}_id")
elsif plugin["#{rtype}_id"]
new_config['plugins'][plugin_index][rtype] = {
'id' => plugin["#{rtype}_id"].dup
}
end
end
end
new_config['version'] = '1.1'
new_config
end
|