File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ def build_catalog_tasks
157157 task = OctocatalogDiff ::Util ::Parallel ::Task . new (
158158 method : method ( :build_catalog ) ,
159159 validator : method ( :catalog_validator ) ,
160+ validator_args : { task : key } ,
160161 description : "build_catalog for #{ @options [ "#{ key } _env" . to_sym ] } " ,
161162 args : args
162163 )
@@ -231,10 +232,12 @@ def build_catalog(opts, logger = @logger)
231232
232233 # Validate a catalog in the parallel execution
233234 # @param catalog [OctocatalogDiff::Catalog] Catalog object
235+ # @param logger [Logger] Logger object (presently unused)
236+ # @param args [Hash] Additional arguments set specifically for validator
234237 # @return [Boolean] true if catalog is valid, false otherwise
235- def catalog_validator ( catalog = nil , _logger = @logger )
238+ def catalog_validator ( catalog = nil , _logger = @logger , args = { } )
236239 return false unless catalog . is_a? ( OctocatalogDiff ::Catalog )
237- catalog . validate_references
240+ catalog . validate_references if args [ :task ] == :to
238241 catalog . valid?
239242 end
240243 end
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def initialize(opts = {})
2222 @args = opts . fetch ( :args , { } )
2323 @description = opts [ :description ] || @method . name
2424 @validator = opts [ :validator ]
25+ @validator_args = opts [ :validator_args ] || { }
2526 end
2627
2728 def execute ( logger = Logger . new ( StringIO . new ) )
@@ -30,7 +31,7 @@ def execute(logger = Logger.new(StringIO.new))
3031
3132 def validate ( result , logger = Logger . new ( StringIO . new ) )
3233 return true if @validator . nil?
33- @validator . call ( result , logger )
34+ @validator . call ( result , logger , @validator_args )
3435 end
3536 end
3637
You can’t perform that action at this time.
0 commit comments