17004: Allow output_properties to override the default metadata
[arvados.git] / services / api / app / models / container_request.rb
index 605b376cf55c917848f08f07df7e3c3c2e1ddd99..911603590586a6e1cbaddb8a2f575940ff0d8cd3 100644 (file)
@@ -237,17 +237,20 @@ class ContainerRequest < ArvadosModel
       end
 
       merged_properties = {}
-      if out_type == "output"
-        merged_properties.update(container.output_properties)
-        merged_properties.update(self.output_properties)
-      end
+      merged_properties['container_request'] = uuid
 
       if out_type == 'output' and !requesting_container_uuid.nil?
-          merged_properties['type'] = 'intermediate'
+        # output of a child process, give it "intermediate" type by
+        # default.
+        merged_properties['type'] = 'intermediate'
       else
         merged_properties['type'] = out_type
       end
-      merged_properties['container_request'] = uuid
+
+      if out_type == "output"
+        merged_properties.update(container.output_properties)
+        merged_properties.update(self.output_properties)
+      end
 
       coll.assign_attributes(
         portable_data_hash: Digest::MD5.hexdigest(manifest) + '+' + manifest.bytesize.to_s,