Closed
Description
openedon Jul 29, 2021
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