Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Add a nuclio suffix to the module name if function is being deployed from the file #185

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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