Skip to content

Commit

Permalink
Undeprecate containerImage attribute in response object
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Apr 11, 2024
1 parent aa21872 commit 2341102
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
compileOnly("io.micronaut:micronaut-http-validation")
implementation("jakarta.persistence:jakarta.persistence-api:3.0.0")
api 'io.seqera:lib-mail:1.0.0'
api 'io.seqera:wave-api:0.9.0'
api 'io.seqera:wave-api:0.9.1'
api 'io.seqera:wave-utils:0.12.0'

implementation("io.micronaut:micronaut-http-client")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class ContainerHelper {
final Boolean cached = !data.buildNew
final expiration = !data.freeze ? token.expiration : null
final tokenId = !data.freeze ? token.value : null
return new SubmitContainerTokenResponse(tokenId, target, expiration, null, build, cached, data.freeze)
return new SubmitContainerTokenResponse(tokenId, target, expiration, data.containerImage, build, cached, data.freeze)
}

static String patchPlatformEndpoint(String endpoint) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,24 +354,28 @@ class ContainerHelperTest extends Specification {
null,
'123',
NEW_BUILD,
FREEZE
IS_FREEZE
)
def token = new TokenData('123abc', Instant.now().plusSeconds(100))
def target = 'wave.com/this/that'
and:
def EXPECTED_IMAGE = 'docker.io/some/container'
def EXPECTED_BUILD = '123'

when:
def result = ContainerHelper.makeResponseV2(data, token, target)
then:
verifyAll(result){
containerToken == EXPECTED_TOKEN
targetImage == EXPECTED_IMAGE
buildId == '123'
containerImage == EXPECTED_IMAGE
targetImage == EXPECTED_TARGET
buildId == EXPECTED_BUILD
cached == EXPECTED_CACHE
freeze == FREEZE
freeze == IS_FREEZE
}

where:
NEW_BUILD | FREEZE | EXPECTED_TOKEN | EXPECTED_IMAGE | EXPECTED_CACHE
NEW_BUILD | IS_FREEZE | EXPECTED_TOKEN | EXPECTED_TARGET | EXPECTED_CACHE
false | false | '123abc' | 'wave.com/this/that' | true
true | false | '123abc' | 'wave.com/this/that' | false
and:
Expand Down

0 comments on commit 2341102

Please sign in to comment.