Skip to content

[dev-tool] check-node-versions fails when using --node-versions flag without --node-version #16657

Closed

Description

When using only node-versions without node-version you end up with the trailing empty string here which causes downstream errors when building docker container names.

> options = { "node-versions": "12,13,14,15", "node-version": "" }
{ 'node-versions': '12,13,14,15', 'node-version': '' }
> [...new Set(options["node-versions"]?.split(",").concat(options["node-version"]))]
[ '12', '13', '14', '15', '' ]

Showing the errors as well, because it's a good hint to what's happening

[check-node-versions-samples] docker: Error response from daemon: Conflict. The container name "/12-container" is already in use by container "9e702026ecaa87a8c40a54735611d00b9f3f31fe6e251913687b520dfa2891c6". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
[check-node-versions-samples] Docker container 12-container encountered an error
[check-node-versions-samples] docker: Error response from daemon: Conflict. The container name "/12-container" is already in use by container "9e702026ecaa87a8c40a54735611d00b9f3f31fe6e251913687b520dfa2891c6". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
[check-node-versions-samples] Docker container 12-container encountered an error
[check-node-versions-samples] Started running the docker container 14-container
[check-node-versions-samples] Using node v14.17.3 to install dependencies

I think the fix is as easy as a conditional or an added filter to exclude empty strings but did not have time to test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.dev-toolIssues related to the Azure SDK for JS dev-tool

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions