File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
util/src/test/java/io/kubernetes/client/util Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -273,4 +273,27 @@ public void testRefreshToken() {
273
273
String token = config .getAccessToken ();
274
274
assertEquals (token , fake .token );
275
275
}
276
+
277
+ private static final String KUBECONFIG_EXEC =
278
+ "apiVersion: v1\n "
279
+ + "current-context: c\n "
280
+ + "contexts:\n "
281
+ + "- name: c\n "
282
+ + " context:\n "
283
+ + " user: u\n "
284
+ + "users:\n "
285
+ + "- name: u\n "
286
+ + " user:\n "
287
+ + " exec:\n "
288
+ + " apiVersion: client.authentication.k8s.io/v1beta1\n "
289
+ + " command: echo\n "
290
+ + " args:\n "
291
+ + " - >-\n "
292
+ + " {\" apiVersion\" : \" client.authentication.k8s.io/v1beta1\" , \" kind\" : \" ExecCredential\" , \" status\" : {\" token\" : \" abc123\" }}\n " ;
293
+
294
+ @ Test
295
+ public void testExecCredentials () throws Exception {
296
+ KubeConfig kc = KubeConfig .loadKubeConfig (new StringReader (KUBECONFIG_EXEC ));
297
+ assertEquals ("abc123" , kc .getAccessToken ());
298
+ }
276
299
}
You can’t perform that action at this time.
0 commit comments