Tencent / spring-cloud-tencent

Spring Cloud Tencent is a Spring Cloud based Service Governance Framework provided by Tencent.
Other
3.19k stars 492 forks source link

无法推送修改后的配置到配置中心 #1054

Open ciot-plus opened 1 year ago

ciot-plus commented 1 year ago

Describe the bug 无法推送修改后的配置到配置中心

To Reproduce


        ConfigFileService configFileService = ConfigFileServiceFactory.createConfigFileService();
        ConfigFile configFile = configFileService.getConfigFile("message", "message", "test.yaml");
        String content = configFile.getContent();
        ConfigFilePublishService service = ConfigFileServicePublishFactory.createConfigFilePublishService();
        service.createConfigFile("message", "message", "abc.yaml", content);

报错: Request processing failed: java.lang.NullPointerException: Parameter specified as non-null is null: method

Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method okhttp3.Request$Builder.addHeader, parameter value at okhttp3.Request$Builder.addHeader(Request.kt) ~[okhttp-4.10.0.jar:na] at com.tencent.polaris.plugins.configuration.connector.polaris.rest.RestOperator.doPost(RestOperator.java:78) ~[polaris-configuration-connector-1.12.9.jar:na] at com.tencent.polaris.plugins.configuration.connector.polaris.OpenapiService.createConfigFile(OpenapiService.java:99) ~[polaris-configuration-connector-1.12.9.jar:na] at com.tencent.polaris.plugins.configuration.connector.polaris.OpenapiService.createConfigFile(OpenapiService.java:75) ~[polaris-configuration-connector-1.12.9.jar:na] at com.tencent.polaris.plugins.configuration.connector.polaris.PolarisConfigFileConnector.createConfigFile(PolarisConfigFileConnector.java:121) ~[polaris-configuration-connector-1.12.9.jar:na] at com.tencent.polaris.configuration.client.factory.DefaultConfigFilePublishFactory.createConfigFile(DefaultConfigFilePublishFactory.java:62) ~[polaris-configuration-client-1.12.9.jar:na] at com.tencent.polaris.configuration.client.internal.DefaultConfigFileManager.createConfigFile(DefaultConfigFileManager.java:105) ~[polaris-configuration-client-1.12.9.jar:na] at com.tencent.polaris.configuration.client.DefaultConfigFilePublishService.createConfigFile(DefaultConfigFilePublishService.java:54) ~[polaris-configuration-client-1.12.9.jar:na] at com.tencent.polaris.configuration.client.DefaultConfigFilePublishService.createConfigFile(DefaultConfigFilePublishService.java:48) ~[polaris-configuration-client-1.12.9.jar:na]

发现是未配置token导致的,手动设置token后,配置 spring.cloud.polaris.token 无效

Expected behavior 希望能在代码里面正常更新配置中心配置

Environment

Additional context

SkyeBeFreeman commented 1 year ago

目前版本暂未支持该功能,后续版本即将支持。