Skip to content

Commit 0bc22e6

Browse files
committed
Struggling to stay within the 100-column limit.
https://google.github.io/styleguide/javaguide.html#s4.4-column-limit explicitly exempts > Lines where obeying the column limit is not possible (for example, a long URL in Javadoc but evidently google-java-format does not understand this.
1 parent d177116 commit 0bc22e6

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

util/src/main/java/io/kubernetes/client/util/KubeConfig.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ public String getAccessToken() {
222222
}
223223
}
224224
}
225-
String tokenViaExecCredential = tokenViaExecCredential((Map<String, Object>) currentUser.get("exec"));
225+
String tokenViaExecCredential =
226+
tokenViaExecCredential((Map<String, Object>) currentUser.get("exec"));
226227
if (tokenViaExecCredential != null) {
227228
return tokenViaExecCredential;
228229
}
@@ -243,14 +244,18 @@ public String getAccessToken() {
243244

244245
/**
245246
* Attempt to create an access token by running a configured external program.
246-
* @see <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins">Authenticating » client-go credential plugins</a>
247+
*
248+
* @see <a
249+
* href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins">
250+
* Authenticating » client-go credential plugins</a>
247251
*/
248252
private String tokenViaExecCredential(Map<String, Object> execMap) {
249253
if (execMap == null) {
250254
return null;
251255
}
252256
String apiVersion = (String) execMap.get("apiVersion");
253-
if (!"client.authentication.k8s.io/v1beta1".equals(apiVersion)) { // TODO or v1alpha1 is apparently identical and could be supported
257+
if (!"client.authentication.k8s.io/v1beta1".equals(apiVersion)) {
258+
// TODO or v1alpha1 is apparently identical and could be supported
254259
log.error("Unrecognized user.exec.apiVersion: {}", apiVersion);
255260
return null;
256261
}
@@ -272,7 +277,7 @@ private String tokenViaExecCredential(Map<String, Object> execMap) {
272277
Process proc = pb.start();
273278
JsonElement root;
274279
try (InputStream is = proc.getInputStream();
275-
Reader r = new InputStreamReader(is, StandardCharsets.UTF_8)) {
280+
Reader r = new InputStreamReader(is, StandardCharsets.UTF_8)) {
276281
root = new JsonParser().parse(r);
277282
} catch (JsonParseException x) {
278283
log.error("Failed to parse output of " + command, x);
@@ -287,7 +292,8 @@ private String tokenViaExecCredential(Map<String, Object> execMap) {
287292
JsonObject status = root.getAsJsonObject().get("status").getAsJsonObject();
288293
JsonElement token = status.get("token");
289294
if (token == null) {
290-
// TODO handle clientCertificateData/clientKeyData (KubeconfigAuthentication is not yet set up for that to be dynamic)
295+
// TODO handle clientCertificateData/clientKeyData
296+
// (KubeconfigAuthentication is not yet set up for that to be dynamic)
291297
log.warn("No token produced by {}", command);
292298
return null;
293299
}
@@ -297,8 +303,10 @@ private String tokenViaExecCredential(Map<String, Object> execMap) {
297303
return null;
298304
}
299305
// TODO cache tokens between calls, up to .status.expirationTimestamp
300-
// TODO a 401 is supposed to force a refresh, but KubeconfigAuthentication hard-codes AccessTokenAuthentication which does not support that
301-
// and anyway ClientBuilder only calls Authenticator.provide once per ApiClient; we would need to do it on every request
306+
// TODO a 401 is supposed to force a refresh,
307+
// but KubeconfigAuthentication hardcodes AccessTokenAuthentication which does not support that
308+
// and anyway ClientBuilder only calls Authenticator.provide once per ApiClient;
309+
// we would need to do it on every request
302310
}
303311

304312
public boolean verifySSL() {

0 commit comments

Comments
 (0)