Skip to content

Commit 0109e3b

Browse files
committed
resource.nexus_repository: Fix: 'PARAMETER [httpPort|httpsPort] Port-number must be >= 1 AND <= 65535'
1 parent 87901d2 commit 0109e3b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

nexus/resource_repository.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,21 @@ func getRepositoryFromResourceData(d *schema.ResourceData) nexus.Repository {
389389
}
390390

391391
if v, ok := dockerConfig["http_port"]; ok {
392-
port := new(int)
393-
*port = v.(int)
394-
repo.RepositoryDocker.HTTPPort = port
392+
value := v.(int)
393+
if value > 0 {
394+
port := new(int)
395+
*port = value
396+
repo.RepositoryDocker.HTTPPort = port
397+
}
395398
}
396399

397400
if v, ok := dockerConfig["https_port"]; ok {
398-
port := new(int)
399-
*port = v.(int)
400-
repo.RepositoryDocker.HTTPSPort = port
401+
value := v.(int)
402+
if value > 0 {
403+
port := new(int)
404+
*port = v.(int)
405+
repo.RepositoryDocker.HTTPSPort = port
406+
}
401407
}
402408
}
403409

0 commit comments

Comments
 (0)