You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errors.add(:'options.canary.steps.instance_weight','must be an Integer between 1-100 (inclusive)')
105
+
return
106
+
end
107
+
108
+
errors.add(:'options.canary.steps.instance_weight','must be an Integer between 1-100 (inclusive)')ifsteps.any?{ |step| (1..100).exclude?(step[:instance_weight])}
109
+
110
+
weights=steps.map{ |step| step[:instance_weight]}
111
+
returnunlessweights.sort != weights
71
112
72
-
errors.add(:canary_options,'are only valid for Canary deployments')unlessstrategy == 'canary'
113
+
errors.add(:'options.canary.steps.instance_weight','must be sorted in ascending order')
record.errors.add(:max_in_flight,'must be an integer greater than 0')
275
-
end
273
+
record.errors.add(:max_in_flight,'must be an integer greater than 0')ifoptions.key?(:max_in_flight) && (!max_in_flight.is_a?(Integer) || max_in_flight < 1)
276
274
277
275
canary_options=options[:canary]
278
276
returnifcanary_options.nil?
279
-
280
-
if !canary_options.is_a?(Hash)
281
-
record.errors.add(:"options.canary",'must be an object')
277
+
278
+
unlesscanary_options.is_a?(Hash)
279
+
record.errors.add(:'options.canary','must be an object')
282
280
return
283
281
end
284
282
285
283
# binding.pry
286
284
287
285
strategy=record.strategy
288
286
289
-
ifcanary_options && strategy != "canary"
290
-
record.errors.add(:"options.canary",'are only valid for Canary deployments')
287
+
ifcanary_options && strategy != 'canary'
288
+
record.errors.add(:'options.canary','are only valid for Canary deployments')
0 commit comments