Make order of KubernetesDiscoveryClient configurable - Fixes gh-537 (#538)

Co-authored-by: Stefan Rempfer <srempfer@rt.ipnt.de>
This commit is contained in:
Stefan Rempfer
2020-03-31 22:31:24 +02:00
committed by GitHub
parent de84ced2c5
commit 6d1a4b0557
2 changed files with 16 additions and 0 deletions

View File

@@ -280,4 +280,9 @@ public class KubernetesDiscoveryClient implements DiscoveryClient {
.collect(Collectors.toList());
}
@Override
public int getOrder() {
return this.properties.getOrder();
}
}

View File

@@ -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)