Skip to content

Commit d9f3ca6

Browse files
pditommasoclaude
andcommitted
Return direct image for durable requests on the V1 endpoint
makeResponseV2 already returns the direct target-registry image for freeze/mirror (durable) requests, but makeResponseV1 kept handing back the Wave proxy token url. Since durable images are no longer served via the proxy token path (see RouteHandler), V1 freeze clients pulling via targetImage would 404. Resolve targetImage to the direct image for durable requests on V1 too, matching V2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6ecbee0 commit d9f3ca6

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

src/main/groovy/io/seqera/wave/util/ContainerHelper.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ class ContainerHelper {
116116
}
117117

118118
static SubmitContainerTokenResponse makeResponseV1(ContainerRequest data, TokenData token, String waveImage) {
119-
final target = waveImage
119+
// freeze/mirror images are published to the target registry and must be pulled
120+
// directly from there - the Wave proxy token path does not serve them (see RouteHandler)
121+
final target = data.durable() ? data.containerImage : waveImage
120122
final build = data.buildNew ? data.buildId : null
121123
return new SubmitContainerTokenResponse(data.requestId, token.value, target, token.expiration, data.containerImage, build, null, null, null, null, null)
122124
}

src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,36 @@ class ContainerHelperTest extends Specification {
253253
result.cached == null
254254
result.freeze == null
255255

256-
where:
256+
where:
257257
NEW_BUILD | EXPECTED_BUILD_ID
258258
false | null
259259
true | '123'
260260
}
261261

262+
@Unroll
263+
def 'should create response v1 for durable request returning the direct image' () {
264+
given:
265+
def data = ContainerRequest.of(
266+
containerImage: 'quay.io/org/container:1.0',
267+
freeze: IS_FREEZE,
268+
type: TYPE )
269+
def token = new TokenData('123abc', Instant.now().plusSeconds(100))
270+
def target = 'wave.com/wt/123abc/org/container:1.0'
271+
272+
when:
273+
def result = ContainerHelper.makeResponseV1(data, token, target)
274+
then:
275+
// freeze/mirror images must resolve to the direct target-registry image,
276+
// not the Wave proxy token url (which no longer serves durable images)
277+
result.targetImage == 'quay.io/org/container:1.0'
278+
result.containerImage == 'quay.io/org/container:1.0'
279+
280+
where:
281+
TYPE | IS_FREEZE
282+
null | true
283+
ContainerRequest.Type.Mirror | false
284+
}
285+
262286
@Unroll
263287
def 'should create response v2' () {
264288
given:

0 commit comments

Comments
 (0)