Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.style.ToStringCreator;

Expand All @@ -33,10 +34,6 @@ public class KubernetesDiscoveryProperties {
/** If Kubernetes Discovery is enabled. */
private boolean enabled = true;

/** The service name of the local instance. */
@Value("${spring.application.name:unknown}")
private String serviceName = "unknown";

/** If discovering all namespaces. */
private boolean allNamespaces = false;

Expand Down Expand Up @@ -64,12 +61,7 @@ public class KubernetesDiscoveryProperties {
private String filter;

/** Set the port numbers that are considered secure and use HTTPS. */
private Set<Integer> knownSecurePorts = new HashSet<Integer>() {
{
add(443);
add(8443);
}
};
private Set<Integer> knownSecurePorts = Stream.of(443, 8443).collect(Collectors.toCollection(HashSet::new));

/**
* If set, then only the services matching these labels will be fetched from the
Expand All @@ -95,14 +87,6 @@ public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public String getServiceName() {
return this.serviceName;
}

public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}

public String getFilter() {
return this.filter;
}
Expand Down Expand Up @@ -185,15 +169,15 @@ public void setCacheLoadingTimeoutSeconds(long cacheLoadingTimeoutSeconds) {

@Override
public String toString() {
return new ToStringCreator(this).append("enabled", this.enabled).append("serviceName", this.serviceName)
.append("filter", this.filter).append("knownSecurePorts", this.knownSecurePorts)
.append("serviceLabels", this.serviceLabels).append("metadata", this.metadata).toString();
return new ToStringCreator(this).append("enabled", this.enabled).append("filter", this.filter)
.append("knownSecurePorts", this.knownSecurePorts).append("serviceLabels", this.serviceLabels)
.append("metadata", this.metadata).toString();
}

/**
* Metadata properties.
*/
public class Metadata {
public static class Metadata {

/**
* When set, the Kubernetes labels of the services will be included as metadata of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryClientHealthIndicatorInitializer;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
import org.springframework.cloud.kubernetes.fabric8.Fabric8AutoConfiguration;
import org.springframework.cloud.kubernetes.fabric8.registry.KubernetesRegistration;
import org.springframework.cloud.kubernetes.fabric8.registry.KubernetesServiceRegistry;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -72,16 +70,6 @@ public KubernetesClientServicesFunction servicesFunction(KubernetesDiscoveryProp
}
}

@Bean
public KubernetesServiceRegistry getServiceRegistry() {
return new KubernetesServiceRegistry();
}

@Bean
public KubernetesRegistration getRegistration(KubernetesClient client, KubernetesDiscoveryProperties properties) {
return new KubernetesRegistration(client, properties);
}

@Bean
public KubernetesDiscoveryProperties getKubernetesDiscoveryProperties() {
return new KubernetesDiscoveryProperties();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.