Skip to content

Commit 68ff599

Browse files
committed
ugly fix for failure with latest docker client on mac
1 parent f6d920f commit 68ff599

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

src/main/java/com/github/dockerjava/api/model/AuthConfig.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public class AuthConfig implements Serializable {
4848
@JsonProperty("identitytoken")
4949
private String identitytoken;
5050

51+
/**
52+
* @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_25}
53+
*/
54+
@JsonProperty("stackOrchestrator")
55+
private String stackOrchestrator;
56+
5157
public String getUsername() {
5258
return username;
5359
}
@@ -123,6 +129,20 @@ public AuthConfig withRegistrytoken(String registrytoken) {
123129
return this;
124130
}
125131

132+
/**
133+
* @see #stackOrchestrator
134+
*/
135+
public String getStackOrchestrator() {
136+
return stackOrchestrator;
137+
}
138+
139+
/**
140+
* @see #stackOrchestrator
141+
*/
142+
public void setStackOrchestrator(String stackOrchestrator) {
143+
this.stackOrchestrator = stackOrchestrator;
144+
}
145+
126146
@Override
127147
public String toString() {
128148
return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);

src/test/java/com/github/dockerjava/api/model/AuthConfigTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip;
1111
import static org.hamcrest.CoreMatchers.equalTo;
1212
import static org.hamcrest.CoreMatchers.is;
13+
import static org.hamcrest.CoreMatchers.nullValue;
1314
import static org.hamcrest.MatcherAssert.assertThat;
1415
import static org.hamcrest.Matchers.notNullValue;
1516
import static org.junit.Assert.assertEquals;
@@ -78,4 +79,18 @@ public void compatibleWithIdentitytoken() throws IOException {
7879
final AuthConfig authConfig1 = new AuthConfig().withAuth(auth).withIdentityToken(identitytoken);
7980
assertThat(authConfig1, equalTo(authConfig));
8081
}
82+
83+
@Test
84+
public void shouldNotFailWithStackOrchestratorInConfig() throws IOException {
85+
final ObjectMapper mapper = new ObjectMapper();
86+
final JavaType type = mapper.getTypeFactory().uncheckedSimpleType(AuthConfig.class);
87+
final AuthConfig authConfig = testRoundTrip(RemoteApiVersion.VERSION_1_25,
88+
"/other/AuthConfig/orchestrators.json",
89+
type
90+
);
91+
assertThat(authConfig, notNullValue());
92+
assertThat(authConfig.getAuth(), is(nullValue()));
93+
assertThat(authConfig.getStackOrchestrator(), is("kubernetes"));
94+
}
95+
8196
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"stackOrchestrator" : "kubernetes"
3+
}

0 commit comments

Comments
 (0)