Skip to content

Commit 315f486

Browse files
committed
fix: ExecCredential doesn't fail with unsupported command output
1 parent 1a1a9f5 commit 315f486

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
### 6.10-SNAPSHOT
44

55
#### Bugs
6-
76
* Fix #5580: [java-generator] Correctly handle defaults for IntOrString types
87
* Fix #5584: Fix CRD generation when EnumMap is used
98
* Fix #5626: Prevent memory accumulation from informer usage
109
* Fix #5527: Unable to transfer file to pod if `/tmp` is read-only
1110
* Fix #5656: Enable EC private key usage for mTLS auth
11+
* Fix #5694: ExecCredential doesn't fail with unsupported command output
1212

1313
#### Improvements
1414
* Fix #5429: moved crd generator annotations to generator-annotations instead of crd-generator-api. Using generator-annotations introduces no transitive dependencies.
1515
* Fix #5535: Add lombok and sundrio dependencies to the generated bom
1616

1717
#### Dependency Upgrade
1818
* Updated okio to version 1.17.6 to avoid CVE-2023-3635
19+
1920
#### New Features
2021
* Fix #5608 Support authentication with certificate in exec-credentials
2122

kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,15 @@ protected static ExecCredential getExecCredentialFromExecConfig(ExecConfig exec,
823823
if (p.waitFor() != 0) {
824824
LOGGER.warn(output);
825825
}
826-
ExecCredential ec = Serialization.unmarshal(output, ExecCredential.class);
827-
if (!apiVersion.equals(ec.apiVersion)) {
828-
LOGGER.warn("Wrong apiVersion {} vs. {}", ec.apiVersion, apiVersion);
829-
} else {
830-
return ec;
826+
try {
827+
ExecCredential ec = Serialization.unmarshal(output, ExecCredential.class);
828+
if (!apiVersion.equals(ec.apiVersion)) {
829+
LOGGER.warn("Wrong apiVersion {} vs. {}", ec.apiVersion, apiVersion);
830+
} else {
831+
return ec;
832+
}
833+
} catch (Exception ex) {
834+
LOGGER.warn("Error unmarshalling ExecCredential", ex);
831835
}
832836
return null;
833837
}

0 commit comments

Comments
 (0)