|
4 | 4 | import java.util.concurrent.TimeUnit; |
5 | 5 | import java.util.function.Supplier; |
6 | 6 |
|
| 7 | +import io.fabric8.kubernetes.client.ConfigBuilder; |
7 | 8 | import org.junit.jupiter.api.Test; |
8 | 9 |
|
9 | 10 | import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; |
|
13 | 14 | import io.javaoperatorsdk.webhook.sample.commons.customresource.MultiVersionCustomResource; |
14 | 15 | import io.javaoperatorsdk.webhook.sample.commons.customresource.MultiVersionCustomResourceSpec; |
15 | 16 | import io.javaoperatorsdk.webhook.sample.commons.customresource.MultiVersionCustomResourceV2; |
| 17 | +import org.slf4j.Logger; |
| 18 | +import org.slf4j.LoggerFactory; |
16 | 19 |
|
17 | 20 | import static io.javaoperatorsdk.webhook.sample.commons.AdmissionControllers.MUTATION_TARGET_LABEL; |
18 | 21 | import static io.javaoperatorsdk.webhook.sample.commons.Utils.SPIN_UP_GRACE_PERIOD; |
|
25 | 28 | @SuppressWarnings("deprecation") |
26 | 29 | public abstract class AbstractEndToEndTest { |
27 | 30 |
|
28 | | - protected KubernetesClient client = new KubernetesClientBuilder().build(); |
| 31 | + private static final Logger log = LoggerFactory.getLogger(AbstractEndToEndTest.class); |
| 32 | + |
| 33 | + protected KubernetesClient client = new KubernetesClientBuilder().withConfig(new ConfigBuilder() |
| 34 | + .withNamespace("default").build()).build(); |
29 | 35 |
|
30 | 36 | public static final String TEST_CR_NAME = "test-cr"; |
31 | 37 | public static final int CR_SPEC_VALUE = 5; |
@@ -80,6 +86,7 @@ <T> T avoidRequestTimeout(Supplier<T> operator) { |
80 | 86 | try { |
81 | 87 | return operator.get(); |
82 | 88 | } catch (KubernetesClientException e) { |
| 89 | + log.warn("Applying resource. This might be expected.",e); |
83 | 90 | return null; |
84 | 91 | } |
85 | 92 | } |
|
0 commit comments