Skip to content

Commit

Permalink
Merge pull request quarkusio#29807 from marcnuri-forks/deps/kubernete…
Browse files Browse the repository at this point in the history
…s-client

Bump kubernetes-client-bom from 6.2.0 to 6.3.1
  • Loading branch information
gsmet authored Dec 21, 2022
2 parents 9bf4af9 + 4c3c083 commit 3e68178
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 137 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<kotlin.version>1.7.22</kotlin.version>
<kotlin.coroutine.version>1.6.4</kotlin.coroutine.version>
<kotlin-serialization.version>1.4.1</kotlin-serialization.version>
<kubernetes-client.version>6.2.0</kubernetes-client.version> <!-- Please check with Java Operator SDK team before updating -->
<kubernetes-client.version>6.3.1</kubernetes-client.version> <!-- Please check with Java Operator SDK team before updating -->
<dekorate.version>3.1.3</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<maven-invoker.version>3.2.0</maven-invoker.version>
<awaitility.version>4.2.0</awaitility.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ public void process(ApplicationIndexBuildItem applicationIndex, CombinedIndexBui
log.debugv("Model Classes:\n{0}", String.join("\n", modelClasses));
}

// Register the default HttpClient implementation
serviceProviderProducer.produce(new ServiceProviderBuildItem(
HttpClient.Factory.class.getName(), "io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory"));

// Register all HttpClient implementations
serviceProviderProducer.produce(ServiceProviderBuildItem.allProvidersFromClassPath(HttpClient.Factory.class.getName()));
// Register all KubernetesResource providers (needed for the KubernetesDeserializer)
serviceProviderProducer.produce(ServiceProviderBuildItem.allProvidersFromClassPath(KubernetesResource.class.getName()));
// Register all KubernetesClient extensions
serviceProviderProducer.produce(ServiceProviderBuildItem.allProvidersFromClassPath(ExtensionAdapter.class.getName()));

// Enable SSL support by default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import java.nio.file.Path;
import java.util.List;

import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.dekorate.servicebinding.model.ServiceBinding;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -58,26 +59,18 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement().satisfies(i -> {
assertThat(i).isInstanceOfSatisfying(ServiceBinding.class, s -> {
assertThat(s.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("kubernetes-with-auto-mogno-binding-mongodb");
});
assertThat(s.getSpec()).satisfies(spec -> {
assertThat(spec.getApplication()).satisfies(a -> {
assertThat(a.getGroup()).isEqualTo("apps");
assertThat(a.getVersion()).isEqualTo("v1");
assertThat(a.getKind()).isEqualTo("Deployment");
});

assertThat(spec.getServices()).hasOnlyOneElementSatisfying(service -> {
assertThat(service.getGroup()).isEqualTo("psmdb.percona.com");
assertThat(service.getVersion()).isEqualTo("v1-9-0");
assertThat(service.getKind()).isEqualTo("PerconaServerMongoDB");
assertThat(service.getName()).isEqualTo("mongodb");
});
});
});
});
assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement()
.isInstanceOfSatisfying(GenericKubernetesResource.class, sb -> assertThat(sb)
.hasFieldOrPropertyWithValue("metadata.name", "kubernetes-with-auto-mogno-binding-mongodb")
.returns("apps", s -> s.get("spec", "application", "group"))
.returns("v1", s -> s.get("spec", "application", "version"))
.returns("Deployment", s -> s.get("spec", "application", "kind"))
.extracting(s -> s.get("spec", "services"))
.asList()
.singleElement().asInstanceOf(InstanceOfAssertFactories.MAP)
.containsEntry("group", "psmdb.percona.com")
.containsEntry("version", "v1-9-0")
.containsEntry("kind", "PerconaServerMongoDB")
.containsEntry("name", "mongodb"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import java.nio.file.Path;
import java.util.List;

import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.dekorate.servicebinding.model.ServiceBinding;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -59,26 +60,18 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement().satisfies(i -> {
assertThat(i).isInstanceOfSatisfying(ServiceBinding.class, s -> {
assertThat(s.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("kubernetes-with-auto-mysql-binding-mysql");
});
assertThat(s.getSpec()).satisfies(spec -> {
assertThat(spec.getApplication()).satisfies(a -> {
assertThat(a.getGroup()).isEqualTo("apps");
assertThat(a.getVersion()).isEqualTo("v1");
assertThat(a.getKind()).isEqualTo("Deployment");
});

assertThat(spec.getServices()).hasOnlyOneElementSatisfying(service -> {
assertThat(service.getGroup()).isEqualTo("pxc.percona.com");
assertThat(service.getVersion()).isEqualTo("v1-9-0");
assertThat(service.getKind()).isEqualTo("PerconaXtraDBCluster");
assertThat(service.getName()).isEqualTo("mysql");
});
});
});
});
assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement()
.isInstanceOfSatisfying(GenericKubernetesResource.class, sb -> assertThat(sb)
.hasFieldOrPropertyWithValue("metadata.name", "kubernetes-with-auto-mysql-binding-mysql")
.returns("apps", s -> s.get("spec", "application", "group"))
.returns("v1", s -> s.get("spec", "application", "version"))
.returns("Deployment", s -> s.get("spec", "application", "kind"))
.extracting(s -> s.get("spec", "services"))
.asList()
.singleElement().asInstanceOf(InstanceOfAssertFactories.MAP)
.containsEntry("group", "pxc.percona.com")
.containsEntry("version", "v1-9-0")
.containsEntry("kind", "PerconaXtraDBCluster")
.containsEntry("name", "mysql"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import java.nio.file.Path;
import java.util.List;

import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.dekorate.servicebinding.model.ServiceBinding;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -59,26 +60,18 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement().satisfies(i -> {
assertThat(i).isInstanceOfSatisfying(ServiceBinding.class, s -> {
assertThat(s.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("kubernetes-with-auto-postgres-binding-postgresql");
});
assertThat(s.getSpec()).satisfies(spec -> {
assertThat(spec.getApplication()).satisfies(a -> {
assertThat(a.getGroup()).isEqualTo("apps");
assertThat(a.getVersion()).isEqualTo("v1");
assertThat(a.getKind()).isEqualTo("Deployment");
});

assertThat(spec.getServices()).hasOnlyOneElementSatisfying(service -> {
assertThat(service.getGroup()).isEqualTo("postgres-operator.crunchydata.com");
assertThat(service.getVersion()).isEqualTo("v1beta1");
assertThat(service.getKind()).isEqualTo("PostgresCluster");
assertThat(service.getName()).isEqualTo("postgresql");
});
});
});
});
assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement()
.isInstanceOfSatisfying(GenericKubernetesResource.class, sb -> assertThat(sb)
.hasFieldOrPropertyWithValue("metadata.name", "kubernetes-with-auto-postgres-binding-postgresql")
.returns("apps", s -> s.get("spec", "application", "group"))
.returns("v1", s -> s.get("spec", "application", "version"))
.returns("Deployment", s -> s.get("spec", "application", "kind"))
.extracting(s -> s.get("spec", "services"))
.asList()
.singleElement().asInstanceOf(InstanceOfAssertFactories.MAP)
.containsEntry("group", "postgres-operator.crunchydata.com")
.containsEntry("version", "v1beta1")
.containsEntry("kind", "PostgresCluster")
.containsEntry("name", "postgresql"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import java.nio.file.Path;
import java.util.List;

import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.dekorate.servicebinding.model.ServiceBinding;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -59,26 +60,18 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement().satisfies(i -> {
assertThat(i).isInstanceOfSatisfying(ServiceBinding.class, s -> {
assertThat(s.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("kubernetes-with-semi-auto-postgres-binding-postgresql");
});
assertThat(s.getSpec()).satisfies(spec -> {
assertThat(spec.getApplication()).satisfies(a -> {
assertThat(a.getGroup()).isEqualTo("apps");
assertThat(a.getVersion()).isEqualTo("v1");
assertThat(a.getKind()).isEqualTo("Deployment");
});

assertThat(spec.getServices()).hasOnlyOneElementSatisfying(service -> {
assertThat(service.getGroup()).isEqualTo("my.custom-operator.com");
assertThat(service.getVersion()).isEqualTo("v1alpha1");
assertThat(service.getKind()).isEqualTo("Postgres");
assertThat(service.getName()).isEqualTo("postgresql");
});
});
});
});
assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement()
.isInstanceOfSatisfying(GenericKubernetesResource.class, sb -> assertThat(sb)
.hasFieldOrPropertyWithValue("metadata.name", "kubernetes-with-semi-auto-postgres-binding-postgresql")
.returns("apps", s -> s.get("spec", "application", "group"))
.returns("v1", s -> s.get("spec", "application", "version"))
.returns("Deployment", s -> s.get("spec", "application", "kind"))
.extracting(s -> s.get("spec", "services"))
.asList()
.singleElement().asInstanceOf(InstanceOfAssertFactories.MAP)
.containsEntry("group", "my.custom-operator.com")
.containsEntry("version", "v1alpha1")
.containsEntry("kind", "Postgres")
.containsEntry("name", "postgresql"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
import java.nio.file.Path;
import java.util.List;

import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.dekorate.servicebinding.model.ServiceBinding;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -58,26 +59,18 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement().satisfies(i -> {
assertThat(i).isInstanceOfSatisfying(ServiceBinding.class, s -> {
assertThat(s.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("kubernetes-with-service-binding-my-db");
});
assertThat(s.getSpec()).satisfies(spec -> {
assertThat(spec.getApplication()).satisfies(a -> {
assertThat(a.getGroup()).isEqualTo("apps");
assertThat(a.getVersion()).isEqualTo("v1");
assertThat(a.getKind()).isEqualTo("Deployment");
});

assertThat(spec.getServices()).hasOnlyOneElementSatisfying(service -> {
assertThat(service.getGroup()).isEqualTo("apps");
assertThat(service.getVersion()).isEqualTo("v1");
assertThat(service.getKind()).isEqualTo("Deployment");
assertThat(service.getName()).isEqualTo("my-postgres");
});
});
});
});
assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement()
.isInstanceOfSatisfying(GenericKubernetesResource.class, sb -> assertThat(sb)
.hasFieldOrPropertyWithValue("metadata.name", "kubernetes-with-service-binding-my-db")
.returns("apps", s -> s.get("spec", "application", "group"))
.returns("v1", s -> s.get("spec", "application", "version"))
.returns("Deployment", s -> s.get("spec", "application", "kind"))
.extracting(s -> s.get("spec", "services"))
.asList()
.singleElement().asInstanceOf(InstanceOfAssertFactories.MAP)
.containsEntry("group", "apps")
.containsEntry("version", "v1")
.containsEntry("kind", "Deployment")
.containsEntry("name", "my-postgres"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
import java.nio.file.Path;
import java.util.List;

import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.dekorate.servicebinding.model.ServiceBinding;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.openshift.api.model.DeploymentConfig;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -52,26 +53,18 @@ public void assertGeneratedResources() throws IOException {
});
});

assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement().satisfies(i -> {
assertThat(i).isInstanceOfSatisfying(ServiceBinding.class, s -> {
assertThat(s.getMetadata()).satisfies(m -> {
assertThat(m.getName()).isEqualTo("openshift-with-service-binding-my-db");
});
assertThat(s.getSpec()).satisfies(spec -> {
assertThat(spec.getApplication()).satisfies(a -> {
assertThat(a.getGroup()).isEqualTo("apps.openshift.io");
assertThat(a.getVersion()).isEqualTo("v1");
assertThat(a.getKind()).isEqualTo("DeploymentConfig");
});

assertThat(spec.getServices()).hasOnlyOneElementSatisfying(service -> {
assertThat(service.getGroup()).isEqualTo("apps");
assertThat(service.getVersion()).isEqualTo("v1");
assertThat(service.getKind()).isEqualTo("Deployment");
assertThat(service.getName()).isEqualTo("my-postgres");
});
});
});
});
assertThat(kubernetesList).filteredOn(i -> "ServiceBinding".equals(i.getKind())).singleElement()
.isInstanceOfSatisfying(GenericKubernetesResource.class, sb -> assertThat(sb)
.hasFieldOrPropertyWithValue("metadata.name", "openshift-with-service-binding-my-db")
.returns("apps.openshift.io", s -> s.get("spec", "application", "group"))
.returns("v1", s -> s.get("spec", "application", "version"))
.returns("DeploymentConfig", s -> s.get("spec", "application", "kind"))
.extracting(s -> s.get("spec", "services"))
.asList()
.singleElement().asInstanceOf(InstanceOfAssertFactories.MAP)
.containsEntry("group", "apps")
.containsEntry("version", "v1")
.containsEntry("kind", "Deployment")
.containsEntry("name", "my-postgres"));
}
}

0 comments on commit 3e68178

Please sign in to comment.