nexus3-oss icon indicating copy to clipboard operation
nexus3-oss copied to clipboard

Docker repositories httpPort needs to be an integer, although string does work

Open tallandtree opened this issue 4 years ago • 0 comments

In the files/groovy/create_repos_from_list.groovy, docker repository configuration for httpPort is a string. This works, but appears to be incorrect as it breaks the api call beta/repositories. One way to fix this is by converting httpPort to integer in the groovy script.

       if (currentRepo.format == 'docker') {
            def httpPort = currentRepo.get('http_port', '')
            configuration.attributes['docker'] = [
                    forceBasicAuth: currentRepo.force_basic_auth,
                    v1Enabled     : currentRepo.v1_enabled,
                    httpPort      : httpPort.isInteger() ? httpPort.toInteger() : null
            ]
        }

tallandtree avatar Mar 19 '20 10:03 tallandtree