Skip to content

Commit

Permalink
Hotfix issue 8350 (alibaba#8351)
Browse files Browse the repository at this point in the history
* optimization: in this case, renamed the variable definition

* optimization: in this case, renamed the variable definition

* optimization: revert the VipServer to Vipserver

* optimization: reverse vipServer changes

* optimization: recover renamed vipServer
  • Loading branch information
MisterChangRay authored May 12, 2022
1 parent 3998026 commit 4d8a762
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ private Map<String, String> getLabels() {
labels.put(RemoteConstants.LABEL_MODULE, RemoteConstants.LABEL_MODULE_CONFIG);
labels.put(Constants.APPNAME, AppNameUtils.getAppName());
labels.put(Constants.VIPSERVER_TAG, EnvUtil.getSelfVipserverTag());
labels.put(Constants.AMORY_TAG, EnvUtil.getSelfAmorayTag());
labels.put(Constants.AMORY_TAG, EnvUtil.getSelfAmoryTag());
labels.put(Constants.LOCATION_TAG, EnvUtil.getSelfLocationTag());

return labels;
Expand Down
22 changes: 11 additions & 11 deletions client/src/main/java/com/alibaba/nacos/client/utils/EnvUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ public class EnvUtil {

public static final Logger LOGGER = LogUtils.logger(EnvUtil.class);

private static String selfAmorayTag;
private static String selfAmoryTag;

private static String selfVipserverTag;

private static String selfLocationTag;

public static void setSelfEnv(Map<String, List<String>> headers) {
if (headers != null) {
List<String> amorayTagTmp = headers.get(Constants.AMORY_TAG);
if (amorayTagTmp == null) {
if (selfAmorayTag != null) {
selfAmorayTag = null;
List<String> amoryTagTmp = headers.get(Constants.AMORY_TAG);
if (amoryTagTmp == null) {
if (selfAmoryTag != null) {
selfAmoryTag = null;
LOGGER.warn("selfAmoryTag:null");
}
} else {
String amorayTagTmpStr = listToString(amorayTagTmp);
if (!amorayTagTmpStr.equals(selfAmorayTag)) {
selfAmorayTag = amorayTagTmpStr;
LOGGER.warn("selfAmoryTag:{}", selfAmorayTag);
String amoryTagTmpStr = listToString(amoryTagTmp);
if (!amoryTagTmpStr.equals(selfAmoryTag)) {
selfAmoryTag = amoryTagTmpStr;
LOGGER.warn("selfAmoryTag:{}", selfAmoryTag);
}
}

Expand Down Expand Up @@ -82,8 +82,8 @@ public static void setSelfEnv(Map<String, List<String>> headers) {
}
}

public static String getSelfAmorayTag() {
return selfAmorayTag;
public static String getSelfAmoryTag() {
return selfAmoryTag;
}

public static String getSelfVipserverTag() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void testSetSelfEnv() {
headers.put(Constants.VIPSERVER_TAG, Arrays.asList("b", "2"));
headers.put(Constants.LOCATION_TAG, Arrays.asList("c", "3"));
EnvUtil.setSelfEnv(headers);
Assert.assertEquals("a,1", EnvUtil.getSelfAmorayTag());
Assert.assertEquals("a,1", EnvUtil.getSelfAmoryTag());
Assert.assertEquals("b,2", EnvUtil.getSelfVipserverTag());
Assert.assertEquals("c,3", EnvUtil.getSelfLocationTag());
}
Expand Down

0 comments on commit 4d8a762

Please sign in to comment.