Skip to content

Commit

Permalink
[Build] Add a nuclio suffix to the module name if function is being…
Browse files Browse the repository at this point in the history
… deployed from the file (#185)
  • Loading branch information
rokatyy committed Jul 14, 2024
1 parent d348a84 commit 61f9b63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nuclio/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ def build_file(filename='', name='', handler='', archive=False, project='',
code = add_kind_footer(kind, config, code)

name = normalize_name(name or filebase)
# Avoid import issues if the filename is the same as an existing Python library by adding a Nuclio suffix
normalized_filebase = normalize_name(filebase) + '-nuclio'
update_in(config, 'metadata.name', name)
config = extend_config(config, spec, tag, filename)
set_handler(config, normalize_name(filebase), '' if kind else handler, ext)
set_handler(config, normalized_filebase, '' if kind else handler, ext)

log = logger.info if verbose else logger.debug
log('Code:\n{}'.format(code))
Expand Down

0 comments on commit 61f9b63

Please sign in to comment.