diff --git a/CHANGELOG.md b/CHANGELOG.md index 17d50e8ea84..08ef15ee320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ #### Bugs * Fix #5845: (crd-generator) Fail generating if multiple versions are marked as stored +* Fix #5847: Missing `Log4j2Plugins.dat` descriptor in Kubernetes Lookup * Fix #5853: [java-generator] Gracefully handle colliding enum definitions * Fix #5860: Corrections to java-generator gradle plugin extension * Fix #5817: NPE on EKS OIDC cluster when token needs to be refreshed diff --git a/log4j/pom.xml b/log4j/pom.xml index eb8bd7e9a08..4d422854e96 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml @@ -32,6 +32,13 @@ io.fabric8.kubernetes.log4j.* * + + + + {maven-resources}, + /META-INF/org/apache/logging/=${project.build.outputDirectory}/META-INF/org/apache/logging/, + /META-INF/jandex.idx=${project.build.outputDirectory}/META-INF/jandex.idx + @@ -78,4 +85,23 @@ + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven.surefire.plugin.version} + + + + integration-test + verify + + + + + + + diff --git a/log4j/src/test/java/io/fabric8/kubernetes/log4j/lookup/it/KubernetesLookupIT.java b/log4j/src/test/java/io/fabric8/kubernetes/log4j/lookup/it/KubernetesLookupIT.java new file mode 100644 index 00000000000..3b1ecf5a217 --- /dev/null +++ b/log4j/src/test/java/io/fabric8/kubernetes/log4j/lookup/it/KubernetesLookupIT.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.fabric8.kubernetes.log4j.lookup.it; + +import io.fabric8.kubernetes.log4j.lookup.KubernetesLookup; +import org.apache.logging.log4j.core.config.plugins.util.PluginManager; +import org.apache.logging.log4j.core.config.plugins.util.PluginType; +import org.apache.logging.log4j.core.lookup.StrLookup; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class KubernetesLookupIT { + + @Test + void should_find_lookup() { + PluginManager manager = new PluginManager(StrLookup.CATEGORY); + manager.collectPlugins(); + PluginType pluginType = manager.getPluginType("k8s"); + assertThat(pluginType) + .as("check 'k8s' lookup") + .isNotNull() + .extracting(PluginType::getPluginClass) + .isEqualTo(KubernetesLookup.class); + } +}