Skip to content

Commit

Permalink
Clean dependencies and use kubernetes client bom with depencencies (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys authored May 21, 2024
1 parent 512cce3 commit 7008618
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 38 deletions.
42 changes: 10 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>

<fabric8.version>6.12.0</fabric8.version>
<fabric8.version>6.12.1</fabric8.version>
<log4j.version>2.17.2</log4j.version>

<!-- Build tools' properties -->
Expand All @@ -92,6 +92,7 @@
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<junit.platform.version>1.10.2</junit.platform.version>
<maven.surefire.version>3.2.2</maven.surefire.version>
<jackson-dataformat-yaml.version>2.17.1</jackson-dataformat-yaml.version>
</properties>

<dependencyManagement>
Expand All @@ -108,38 +109,10 @@
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client-api</artifactId>
<version>${fabric8.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client-api</artifactId>
<version>${fabric8.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client</artifactId>
<version>${fabric8.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>${fabric8.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model</artifactId>
<version>${fabric8.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>generator-annotations</artifactId>
<version>${fabric8.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-server-mock</artifactId>
<artifactId>kubernetes-client-bom-with-deps</artifactId>
<version>${fabric8.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -176,6 +149,11 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.surefire.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson-dataformat-yaml.version}</version>
</dependency>
<!-- Logger -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
4 changes: 4 additions & 0 deletions test-frame-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
<artifactId>kubernetes-server-mock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<!-- Logger -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
package io.skodjob.testframe.environment;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.skodjob.testframe.LoggerUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.yaml.snakeyaml.Yaml;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Collections;
Expand Down Expand Up @@ -103,13 +103,12 @@ public <T> T getOrDefault(String envVarName, Function<String, T> converter, T de
* @return Map with env variables and their values, or empty Map in case of not existing file
*/
protected Map<String, Object> loadConfigurationFile() {
Yaml yaml = new Yaml();

ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
try {
File yamlFile = new File(configFilePath).getAbsoluteFile();
return yaml.load(new FileInputStream(yamlFile));
return mapper.readValue(new File(yamlFile.getAbsoluteFile().toString()), Map.class);
} catch (IOException ex) {
LOGGER.info("Yaml configuration not provided or does not exist");
LOGGER.info("Yaml configuration not provider or not exists");
return Collections.emptyMap();
}
}
Expand Down

0 comments on commit 7008618

Please sign in to comment.