File tree Expand file tree Collapse file tree
main/java/com/github/dockerjava/api/model
java/com/github/dockerjava/api/model
resources/samples/1.25/other/AuthConfig Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff line change 1010import static com .github .dockerjava .test .serdes .JSONSamples .testRoundTrip ;
1111import static org .hamcrest .CoreMatchers .equalTo ;
1212import static org .hamcrest .CoreMatchers .is ;
13+ import static org .hamcrest .CoreMatchers .nullValue ;
1314import static org .hamcrest .MatcherAssert .assertThat ;
1415import static org .hamcrest .Matchers .notNullValue ;
1516import 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}
Original file line number Diff line number Diff line change 1+ {
2+ "stackOrchestrator" : " kubernetes"
3+ }
You can’t perform that action at this time.
0 commit comments