Skip to content

Commit 9240756

Browse files
fix(docker): address review comments on the fix to the issue of retrofit2 replacing ? with %3F causing api failure with 400
1 parent 5e32a8a commit 9240756

File tree

3 files changed

+9
-129
lines changed

3 files changed

+9
-129
lines changed

clouddriver-docker/src/main/groovy/com/netflix/spinnaker/clouddriver/docker/registry/api/v2/auth/DockerBearerTokenService.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package com.netflix.spinnaker.clouddriver.docker.registry.api.v2.auth
1919
import com.netflix.spinnaker.clouddriver.docker.registry.api.v2.DockerUserAgent
2020
import com.netflix.spinnaker.clouddriver.docker.registry.api.v2.exception.DockerRegistryAuthenticationException
2121
import com.netflix.spinnaker.config.DefaultServiceEndpoint
22+
import com.netflix.spinnaker.kork.annotations.VisibleForTesting
2223
import com.netflix.spinnaker.kork.client.ServiceClientProvider
2324
import com.netflix.spinnaker.kork.retrofit.Retrofit2SyncCall
2425
import groovy.util.logging.Slf4j
@@ -236,7 +237,8 @@ class DockerBearerTokenService {
236237
cachedTokens.remove(repository)
237238
}
238239

239-
private interface TokenService {
240+
@VisibleForTesting
241+
interface TokenService {
240242
@GET("/{path}")
241243
@Headers([
242244
"Docker-Distribution-API-Version: registry/2.0"

clouddriver-docker/src/main/groovy/com/netflix/spinnaker/clouddriver/docker/registry/api/v2/client/DockerRegistryClient.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,12 @@ class DockerRegistryClient {
474474
return tags
475475
}
476476

477-
static def parseForQueryParams(String nextPath) {
477+
/**
478+
* This method takes a string that might contain a query string and splits it into the path and the query parameters.
479+
* @param nextPath the string that might contain a query string
480+
* @return a tuple containing the path (without query string) and a map of query parameters
481+
*/
482+
static Tuple2<String, Map<String, String>> parseForQueryParams(String nextPath) {
478483
def nextPathNew
479484
def queryParamsString
480485
Map<String, String> queryParams = [:]

clouddriver-docker/src/test/java/com/netflix/spinnaker/clouddriver/docker/registry/api/v2/client/DockerRegistryServiceTest.java

Lines changed: 0 additions & 127 deletions
This file was deleted.

0 commit comments

Comments
 (0)