Skip to content

Commit 9f2008e

Browse files
committed
Break fix the context and yaml labels
1 parent 8a9ad52 commit 9f2008e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

libs/kb8_context.rb

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def initialize(context)
2727
unless context_setting
2828
raise "Context '#{@name}' not found"
2929
end
30+
when 'Kb8Context'
31+
context_setting = context
3032
else
3133
raise 'Invalid context, expecting Hash'
3234
end

libs/kb8_controller.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def initialize(yaml_data, file, context)
6868
raise "Invalid YAML - Missing spec in file:'#{file}'."
6969
end
7070
if yaml_data['spec'].has_key?('selector')
71-
@selectors = Selectors.new(yaml_data['spec']['selector'])
71+
@selectors = Selectors.new(yaml_data['spec']['selector'].dup)
7272
elsif yaml_data['spec']['template']['metadata'].has_key?('labels')
73-
@selectors = Selectors.new(yaml_data['spec']['template']['metadata']['labels'])
73+
@selectors = Selectors.new(yaml_data['spec']['template']['metadata']['labels'].dup)
7474
end
7575
unless @yaml_data['metadata']['labels']
7676
@yaml_data['metadata']['labels'] = {}
@@ -134,7 +134,7 @@ def update_deployment_data
134134
@yaml_data['metadata']['labels'][ORIGINAL_NAME] = @original_name
135135
@yaml_data['metadata']['labels'][DEPLOYMENT_LABEL] = deploy_id
136136
@selectors[DEPLOYMENT_LABEL] = deploy_id
137-
@yaml_data['spec']['selector'] = @selectors.selectors_hash
137+
@yaml_data['spec']['selector'] = @selectors.selectors_hash.dup
138138
@yaml_data['spec']['template']['metadata']['labels'][DEPLOYMENT_LABEL] = deploy_id
139139
end
140140

version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.6.11
1+
0.6.12

0 commit comments

Comments
 (0)