Skip to content

Commit df1e563

Browse files
authored
[ISSUE polarismesh#805] Feat issue 805 (polarismesh#836)
* fix issue polarismesh#629 (polarismesh#693) * docs:优化错误信息描述 * Update zh.toml * fix:修复eureka心跳协议错误码不兼容问题 * fix:修复eureka心跳协议错误码不兼容问题 * unit:添加单元测试 * test:调整测试配置文件位置 * fix:issue polarismesh#692 * fix:issue polarismesh#692 * fix:issue polarismesh#692 * fix:issue polarismesh#692 * docs:add error code desc * fix:调整license-checker的触发 * fix:调整license-checker的触发 * feat:issue polarismesh#805 * rollback code modify * rollback code modify * fix_client_check * fix:fix memory leak * none * fix:memory leak * none * none * none * none
1 parent 1ee83ed commit df1e563

File tree

110 files changed

+350
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+350
-490
lines changed

.github/workflows/integration-testing-mysql.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
# 清空数据
116116
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "DROP DATABASE IF EXISTS polaris_server";
117117
# 初始化 polaris 数据库
118-
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" < store/sqldb/scripts/polaris_server.sql
118+
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" < store/mysql/scripts/polaris_server.sql
119119
# 临时放开 DB 的最大连接数
120120
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "set GLOBAL max_connections = 3000;"
121121
@@ -138,7 +138,7 @@ jobs:
138138
sed -i 's/consoleOpen: \(true\|false\)/consoleOpen: false/g' polaris-server.yaml
139139
fi
140140
141-
cat polaris-server.yaml
141+
cat conf/polaris-server.yaml
142142
143143
chmod +x ./tool/*.sh
144144
./tool/start.sh

.github/workflows/integration-testing.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ jobs:
8888
if [[ "$(uname)" == "Darwin" ]]; then
8989
# Mac OS X 操作系统
9090
echo "Run on MacOS"
91-
sed -i '' 's/consoleOpen: true/consoleOpen: false/g' polaris-server.yaml
91+
sed -i '' 's/consoleOpen: true/consoleOpen: false/g' conf/polaris-server.yaml
9292
else
9393
# GNU/Linux操作系统
9494
echo "Run on Linux"
95-
sed -i 's/consoleOpen: \(true\|false\)/consoleOpen: false/g' polaris-server.yaml
95+
sed -i 's/consoleOpen: \(true\|false\)/consoleOpen: false/g' conf/polaris-server.yaml
9696
fi
9797
98-
cat polaris-server.yaml
98+
cat conf/polaris-server.yaml
9999
100100
chmod +x ./tool/*.sh
101101
./tool/start.sh

.licenserc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ header: # `header` section is configurations for source codes license header.
6868
- "deploy"
6969
- "**/*.proto"
7070
- "logo.svg"
71+
- "standalone"
72+
- "cluster"
7173
- "common/api/protoc"
7274
comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.
7375

apiserver/httpserver/http/handler_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import (
3333
)
3434

3535
func init() {
36-
i18n.LoadI18nMessageFile("../i18n/en.toml")
37-
i18n.LoadI18nMessageFile("../i18n/zh.toml")
36+
i18n.LoadI18nMessageFile("../../../conf/i18n/en.toml")
37+
i18n.LoadI18nMessageFile("../../../conf/i18n/zh.toml")
3838
}
3939

4040
func Test_i18n(t *testing.T) {

apiserver/httpserver/i18n/translate.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ var (
3838
func init() {
3939
bundle = ii18n.NewBundle(language.English)
4040
bundle.RegisterUnmarshalFunc("toml", toml.Unmarshal)
41-
LoadI18nMessageFile("apiserver/httpserver/i18n/zh.toml")
42-
LoadI18nMessageFile("apiserver/httpserver/i18n/en.toml")
41+
LoadI18nMessageFile("conf/i18n/zh.toml")
42+
LoadI18nMessageFile("conf/i18n/en.toml")
4343
}
4444

4545
// LoadI18nMessageFile 加载i18n配置文件

apiserver/httpserver/i18n/translate_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
)
2727

2828
func init() {
29-
LoadI18nMessageFile("en.toml")
30-
LoadI18nMessageFile("zh.toml")
29+
LoadI18nMessageFile("../../../conf/i18n/en.toml")
30+
LoadI18nMessageFile("../../../conf/i18n/zh.toml")
3131
}
3232

3333
func Test_Translate(t *testing.T) {

auth/defaultauth/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ import (
5252
"github.com/polarismesh/polaris/store"
5353
"github.com/polarismesh/polaris/store/boltdb"
5454
_ "github.com/polarismesh/polaris/store/boltdb"
55-
"github.com/polarismesh/polaris/store/sqldb"
56-
_ "github.com/polarismesh/polaris/store/sqldb"
55+
_ "github.com/polarismesh/polaris/store/mysql"
56+
sqldb "github.com/polarismesh/polaris/store/mysql"
5757
"github.com/polarismesh/polaris/testdata"
5858
)
5959

build.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,15 @@ export CGO_ENABLED=0
6363

6464
build_date=$(date "+%Y%m%d.%H%M%S")
6565
package="github.com/polarismesh/polaris-server/common/version"
66-
i18n_res="apiserver/httpserver/i18n"
67-
sqldb_res="store/sqldb"
66+
sqldb_res="store/mysql"
6867
go build -o ${bin_name} -ldflags="-X ${package}.Version=${version} -X ${package}.BuildDate=${build_date}"
6968

7069
# 打包
7170
mkdir -p ${folder_name}
7271
cp ${bin_name} ${folder_name}
7372
mkdir -p ${folder_name}/${sqldb_res}
74-
cp -r ${sqldb_res}/scripts ${folder_name}/${sqldb_res}
75-
cp polaris-server.yaml ${folder_name}
73+
cp -r ${sqldb_res}/scripts/* ${folder_name}/${sqldb_res}
7674
cp -r tool ${folder_name}/
77-
mkdir -p ${folder_name}/${i18n_res}
78-
cp -r ${i18n_res}/*.toml ${folder_name}/${i18n_res}
75+
cp -r conf ${folder_name}/
7976
zip -r "${pkg_name}" ${folder_name}
8077
md5sum ${pkg_name} >"${pkg_name}.md5sum"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

deploy/helm/templates/polaris-server-config.yaml cluster/helm/templates/config-polaris-server.yaml

+85-18
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ data:
1010
# 全局日志
1111
logger:
1212
config:
13-
rotateOutputPath: log/polaris-config.log
14-
errorRotateOutputPath: log/polaris-config-error.log
13+
rotateOutputPath: log/runtime/polaris-config.log
14+
errorRotateOutputPath: log/runtime/polaris-config-error.log
1515
rotationMaxSize: 100
1616
rotationMaxBackups: 10
1717
rotationMaxAge: 7
1818
outputLevel: info
1919
outputPaths:
20-
- stdout
20+
- stdout
2121
errorOutputPaths:
22-
- stderr
22+
- stderr
2323
auth:
24-
rotateOutputPath: log/polaris-auth.log
25-
errorRotateOutputPath: log/polaris-auth-error.log
24+
rotateOutputPath: log/runtime/polaris-auth.log
25+
errorRotateOutputPath: log/runtime/polaris-auth-error.log
2626
rotationMaxSize: 100
2727
rotationMaxBackups: 10
2828
rotationMaxAge: 7
@@ -32,8 +32,8 @@ data:
3232
errorOutputPaths:
3333
- stderr
3434
store:
35-
rotateOutputPath: log/polaris-store.log
36-
errorRotateOutputPath: log/polaris-store-error.log
35+
rotateOutputPath: log/runtime/polaris-store.log
36+
errorRotateOutputPath: log/runtime/polaris-store-error.log
3737
rotationMaxSize: 100
3838
rotationMaxBackups: 10
3939
rotationMaxAge: 7
@@ -43,8 +43,8 @@ data:
4343
errorOutputPaths:
4444
- stderr
4545
cache:
46-
rotateOutputPath: log/polaris-cache.log
47-
errorRotateOutputPath: log/polaris-cache-error.log
46+
rotateOutputPath: log/runtime/polaris-cache.log
47+
errorRotateOutputPath: log/runtime/polaris-cache-error.log
4848
rotationMaxSize: 100
4949
rotationMaxBackups: 10
5050
rotationMaxAge: 7
@@ -54,8 +54,8 @@ data:
5454
errorOutputPaths:
5555
- stderr
5656
naming:
57-
rotateOutputPath: log/polaris-naming.log
58-
errorRotateOutputPath: log/polaris-naming-error.log
57+
rotateOutputPath: log/runtime/polaris-naming.log
58+
errorRotateOutputPath: log/runtime/polaris-naming-error.log
5959
rotationMaxSize: 100
6060
rotationMaxBackups: 10
6161
rotationMaxAge: 7
@@ -65,8 +65,8 @@ data:
6565
errorOutputPaths:
6666
- stderr
6767
healthcheck:
68-
rotateOutputPath: log/polaris-healthcheck.log
69-
errorRotateOutputPath: log/polaris-healthcheck-error.log
68+
rotateOutputPath: log/runtime/polaris-healthcheck.log
69+
errorRotateOutputPath: log/runtime/polaris-healthcheck-error.log
7070
rotationMaxSize: 100
7171
rotationMaxBackups: 10
7272
rotationMaxAge: 7
@@ -76,8 +76,30 @@ data:
7676
errorOutputPaths:
7777
- stderr
7878
xdsv3:
79-
rotateOutputPath: log/polaris-xdsv3.log
80-
errorRotateOutputPath: log/polaris-xdsv3-error.log
79+
rotateOutputPath: log/runtime/polaris-xdsv3.log
80+
errorRotateOutputPath: log/runtime/polaris-xdsv3-error.log
81+
rotationMaxSize: 100
82+
rotationMaxBackups: 10
83+
rotationMaxAge: 7
84+
outputLevel: info
85+
outputPaths:
86+
- stdout
87+
errorOutputPaths:
88+
- stderr
89+
apiserver:
90+
rotateOutputPath: log/runtime/polaris-apiserver.log
91+
errorRotateOutputPath: log/runtime/polaris-apiserver-error.log
92+
rotationMaxSize: 100
93+
rotationMaxBackups: 10
94+
rotationMaxAge: 7
95+
outputLevel: info
96+
outputPaths:
97+
- stdout
98+
errorOutputPaths:
99+
- stderr
100+
token-bucket:
101+
rotateOutputPath: log/runtime/polaris-ratelimit.log
102+
errorRotateOutputPath: log/runtime/polaris-ratelimit-error.log
81103
rotationMaxSize: 100
82104
rotationMaxBackups: 10
83105
rotationMaxAge: 7
@@ -87,11 +109,56 @@ data:
87109
errorOutputPaths:
88110
- stderr
89111
default:
90-
rotateOutputPath: log/polaris-default.log
91-
errorRotateOutputPath: log/polaris-default-error.log
112+
rotateOutputPath: log/runtime/polaris-default.log
113+
errorRotateOutputPath: log/runtime/polaris-default-error.log
114+
rotationMaxSize: 100
115+
rotationMaxBackups: 10
116+
rotationMaxAge: 7
117+
outputLevel: info
118+
outputPaths:
119+
- stdout
120+
errorOutputPaths:
121+
- stderr
122+
discoverEventLocal:
123+
rotateOutputPath: log/event/polaris-discoverevent.log
124+
errorRotateOutputPath: log/polaris-discoverevent-error.log
125+
rotationMaxSize: 100
126+
rotationMaxBackups: 10
127+
rotationMaxAge: 7
128+
outputLevel: info
129+
outputPaths:
130+
- stdout
131+
errorOutputPaths:
132+
- stderr
133+
discoverLocal:
134+
rotateOutputPath: log/statis/polaris-discoverstat.log
135+
errorRotateOutputPath: log/statis/polaris-discoverstat-error.log
136+
rotationMaxSize: 100
137+
rotationMaxBackups: 10
138+
rotationMaxAge: 7
139+
outputLevel: info
140+
outputPaths:
141+
- stdout
142+
errorOutputPaths:
143+
- stderr
144+
local:
145+
rotateOutputPath: log/statis/polaris-statis.log
146+
errorRotateOutputPath: log/statis/polaris-statis-error.log
147+
rotationMaxSize: 100
148+
rotationMaxBackups: 10
149+
rotationMaxAge: 7
150+
outputLevel: info
151+
outputPaths:
152+
- stdout
153+
errorOutputPaths:
154+
- stderr
155+
HistoryLogger:
156+
rotateOutputPath: log/operation/polaris-history.log
157+
errorRotateOutputPath: log/operation/polaris-history-error.log
92158
rotationMaxSize: 100
93159
rotationMaxBackups: 10
94160
rotationMaxAge: 7
161+
rotationMaxDurationForHour: 24
95162
outputLevel: info
96163
outputPaths:
97164
- stdout
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)