Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean dependencies and use kubernetes client bom with depencencies #80

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading