|
|
|
@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import com.tencent.cloud.common.metadata.MetadataContext;
|
|
|
|
|
import com.tencent.cloud.common.pojo.PolarisServiceInstance;
|
|
|
|
|
import com.tencent.polaris.api.pojo.DefaultInstance;
|
|
|
|
|
import com.tencent.polaris.api.pojo.DefaultServiceInstances;
|
|
|
|
|
import com.tencent.polaris.api.pojo.Instance;
|
|
|
|
@ -57,6 +58,14 @@ public final class LoadBalancerUtils {
|
|
|
|
|
instance.setPort(serviceInstance.getPort());
|
|
|
|
|
instance.setWeight(100);
|
|
|
|
|
instance.setMetadata(serviceInstance.getMetadata());
|
|
|
|
|
|
|
|
|
|
if (serviceInstance instanceof PolarisServiceInstance) {
|
|
|
|
|
PolarisServiceInstance polarisServiceInstance = (PolarisServiceInstance) serviceInstance;
|
|
|
|
|
instance.setRegion(polarisServiceInstance.getPolarisInstance().getRegion());
|
|
|
|
|
instance.setZone(polarisServiceInstance.getPolarisInstance().getZone());
|
|
|
|
|
instance.setCampus(polarisServiceInstance.getPolarisInstance().getCampus());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return instance;
|
|
|
|
|
}).collect(Collectors.toList()));
|
|
|
|
|
});
|
|
|
|
|