@@ -33,6 +33,7 @@ public class DockerClientConfig implements Serializable {
3333 private static final String DOCKER_IO_READ_TIMEOUT_PROPERTY = "docker.io.readTimeout" ;
3434 // this is really confusing, as there are two ways to spell it
3535 private static final String DOCKER_IO_ENABLE_LOGGING_FILTER_PROPERTY = "docker.io.enableLoggingFilter" ;
36+ private static final String DOCKER_IO_FOLLOW_REDIRECTS_FILTER_PROPERTY = "docker.io.followRedirectsFilterEnabled" ;
3637 private static final String DOCKER_IO_DOCKER_CERT_PATH_PROPERTY = "docker.io.dockerCertPath" ;
3738 private static final String DOCKER_IO_DOCKER_CFG_PATH_PROPERTY = "docker.io.dockerCfgPath" ;
3839 // connection pooling properties
@@ -53,6 +54,7 @@ public class DockerClientConfig implements Serializable {
5354 m .put ("DOCKER_SERVER_ADDRESS" , DOCKER_IO_SERVER_ADDRESS_PROPERTY );
5455 m .put ("DOCKER_READ_TIMEOUT" , DOCKER_IO_READ_TIMEOUT_PROPERTY );
5556 m .put ("DOCKER_LOGGING_FILTER_ENABLED" , DOCKER_IO_ENABLE_LOGGING_FILTER_PROPERTY );
57+ m .put ("DOCKER_IO_FOLLOW_REDIRECTS_FILTER_PROPERTY" , DOCKER_IO_FOLLOW_REDIRECTS_FILTER_PROPERTY );
5658 m .put (DOCKER_CERT_PATH_PROPERTY , DOCKER_IO_DOCKER_CERT_PATH_PROPERTY );
5759 m .put ("DOCKER_CFG_PATH" , DOCKER_IO_DOCKER_CFG_PATH_PROPERTY );
5860 ENV_NAME_TO_IO_NAME = Collections .unmodifiableMap (m );
@@ -63,14 +65,15 @@ public class DockerClientConfig implements Serializable {
6365 private final String version , username , password , email , serverAddress , dockerCfgPath ;
6466 private final Integer readTimeout ;
6567 private final boolean loggingFilterEnabled ;
68+ private final boolean followRedirectsFilterEnabled ;
6669 private final SSLConfig sslConfig ;
6770
6871 private final int maxTotalConnections ;
6972 private final int maxPerRouteConnections ;
7073
7174 DockerClientConfig (URI uri , String version , String username , String password , String email , String serverAddress ,
72- String dockerCfgPath , Integer readTimeout , boolean loggingFilterEnabled , SSLConfig sslConfig ,
73- int maxTotalConns , int maxPerRouteConns ) {
75+ String dockerCfgPath , Integer readTimeout , boolean loggingFilterEnabled , boolean followRedirectsFilterEnabled ,
76+ SSLConfig sslConfig , int maxTotalConns , int maxPerRouteConns ) {
7477 this .uri = uri ;
7578 this .version = version ;
7679 this .username = username ;
@@ -80,6 +83,7 @@ public class DockerClientConfig implements Serializable {
8083 this .dockerCfgPath = dockerCfgPath ;
8184 this .readTimeout = readTimeout ;
8285 this .loggingFilterEnabled = loggingFilterEnabled ;
86+ this .followRedirectsFilterEnabled = followRedirectsFilterEnabled ;
8387 this .sslConfig = sslConfig ;
8488 this .maxTotalConnections = maxTotalConns ;
8589 this .maxPerRouteConnections = maxPerRouteConns ;
@@ -243,6 +247,10 @@ public boolean isLoggingFilterEnabled() {
243247 return loggingFilterEnabled ;
244248 }
245249
250+ public boolean followRedirectsFilterEnabled () {
251+ return followRedirectsFilterEnabled ;
252+ }
253+
246254 public SSLConfig getSslConfig () {
247255 return sslConfig ;
248256 }
@@ -345,14 +353,15 @@ public String toString() {
345353 ", sslConfig='" + sslConfig + '\'' +
346354 ", readTimeout=" + readTimeout +
347355 ", loggingFilterEnabled=" + loggingFilterEnabled +
356+ ", followRedirectsFilterEnabled=" + followRedirectsFilterEnabled +
348357 '}' ;
349358 }
350359
351360 public static class DockerClientConfigBuilder {
352361 private URI uri ;
353362 private String version , username , password , email , serverAddress , dockerCfgPath ;
354363 private Integer readTimeout , maxTotalConnections , maxPerRouteConnections ;
355- private boolean loggingFilterEnabled ;
364+ private boolean loggingFilterEnabled , followRedirectsFilterEnabled ;
356365 private SSLConfig sslConfig ;
357366
358367 /**
@@ -370,6 +379,7 @@ public DockerClientConfigBuilder withProperties(Properties p) {
370379 .withServerAddress (p .getProperty (DOCKER_IO_SERVER_ADDRESS_PROPERTY ))
371380 .withReadTimeout (Integer .valueOf (p .getProperty (DOCKER_IO_READ_TIMEOUT_PROPERTY , "0" )))
372381 .withLoggingFilter (Boolean .valueOf (p .getProperty (DOCKER_IO_ENABLE_LOGGING_FILTER_PROPERTY , "true" )))
382+ .withFollowRedirectsFilter (Boolean .valueOf (p .getProperty (DOCKER_IO_FOLLOW_REDIRECTS_FILTER_PROPERTY , "true" )))
373383 .withDockerCertPath (p .getProperty (DOCKER_IO_DOCKER_CERT_PATH_PROPERTY ))
374384 .withDockerCfgPath (p .getProperty (DOCKER_IO_DOCKER_CFG_PATH_PROPERTY ))
375385 .withMaxPerRouteConnections (Integer .valueOf (p .getProperty (DOCKER_IO_MAX_PER_ROUTE_PROPERTY , "2" )))
@@ -428,6 +438,11 @@ public final DockerClientConfigBuilder withLoggingFilter(boolean loggingFilterEn
428438 return this ;
429439 }
430440
441+ public final DockerClientConfigBuilder withFollowRedirectsFilter (boolean followRedirectsFilterEnabled ) {
442+ this .followRedirectsFilterEnabled = followRedirectsFilterEnabled ;
443+ return this ;
444+ }
445+
431446 public final DockerClientConfigBuilder withDockerCertPath (String dockerCertPath ) {
432447 this .sslConfig = new LocalDirectorySSLConfig (dockerCertPath );
433448 return this ;
@@ -455,6 +470,7 @@ public DockerClientConfig build() {
455470 dockerCfgPath ,
456471 readTimeout ,
457472 loggingFilterEnabled ,
473+ followRedirectsFilterEnabled ,
458474 sslConfig ,
459475 maxTotalConnections ,
460476 maxPerRouteConnections
0 commit comments