Skip to content

Commit

Permalink
Improve missing repo credentials
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Sep 22, 2024
1 parent 80a7e81 commit ab0125f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ class ContainerInspectServiceImpl implements ContainerInspectService {
if( cacheRepo )
repos.add(cacheRepo)
final result = credsJson(repos, identity)
if( buildRepo && result && !result.contains(host0(buildRepo)) )
throw new BadRequestException("Missing credentials for target build repository: $buildRepo")
if( cacheRepo && result && !result.contains(host0(cacheRepo)) )
throw new BadRequestException("Missing credentials for target cache repository: $buildRepo")
final msg = identity
? "Make sure you have provided a corresponding container credentials record in your Seqera Platform account"
: "Make sure you have provided your Seqera Platform token (aka Tower access token) in your request"
if( buildRepo && (!result || !result.contains(host0(buildRepo))) )
throw new BadRequestException("Missing credentials repository: $buildRepo - $msg")
if( cacheRepo && (!result || !result.contains(host0(cacheRepo))) )
throw new BadRequestException("Missing credentials repository: $buildRepo - $msg")
return result
}

Expand Down

0 comments on commit ab0125f

Please sign in to comment.