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

Completion of possible default configuration file name types #2192

Closed

Conversation

TomShiDi
Copy link

问题说明

假设有一个配置文件名为tomshidi-application-dev,未指定后缀
此时prefix未配置,
spring.application.name=tomshidi-application,
spring.profiles.active=dev,
file-extension=yaml
其他配置项这里不展开说明了
在该段处理逻辑中,会组装dataId查询nacos配置库,组装结果为以下三种:

  1. tomshidi-application
  2. tomshidi-application.yaml
  3. tomshidi-application-dev.yaml
    没有 tomshidi-application-dev 这个dataId,导致无法加载配置项

修复前运行结果

修复前

修复后运行结果

修复后

@CLAassistant
Copy link

CLAassistant commented Jul 28, 2021

CLA assistant check
All committers have signed the CLA.

@zkzlx
Copy link
Collaborator

zkzlx commented Jan 26, 2022

this compatible implementation is not really recommended. the rule for loading configurations is broken.
you ca do this in an extension that lets user choose one . thank you for your help.

@TomShiDi
Copy link
Author

got it

@steverao steverao closed this Mar 7, 2022
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.47%. Comparing base (f1ef409) to head (780a41c).
Report is 402 commits behind head on 2.2.x.

Additional details and impacted files
@@            Coverage Diff             @@
##            2.2.x    #2192      +/-   ##
==========================================
+ Coverage   28.44%   28.47%   +0.03%     
==========================================
  Files         245      245              
  Lines        7083     7086       +3     
  Branches      796      797       +1     
==========================================
+ Hits         2015     2018       +3     
  Misses       4902     4902              
  Partials      166      166              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants