Kubernetes 14 (#3263)

* update to 7.0.1 and change package names

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

* Updating packages of our kubernates imports

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

* Updating kubernates client verion to 14.0

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

* added cddl with classpath extension as an alias

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

* get rid of builders

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
pull/3269/head
Sally MacFarlane 3 years ago committed by GitHub
parent e25cb7a014
commit 2fbd04a8e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      gradle/check-licenses.gradle
  2. 2
      gradle/versions.gradle
  3. 11
      nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java
  4. 4
      nat/src/main/java/org/hyperledger/besu/nat/kubernetes/service/LoadBalancerBasedDetector.java
  5. 8
      nat/src/test/java/org/hyperledger/besu/nat/kubernetes/KubernetesClusterIpNatManagerTest.java
  6. 20
      nat/src/test/java/org/hyperledger/besu/nat/kubernetes/KubernetesLoadManagerNatManagerTest.java
  7. 6
      nat/src/test/java/org/hyperledger/besu/nat/kubernetes/KubernetesUnknownNatManagerTest.java

@ -116,6 +116,7 @@ downloadLicenses {
'CDDL 1.0',
'CDDL 1.1',
'Common Development and Distribution License (CDDL) v1.0',
'CDDL + GPLv2 with classpath exception',
],
(epl1) : [
'Eclipse Public License - Version 1.0',

@ -65,7 +65,7 @@ dependencyManagement {
dependency 'io.jaegertracing:jaeger-client:1.6.0'
dependency 'io.kubernetes:client-java:6.0.1'
dependency 'io.kubernetes:client-java:14.0.0'
dependency 'io.netty:netty-all:4.1.72.Final'
dependency 'io.netty:netty-tcnative-boringssl-static:2.0.46.Final'

@ -32,10 +32,10 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import com.google.common.annotations.VisibleForTesting;
import io.kubernetes.client.ApiClient;
import io.kubernetes.client.Configuration;
import io.kubernetes.client.apis.CoreV1Api;
import io.kubernetes.client.models.V1Service;
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.apis.CoreV1Api;
import io.kubernetes.client.openapi.models.V1Service;
import io.kubernetes.client.util.ClientBuilder;
import io.kubernetes.client.util.KubeConfig;
import io.kubernetes.client.util.authenticators.GCPAuthenticator;
@ -78,7 +78,8 @@ public class KubernetesNatManager extends AbstractNatManager {
// invokes the CoreV1Api client
final V1Service service =
api
.listServiceForAllNamespaces(null, null, null, null, null, null, null, null)
.listServiceForAllNamespaces(
null, null, null, null, null, null, null, null, null, null)
.getItems()
.stream()
.filter(

@ -20,8 +20,8 @@ import org.hyperledger.besu.nat.core.exception.NatInitializationException;
import java.net.InetAddress;
import java.util.Optional;
import io.kubernetes.client.models.V1LoadBalancerIngress;
import io.kubernetes.client.models.V1Service;
import io.kubernetes.client.openapi.models.V1LoadBalancerIngress;
import io.kubernetes.client.openapi.models.V1Service;
public class LoadBalancerBasedDetector implements IpDetector {

@ -29,10 +29,10 @@ import java.util.Arrays;
import java.util.concurrent.ExecutionException;
import io.kubernetes.client.custom.IntOrString;
import io.kubernetes.client.models.V1ObjectMeta;
import io.kubernetes.client.models.V1Service;
import io.kubernetes.client.models.V1ServicePort;
import io.kubernetes.client.models.V1ServiceSpec;
import io.kubernetes.client.openapi.models.V1ObjectMeta;
import io.kubernetes.client.openapi.models.V1Service;
import io.kubernetes.client.openapi.models.V1ServicePort;
import io.kubernetes.client.openapi.models.V1ServiceSpec;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

@ -29,13 +29,13 @@ import java.util.Arrays;
import java.util.concurrent.ExecutionException;
import io.kubernetes.client.custom.IntOrString;
import io.kubernetes.client.models.V1LoadBalancerIngressBuilder;
import io.kubernetes.client.models.V1LoadBalancerStatusBuilder;
import io.kubernetes.client.models.V1ObjectMeta;
import io.kubernetes.client.models.V1Service;
import io.kubernetes.client.models.V1ServicePort;
import io.kubernetes.client.models.V1ServiceSpec;
import io.kubernetes.client.models.V1ServiceStatus;
import io.kubernetes.client.openapi.models.V1LoadBalancerIngress;
import io.kubernetes.client.openapi.models.V1LoadBalancerStatus;
import io.kubernetes.client.openapi.models.V1ObjectMeta;
import io.kubernetes.client.openapi.models.V1Service;
import io.kubernetes.client.openapi.models.V1ServicePort;
import io.kubernetes.client.openapi.models.V1ServiceSpec;
import io.kubernetes.client.openapi.models.V1ServiceStatus;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -59,10 +59,8 @@ public final class KubernetesLoadManagerNatManagerTest {
final V1ServiceStatus v1ServiceStatus =
new V1ServiceStatus()
.loadBalancer(
new V1LoadBalancerStatusBuilder()
.addToIngress(
new V1LoadBalancerIngressBuilder().withIp(detectedAdvertisedHost).build())
.build());
new V1LoadBalancerStatus()
.addIngressItem(new V1LoadBalancerIngress().ip(detectedAdvertisedHost)));
when(v1Service.getStatus()).thenReturn(v1ServiceStatus);
when(v1Service.getSpec())
.thenReturn(

@ -17,9 +17,9 @@ package org.hyperledger.besu.nat.kubernetes;
import static org.hyperledger.besu.nat.kubernetes.KubernetesNatManager.DEFAULT_BESU_SERVICE_NAME_FILTER;
import static org.mockito.Mockito.when;
import io.kubernetes.client.models.V1ObjectMeta;
import io.kubernetes.client.models.V1Service;
import io.kubernetes.client.models.V1ServiceSpec;
import io.kubernetes.client.openapi.models.V1ObjectMeta;
import io.kubernetes.client.openapi.models.V1Service;
import io.kubernetes.client.openapi.models.V1ServiceSpec;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

Loading…
Cancel
Save