Skip to content

Added random GUID to section name in logging output #645

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

savagecx
Copy link

Fixes #644

Description of Issue Fixed
Unable to deploy multiple services using serverless compose when more than one service utilises the serverless domain manager plugin.

Changes proposed in this pull request:

  • Appended a random GUID to the logging section name to make it unique
  • Updated the logging unit tests to take the GUID into account.

Copy link

@renanwilliam
Copy link

Considering this issue only occurs when more than one service is deployed simultaneously, could using the service name instead of a random GUID be a better option?

Globals.serverless.addServiceOutputSection(`${Globals.pluginName} - ${Globals.serverless.service.service}`, summaryList);

@renanwilliam
Copy link

Considering this issue only occurs when more than one service is deployed simultaneously, could using the service name instead of a random GUID be a better option?

Globals.serverless.addServiceOutputSection(`${Globals.pluginName} - ${Globals.serverless.service.service}`, summaryList);

Forget it, doesn't work. I created a fork and tested it in my project, and the error is still present. Your solution works fine.

@renanwilliam
Copy link

After a lot of tests here, I think the best solution is just check if the output is already added before add again:

//src/logging.ts (59)
if (!Globals.serverless?.servicePluginOutputs?.has(Globals.pluginName)) {
  Globals.serverless.addServiceOutputSection(Globals.pluginName, summaryList);
}

it's necessary add this on types line 70:

///src/types.ts (70)
serviceOutputs?: Map<string, any>;
servicePluginOutputs?: Map<string, any>;

@renanwilliam
Copy link

Here are some updates about my tests: it looks like this package doesn't work with serverless compose in the last version.
This removes the error message, but the API mappings are incorrectly created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

V1 - Unable to create base path mapping for 'xxx.xxx.com': Base path already exists for this domain name
2 participants