From 4a8e9cae23b1c4acea9df0aca19fc6fb979945ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Fri, 21 Jan 2022 23:15:39 +0100
Subject: [PATCH] Allow Kubernetes fields ending with .yml

---
 .../main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt    | 2 +-
 .../main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt
index d50caec12..5bd39dcbc 100644
--- a/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt
+++ b/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt
@@ -26,7 +26,7 @@ class ConfigMapResourceSet : ResourceSet, KubernetesResource {
                 .withName(name)
                 .get() ?: throw DeploymentFailedException("Cannot find ConfigMap with name '$name'."))
                 .data
-                .filter { it.key.endsWith(".yaml") }
+                .filter { it.key.endsWith(".yaml") || it.key.endsWith(".yml")}
         } catch (e: KubernetesClientException) {
             throw DeploymentFailedException("Cannot find or read ConfigMap with name '$name'.", e)
         }
diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt b/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt
index e769f8b98..f830232de 100644
--- a/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt
+++ b/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt
@@ -28,7 +28,7 @@ class FileSystemResourceSet: ResourceSet, KubernetesResource {
         return try {
             File(path)
                 .list() !!
-                .filter { it.endsWith(".yaml") } // consider only yaml files, e.g. ignore readme files
+                .filter { it.endsWith(".yaml") || it.endsWith(".yml") }
                 .map {
                     loadSingleResource(resourceURL = it, client = client)
                 }
-- 
GitLab