Skip to content

Commit 6ecbee0

Browse files
pditommasoclaude
andcommitted
Make freeze/mirror rejection message actionable; tighten test
Point the caller to the direct image reference in the NotFoundException message, and assert the message carries that reference in the test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8a2d531 commit 6ecbee0

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/main/groovy/io/seqera/wave/core/RouteHandler.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class RouteHandler {
6666
// meant to be pulled directly from there - they must not be served via the Wave
6767
// proxy token path (see also ContainerRequest.durable)
6868
if( request.durable() ) {
69-
throw new NotFoundException("Wave container for token '$token' is not available via the proxy")
69+
throw new NotFoundException("Container '$token' is a freeze/mirror image and must be pulled directly from '${request.containerImage}'")
7070
}
7171
// the image name (without tag) must match
7272
final coords = request.coordinates()

src/test/groovy/io/seqera/wave/core/RouteHandlerTest.groovy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ class RouteHandlerTest extends Specification {
143143
then:
144144
1 * tokenService.getRequest(TOKEN) >> REQUEST
145145
and:
146-
thrown(NotFoundException)
146+
def e = thrown(NotFoundException)
147+
// the error must point the caller to the direct image reference
148+
e.message.contains(IMAGE)
147149

148150
where:
149-
REQ_PATH | TOKEN | REQUEST
150-
'/v2/wt/a1/library/ubuntu/manifests/latest' | 'a1' | ContainerRequest.of(containerImage: 'ubuntu:latest', freeze: true)
151-
'/v2/wt/b2/library/ubuntu/blobs/latest' | 'b2' | ContainerRequest.of(containerImage: 'ubuntu:latest', type: ContainerRequest.Type.Mirror)
151+
REQ_PATH | TOKEN | IMAGE | REQUEST
152+
'/v2/wt/a1/library/ubuntu/manifests/latest' | 'a1' | 'quay.io/org/ubuntu:1.0' | ContainerRequest.of(containerImage: 'quay.io/org/ubuntu:1.0', freeze: true)
153+
'/v2/wt/b2/library/ubuntu/blobs/latest' | 'b2' | 'quay.io/org/ubuntu:1.0' | ContainerRequest.of(containerImage: 'quay.io/org/ubuntu:1.0', type: ContainerRequest.Type.Mirror)
152154
}
153155

154156
}

0 commit comments

Comments
 (0)