Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: nacos/v1/ns/operator/switches接口失效 #8745

Closed
whl12345 opened this issue Jul 15, 2022 · 3 comments
Closed

Bug: nacos/v1/ns/operator/switches接口失效 #8745

whl12345 opened this issue Jul 15, 2022 · 3 comments
Labels
status/duplicate This issue or pull request already exists

Comments

@whl12345
Copy link

whl12345 commented Jul 15, 2022

2.1.0开源版本
nacos.core.support.upgrade.from.1x=false
当application配置文件这个开关关闭了,下面这个接口就没法动态改开关了,无法生效
PUT http://xxx:8848/nacos/v1/ns/operator/switches?entry=pushEnabled&value=false
接口返回ok
但是GET http://xxx:8848/nacos/v1/ns/operator/switches
pushEnabled=true

@whl12345
Copy link
Author

@GetMapping("/switches")
public SwitchDomain switches(HttpServletRequest request) {
    if (EnvUtil.isSupportUpgradeFrom1X()) {
        return switchDomain;
    }
    SwitchDomain result = new SwitchDomain();
    result.update(result);
    result.setDoubleWriteEnabled(false);
    return result;
}

这里get为啥要重新New对象,这样开关不是都成默认值了?

@YunWZ
Copy link
Contributor

YunWZ commented Jul 15, 2022

@KomachiSion SwitchDomain result = new SwitchDomain();这部分代码看起来好像没有做任何事情:update()方法是空的且result.update(result)让人感到困惑。

@KomachiSion
Copy link
Collaborator

Fixed by #8636

@KomachiSion KomachiSion added the status/duplicate This issue or pull request already exists label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants
@YunWZ @whl12345 @KomachiSion and others