Skip to content

Commit

Permalink
Remove annotation and related post processor
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Syer <dsyer@vmware.com>
  • Loading branch information
dsyer committed Feb 1, 2021
1 parent 46f55e4 commit fc56709
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 202 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -12,22 +12,27 @@
*/
package io.kubernetes.client.spring.extended.network.endpoints;

import java.time.Duration;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;

import io.kubernetes.client.apimachinery.NamespaceName;
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.apis.CoreV1Api;
import io.kubernetes.client.openapi.models.V1Endpoints;
import java.time.Duration;
import org.springframework.beans.factory.annotation.Autowired;

public class PollingEndpointsGetter implements EndpointsGetter {

private static final Cache<NamespaceName, V1Endpoints> lastObservedEndpoints =
Caffeine.newBuilder().expireAfterWrite(Duration.ofMinutes(5)).build();

@Autowired private ApiClient apiClient;
private final ApiClient apiClient;

public PollingEndpointsGetter(ApiClient apiClient) {
this.apiClient = apiClient;
}

@Override
public V1Endpoints get(String namespace, String name) {
Expand Down
1 change: 0 additions & 1 deletion spring/src/main/resources/META-INF/spring.factories
@@ -1,5 +1,4 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
io.kubernetes.client.spring.extended.controller.config.KubernetesInformerAutoConfiguration, \
io.kubernetes.client.spring.extended.controller.config.KubernetesReconcilerAutoConfiguration, \
io.kubernetes.client.spring.extended.network.config.KubernetesLoadBalancerAutoConfiguration, \
io.kubernetes.client.spring.extended.manifests.config.KubernetesManifestsAutoConfiguration
Expand Up @@ -22,8 +22,21 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.util.Arrays;

import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.google.gson.Gson;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;

import io.kubernetes.client.informer.SharedInformer;
import io.kubernetes.client.informer.SharedInformerFactory;
import io.kubernetes.client.informer.cache.Lister;
Expand All @@ -38,16 +51,6 @@
import io.kubernetes.client.spring.extended.controller.annotation.KubernetesInformer;
import io.kubernetes.client.spring.extended.controller.annotation.KubernetesInformers;
import io.kubernetes.client.util.ClientBuilder;
import java.util.Arrays;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {KubernetesInformerCreatorTest.App.class})
Expand Down Expand Up @@ -99,8 +102,6 @@ static class TestSharedInformerFactory extends SharedInformerFactory {}

@Autowired private Lister<V1ConfigMap> configMapLister;

@Autowired private ApiClient apiClient;

@Test
public void testInformerInjection() throws InterruptedException {
assertNotNull(podInformer);
Expand Down
Expand Up @@ -12,12 +12,7 @@
*/
package io.kubernetes.client.spring.extended.network;

import io.kubernetes.client.spring.extended.network.config.KubernetesLoadBalancerAutoConfiguration;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;

@SpringBootConfiguration
@ImportAutoConfiguration({
KubernetesLoadBalancerAutoConfiguration.class,
})
public class TestApplication {}

0 comments on commit fc56709

Please sign in to comment.