compose: remove artificial 20 repo limit

This issue has now been fixed server-side

Connects-to: #1070
Change-type: minor
Signed-off-by: Matthew McGinn <matthew@balena.io>
This commit is contained in:
Matthew McGinn 2019-05-27 21:18:35 +08:00 committed by Matthew McGinn
parent d23d837b8c
commit 5202e137d5

View File

@ -390,22 +390,10 @@ getPreviousRepos = (sdk, docker, logger, appID) ->
authorizePush = (sdk, logger, tokenAuthEndpoint, registry, images, previousRepos) ->
_ = require('lodash')
# TODO: https://github.com/balena-io/balena-cli/issues/1070
maxRepos = 20
if not _.isArray(images)
images = [ images ]
if images.length > maxRepos
throw new Error (
"More than #{maxRepos} containers is currently not supported, see " +
'https://github.com/balena-io/balena-cli/issues/1070 for more information'
)
images.push previousRepos...
if images.length + previousRepos?.length > maxRepos
logger.logDebug("Truncating requested repositories to #{maxRepos} by limiting previously pushed repo access")
# at this point, we know we're only truncating access to previously pushed repos
images = images[0...maxRepos]
sdk.request.send
baseUrl: tokenAuthEndpoint
url: '/auth/v1/token'