From 5c39eb2898339f7bcee7a35402d1daf411dc56ad Mon Sep 17 00:00:00 2001 From: vaidikcode Date: Thu, 24 Oct 2024 07:11:51 +0530 Subject: [PATCH] final commit --- .../io/kubernetes/client/extended/kubectl/KubectlCreate.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlCreate.java b/extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlCreate.java index 5ba4b7bbd3..a6b26f9fc3 100644 --- a/extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlCreate.java +++ b/extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlCreate.java @@ -118,7 +118,8 @@ public static Object loadAndSubmitResource(Reader content) throws Exception { // Finding the resource in the discovery class Set resources = discovery.findAll(); Optional apiResource = resources.stream() - .filter(r -> r.getKind().equalsIgnoreCase(kind)) + .filter(r -> r.getKind().equalsIgnoreCase(kind) + && r.getVersions().stream().anyMatch(v -> v.equalsIgnoreCase(apiVersion))) .findFirst(); // Check if the resource kind was found