public class ResourceUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<io.fabric8.kubernetes.api.model.HasMetadata> |
deserializeKubernetesListOrTemplate(File manifest)
Parse the provided file and return a List of HasMetadata resources.
|
static List<File> |
getFinalResourceDirs(File resourceDir,
String environmentAsCommaSeparateStr) |
static <T extends io.fabric8.kubernetes.api.model.KubernetesResource> |
load(File file,
Class<T> clazz) |
static File |
save(File file,
Object data) |
static File |
save(File file,
Object data,
ResourceFileType type) |
static String |
toJson(Object resource) |
public static List<io.fabric8.kubernetes.api.model.HasMetadata> deserializeKubernetesListOrTemplate(File manifest) throws IOException
If the provided resource is KubernetesList, the individual list items will be returned.
If the provided resource is a Template, the individual objects will be returned with the placeholders replaced.
n.b. the returned list will be sorted using the HasMetadataComparator.
manifest - the File to parse.IOException - if there's a problem while performing IO operations on the provided File.public static <T extends io.fabric8.kubernetes.api.model.KubernetesResource> T load(File file, Class<T> clazz) throws IOException
IOExceptionpublic static File save(File file, Object data) throws IOException
IOExceptionpublic static File save(File file, Object data, ResourceFileType type) throws IOException
IOExceptionpublic static String toJson(Object resource) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionCopyright © 2022. All rights reserved.