Skip to content

Commit

Permalink
Add readResorucesFromFile into RM too
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys committed Mar 19, 2024
1 parent edf7129 commit 0eefd45
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<HasMetadata> 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<HasMetadata> readResourcesFromFile(InputStream is) throws IOException {
return client.readResourcesFromFile(is);
}

/**
* Pushes a resource item to the stack.
* @param item The resource item to push.
Expand Down

0 comments on commit 0eefd45

Please sign in to comment.