Merge remote-tracking branch 'origin/release-50' into 0202-merge-release-50-back-to-master

This commit is contained in:
Zaiming (Stone) Shi 2023-02-03 16:12:11 +01:00
commit ccb0c7ebaa
8 changed files with 33 additions and 29 deletions

View File

@ -4,13 +4,13 @@ concurrency:
group: relup-${{ github.event_name }}-${{ github.ref }} group: relup-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
on: # on:
push: # push:
branches: # branches:
- '**' # - '**'
tags: # tags:
- e* # - e*
pull_request: # pull_request:
jobs: jobs:
relup_test_plan: relup_test_plan:

View File

@ -325,7 +325,7 @@ is_self_auth_token(Username, Token) ->
end. end.
change_pwd(post, #{bindings := #{username := Username}, body := Params}) -> change_pwd(post, #{bindings := #{username := Username}, body := Params}) ->
LogMeta = #{msg => "Dashboard change password", username => Username}, LogMeta = #{msg => "Dashboard change password", username => binary_to_list(Username)},
OldPwd = maps:get(<<"old_pwd">>, Params), OldPwd = maps:get(<<"old_pwd">>, Params),
NewPwd = maps:get(<<"new_pwd">>, Params), NewPwd = maps:get(<<"new_pwd">>, Params),
case ?EMPTY(OldPwd) orelse ?EMPTY(NewPwd) of case ?EMPTY(OldPwd) orelse ?EMPTY(NewPwd) of

View File

@ -16,9 +16,9 @@ data:
EMQX_CLUSTER__K8S__SERVICE_NAME: {{ include "emqx.fullname" . }}-headless EMQX_CLUSTER__K8S__SERVICE_NAME: {{ include "emqx.fullname" . }}-headless
EMQX_CLUSTER__K8S__NAMESPACE: {{ .Release.Namespace }} EMQX_CLUSTER__K8S__NAMESPACE: {{ .Release.Namespace }}
EMQX_CLUSTER__K8S__ADDRESS_TYPE: "hostname" EMQX_CLUSTER__K8S__ADDRESS_TYPE: "hostname"
EMQX_CLUSTER__K8S__SUFFIX: "svc.cluster.local" EMQX_CLUSTER__K8S__SUFFIX: "svc.{{ .Values.clusterDomain }}"
{{- else if eq (.Values.emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY) "dns" }} {{- else if eq (.Values.emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY) "dns" }}
EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.cluster.local" EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
EMQX_CLUSTER__DNS__RECORD_TYPE: "srv" EMQX_CLUSTER__DNS__RECORD_TYPE: "srv"
{{- end -}} {{- end -}}
{{- range $index, $value := .Values.emqxConfig }} {{- range $index, $value := .Values.emqxConfig }}

View File

@ -35,6 +35,8 @@ serviceAccount:
## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change. ## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change.
recreatePods: false recreatePods: false
clusterDomain: cluster.local
podAnnotations: {} podAnnotations: {}
# Pod deployment policy # Pod deployment policy

View File

@ -16,9 +16,9 @@ data:
EMQX_CLUSTER__K8S__SERVICE_NAME: {{ include "emqx.fullname" . }}-headless EMQX_CLUSTER__K8S__SERVICE_NAME: {{ include "emqx.fullname" . }}-headless
EMQX_CLUSTER__K8S__NAMESPACE: {{ .Release.Namespace }} EMQX_CLUSTER__K8S__NAMESPACE: {{ .Release.Namespace }}
EMQX_CLUSTER__K8S__ADDRESS_TYPE: "hostname" EMQX_CLUSTER__K8S__ADDRESS_TYPE: "hostname"
EMQX_CLUSTER__K8S__SUFFIX: "svc.cluster.local" EMQX_CLUSTER__K8S__SUFFIX: "svc.{{ .Values.clusterDomain }}"
{{- else if eq (.Values.emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY) "dns" }} {{- else if eq (.Values.emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY) "dns" }}
EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.cluster.local" EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
EMQX_CLUSTER__DNS__RECORD_TYPE: "srv" EMQX_CLUSTER__DNS__RECORD_TYPE: "srv"
{{- end -}} {{- end -}}
{{- range $index, $value := .Values.emqxConfig }} {{- range $index, $value := .Values.emqxConfig }}

View File

@ -35,6 +35,8 @@ serviceAccount:
## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change. ## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change.
recreatePods: false recreatePods: false
clusterDomain: cluster.local
podAnnotations: {} podAnnotations: {}
# Pod deployment policy # Pod deployment policy

View File

@ -0,0 +1 @@
telemetry.enable = false

View File

@ -30,7 +30,7 @@ main(_) ->
case IsEnterprise of case IsEnterprise of
true -> true ->
EnterpriseCfgs = get_all_cfgs("lib-ee"), EnterpriseCfgs = get_all_cfgs("lib-ee"),
EnterpriseConf = merge("", EnterpriseCfgs), EnterpriseConf = merge(<<"">>, EnterpriseCfgs),
ok = file:write_file("apps/emqx_conf/etc/emqx-enterprise.conf.all", EnterpriseConf); ok = file:write_file("apps/emqx_conf/etc/emqx-enterprise.conf.all", EnterpriseConf);
false -> false ->
ok ok
@ -41,22 +41,21 @@ is_enterprise() ->
nomatch =/= string:find(Profile, "enterprise"). nomatch =/= string:find(Profile, "enterprise").
merge(BaseConf, Cfgs) -> merge(BaseConf, Cfgs) ->
lists:foldl( Confs = [BaseConf | lists:map(fun read_conf/1, Cfgs)],
fun(CfgFile, Acc) -> infix(lists:filter(fun(I) -> iolist_size(I) > 0 end, Confs), [io_lib:nl(), io_lib:nl()]).
case filelib:is_regular(CfgFile) of
true -> read_conf(CfgFile) ->
{ok, Bin1} = file:read_file(CfgFile), case filelib:is_regular(CfgFile) of
case string:trim(Bin1, both) of true ->
<<>> -> Acc; {ok, Bin1} = file:read_file(CfgFile),
Bin2 -> [Acc, io_lib:nl(), io_lib:nl(), Bin2] string:trim(Bin1, both);
end; false ->
false -> <<>>
Acc end.
end
end, infix([], _With) -> [];
BaseConf, infix([One], _With) -> [One];
Cfgs infix([H | T], With) -> [H, With, infix(T, With)].
).
get_all_cfgs(Root) -> get_all_cfgs(Root) ->
Apps0 = filelib:wildcard("*", Root) -- ["emqx_machine", "emqx_conf"], Apps0 = filelib:wildcard("*", Root) -- ["emqx_machine", "emqx_conf"],