Skip to content

Commit

Permalink
Add tower endpoint to wave [ci fast]
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 Nov 3, 2022
1 parent 29f9897 commit b725ddc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class SubmitContainerTokenRequest {
*/
Long towerWorkspaceId

/**
* Tower endpoint
*/
String towerEndpoint

/**
* Container image to be pulled
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class WaveClient {
final req = makeRequest(assets)
req.towerAccessToken = tower.accessToken
req.towerWorkspaceId = tower.workspaceId
req.towerEndpoint = tower.endpoint
return sendRequest(req)
}

Expand All @@ -154,7 +155,8 @@ class WaveClient {
containerImage: image,
containerConfig: containerConfig,
towerAccessToken: tower.accessToken,
towerWorkspaceId: tower.workspaceId )
towerWorkspaceId: tower.workspaceId,
towerEndpoint: tower.endpoint )
return sendRequest(request)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ class WaveClientTest extends Specification {

def 'should send request with tower access token' () {
given:
def sess = Mock(Session) {getConfig() >> [wave:[:], tower:[accessToken:'foo', workspaceId:123]] }
def config = [wave:[:], tower:[accessToken:'foo', workspaceId:123, endpoint: 'http://foo.com']]
def sess = Mock(Session) {getConfig() >> config }
and:
def wave = Spy(new WaveClient(sess))
def assets = Mock(WaveAssets)
Expand All @@ -594,6 +595,7 @@ class WaveClientTest extends Specification {
assert (it[0] == request)
assert (it[0] as SubmitContainerTokenRequest).towerAccessToken == 'foo'
assert (it[0] as SubmitContainerTokenRequest).towerWorkspaceId == 123
assert (it[0] as SubmitContainerTokenRequest).towerEndpoint == 'http://foo.com'
}

}
Expand Down

0 comments on commit b725ddc

Please sign in to comment.