SDK - Components - Only yaml component files can be used as source (#1966)

Previously, if the file was a .zip archive, some functions like exception printing would fail as it's not a text file.
This commit is contained in:
Alexey Volkov 2019-08-27 15:23:09 -07:00 committed by Kubernetes Prow Robot
parent f63c301344
commit 4cbfdd8e1f
1 changed files with 1 additions and 1 deletions

View File

@ -270,5 +270,5 @@ def _create_task_factory_from_component_spec(component_spec:ComponentSpec, compo
factory_function_parameters,
documentation='\n'.join(func_docstring_lines),
func_name=name,
func_filename=component_filename
func_filename=component_filename if (component_filename and (component_filename.endswith('.yaml') or component_filename.endswith('.yml'))) else None,
)