Skip to content

Commit

Permalink
Merge pull request #104 from gdisdevops/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies of spring, kubernetes client and some more
  • Loading branch information
DaspawnW authored Sep 26, 2023
2 parents 7beacc0 + 86398e5 commit 3d8894a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.2</version>
<version>3.1.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<fabric8.version>6.4.0</fabric8.version>
<fabric8.version>6.8.1</fabric8.version>
</properties>

<dependencies>
Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>8.0.0.Final</version>
<version>8.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>org.springframework.vault</groupId>
<artifactId>spring-vault-core</artifactId>
<version>3.0.0</version>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -57,13 +57,13 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.2</version>
<version>3.1.8</version>
</dependency>

<dependency>
<groupId>com.hubspot.jinjava</groupId>
<artifactId>jinjava</artifactId>
<version>2.6.0</version>
<version>2.7.1</version>
</dependency>


Expand All @@ -75,7 +75,7 @@
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>3.0.0-beta-2</version>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import de.koudingspawn.vault.crd.Vault;
import de.koudingspawn.vault.crd.VaultList;
import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition;
import io.fabric8.kubernetes.client.*;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.ConfigBuilder;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.kubernetes.internal.KubernetesDeserializer;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -37,13 +38,9 @@ public KubernetesClient client() {

@Bean
public MixedOperation<Vault, VaultList, Resource<Vault>> customResource(
KubernetesClient client, @Value("${kubernetes.crd.name}") String crdName) {
KubernetesClient client,
@Value("${kubernetes.crd.name}") String crdName) {
Resource<CustomResourceDefinition> crdResource = client.apiextensions().v1().customResourceDefinitions().withName(crdName);

// Hack for bug in Kubernetes-Client for CRDs https://github.com/fabric8io/kubernetes-client/issues/1099
String kind = StringUtils.substringAfter(crdName, ".") + "/v1#Vault";
KubernetesDeserializer.registerCustomKind(kind, Vault.class);

CustomResourceDefinition customResourceDefinition = crdResource.get();
if (customResourceDefinition == null) {
log.error("Please first apply custom resource definition and then restart vault-crd");
Expand All @@ -52,5 +49,4 @@ public MixedOperation<Vault, VaultList, Resource<Vault>> customResource(

return client.resources(Vault.class, VaultList.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import de.koudingspawn.vault.vault.communication.SecretNotAccessibleException;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.kubernetes.internal.KubernetesDeserializer;
import org.apache.commons.lang3.StringUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
Expand Down Expand Up @@ -49,12 +46,6 @@ public class AdmissionReviewTest {
@Autowired
private MockMvc mvc;

@Before
public void setup() {
String kind = StringUtils.substringAfter("vault.koudingspawn.de", ".") + "/v1#Vault";
KubernetesDeserializer.registerCustomKind(kind, Vault.class);
}

@Test
public void shouldFailWithInvalidRequest() throws Exception {
SecretNotAccessibleException secretException = new SecretNotAccessibleException("Secret is not accessible");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import de.koudingspawn.vault.kubernetes.cache.SecretCache;
import de.koudingspawn.vault.vault.VaultSecret;
import io.fabric8.kubernetes.api.model.*;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import org.junit.After;
Expand Down

0 comments on commit 3d8894a

Please sign in to comment.