1 parent 6a9f78e commit 5c39eb2Copy full SHA for 5c39eb2
1 file changed
extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlCreate.java
@@ -118,7 +118,8 @@ public static Object loadAndSubmitResource(Reader content) throws Exception {
118
// Finding the resource in the discovery class
119
Set<Discovery.APIResource> resources = discovery.findAll();
120
Optional<Discovery.APIResource> apiResource = resources.stream()
121
- .filter(r -> r.getKind().equalsIgnoreCase(kind))
+ .filter(r -> r.getKind().equalsIgnoreCase(kind)
122
+ && r.getVersions().stream().anyMatch(v -> v.equalsIgnoreCase(apiVersion)))
123
.findFirst();
124
125
// Check if the resource kind was found
0 commit comments