diff --git a/test-frame-common/src/main/java/io/skodjob/testframe/resources/KubeResourceManager.java b/test-frame-common/src/main/java/io/skodjob/testframe/resources/KubeResourceManager.java index f047705..67b0383 100644 --- a/test-frame-common/src/main/java/io/skodjob/testframe/resources/KubeResourceManager.java +++ b/test-frame-common/src/main/java/io/skodjob/testframe/resources/KubeResourceManager.java @@ -4,7 +4,11 @@ */ package io.skodjob.testframe.resources; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Path; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Stack; import java.util.concurrent.atomic.AtomicInteger; @@ -96,6 +100,28 @@ public final void setResourceTypes(ResourceType... types) { this.resourceTypes = types; } + /** + * Reads Kubernetes resources from a file at the specified path. + * + * @param file The path to the file containing Kubernetes resources. + * @return A list of {@link HasMetadata} resources defined in the file. + * @throws IOException If an I/O error occurs reading from the file. + */ + public List readResourcesFromFile(Path file) throws IOException { + return client.readResourcesFromFile(file); + } + + /** + * Reads Kubernetes resources from an InputStream. + * + * @param is The InputStream containing Kubernetes resources. + * @return A list of {@link HasMetadata} resources defined in the stream. + * @throws IOException If an I/O error occurs. + */ + public List readResourcesFromFile(InputStream is) throws IOException { + return client.readResourcesFromFile(is); + } + /** * Pushes a resource item to the stack. * @param item The resource item to push.