Skip to content

Incorrect port detection #1223

@yangcao77

Description

@yangcao77

Which area this feature is related to?

/kind bug

Which area this bug is related to?

/area alizer

What versions of software are you using?

Go project

Operating System and version:

Go Pkg Version:

Node.js project

Operating System and version:

Node.js version:

Yarn version:

Project.json:

Web browser

Operating System and version:

Browser name and version:

Bug Summary

Describe the bug:
Alizer returns the default port, but not the one set in Dockerfile

With a project with the default port set:

// Listen and serve.
const PORT = process.env.PORT || 3000;
server.listen(PORT, () => {
  console.log(`App started on PORT ${PORT}.`);
});

and a Dockerfile sets the env.PORT
ENV PORT 3001

Alizer returns ports: [3000].

To Reproduce:

run Alizer DetectComponents against https://github.com/christianvogt/devfile-sample/tree/dockerfile/component

Expected behavior

port 3001 should be detected, as in the code process.env.PORT || 3000, the env port has higher priority than the default port.

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable

Additional context

Any workaround?

Suggestion on how to fix the bug

Metadata

Metadata

Assignees

Labels

area/alizerEnhancement or issue related to the alizer repokind/bugSomething isn't working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions