Make order of KubernetesDiscoveryClient configurable - Fixes gh-537 (#538)
Co-authored-by: Stefan Rempfer <srempfer@rt.ipnt.de>
This commit is contained in:
@@ -280,4 +280,9 @@ public class KubernetesDiscoveryClient implements DiscoveryClient {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.properties.getOrder();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Set;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.core.style.ToStringCreator;
|
||||
|
||||
/**
|
||||
@@ -71,6 +72,8 @@ public class KubernetesDiscoveryProperties {
|
||||
|
||||
private Metadata metadata = new Metadata();
|
||||
|
||||
private int order = DiscoveryClient.DEFAULT_ORDER;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
@@ -135,6 +138,14 @@ public class KubernetesDiscoveryProperties {
|
||||
this.allNamespaces = allNamespaces;
|
||||
}
|
||||
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
public void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringCreator(this).append("enabled", this.enabled)
|
||||
|
||||
Reference in New Issue
Block a user