diff --git a/helm-chart/.gitlab-ci.yml b/helm-chart/.gitlab-ci.yml index 55c9c825..ce6f25e5 100644 --- a/helm-chart/.gitlab-ci.yml +++ b/helm-chart/.gitlab-ci.yml @@ -14,9 +14,9 @@ build-adapter-cm-generator: image: reg.mikumikumi.xyz/base/kaniko-builder:latest variables: BUILD_NO_CACHE: true -# rules: -# - changes: -# - helm-chart/adapter-cm-generator/** + rules: + - changes: + - helm-chart/adapter-cm-generator/** script: - export BUILD_CONTEXT=helm-chart/adapter-cm-generator - export TMP_DST=reg.mikumikumi.xyz/maibot/adapter-cm-generator @@ -31,9 +31,9 @@ build-core-webui-cm-sync: image: reg.mikumikumi.xyz/base/kaniko-builder:latest variables: BUILD_NO_CACHE: true -# rules: -# - changes: -# - helm-chart/core-webui-cm-sync/** + rules: + - changes: + - helm-chart/core-webui-cm-sync/** script: - export BUILD_CONTEXT=helm-chart/core-webui-cm-sync - export TMP_DST=reg.mikumikumi.xyz/maibot/core-webui-cm-sync @@ -46,15 +46,15 @@ build-core-webui-cm-sync: package-helm-chart: stage: package-helm-chart image: reg.mikumikumi.xyz/mirror/helm:latest -# rules: -# - changes: -# - helm-chart/files/** -# - helm-chart/templates/** -# - helm-chart/.gitignore -# - helm-chart/.helmignore -# - helm-chart/Chart.yaml -# - helm-chart/README.md -# - helm-chart/values.yaml + rules: + - changes: + - helm-chart/files/** + - helm-chart/templates/** + - helm-chart/.gitignore + - helm-chart/.helmignore + - helm-chart/Chart.yaml + - helm-chart/README.md + - helm-chart/values.yaml script: - export CHART_VERSION=$(cat helm-chart/Chart.yaml | grep '^version:' | cut -d' ' -f2) - helm registry login reg.mikumikumi.xyz --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD} diff --git a/helm-chart/templates/core/configmap-bot-config.yaml b/helm-chart/templates/core/configmap-bot-config.yaml index 447b3396..bc40e93a 100644 --- a/helm-chart/templates/core/configmap-bot-config.yaml +++ b/helm-chart/templates/core/configmap-bot-config.yaml @@ -1,4 +1,4 @@ -{{- if or .Release.IsInstall .Values.config.enable_config_override }} +{{- if or .Release.IsInstall (and .Values.core.webui.enabled .Values.config.enable_config_override_with_webui) (and (not .Values.core.webui.enabled) .Values.config.enable_config_override_without_webui) }} # 渲染规则: # 初次安装,或配置了覆盖规则 apiVersion: v1 diff --git a/helm-chart/templates/core/configmap-model-config.yaml b/helm-chart/templates/core/configmap-model-config.yaml index 97c435ff..3ce7d95e 100644 --- a/helm-chart/templates/core/configmap-model-config.yaml +++ b/helm-chart/templates/core/configmap-model-config.yaml @@ -1,4 +1,4 @@ -{{- if or .Release.IsInstall .Values.config.enable_config_override }} +{{- if or .Release.IsInstall (and .Values.core.webui.enabled .Values.config.enable_config_override_with_webui) (and (not .Values.core.webui.enabled) .Values.config.enable_config_override_without_webui) }} # 渲染规则: # 初次安装,或配置了覆盖规则 apiVersion: v1 diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index c9ac969a..e8491eb6 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -212,9 +212,11 @@ sqlite_web: config: # 启用WebUI后,配置文件的修改即可在WebUI进行。如果通过WebUI修改了配置,则实际的配置文件将与values中的配置存在差异。 - # 为了避免helm升级麦麦时,下面values中的配置覆盖掉已有的配置文件而导致配置丢失,可以在这里禁止本次部署时的配置覆盖。 + # 如果用户在k8s的ConfigMap中手动修改了配置文件,则实际的配置文件也会与values中的配置存在差异。 + # 出现上述两种情况时,为了避免helm升级麦麦时,下面values中的配置覆盖掉已有的配置文件而导致配置丢失,可以在这里禁止本次部署时的配置覆盖。 # 注:由于adapter的配置无法通过WebUI修改,因此下面的adapter_config配置仍然会覆盖已有配置文件。 - enable_config_override: true # 要禁止覆盖,修改为false + enable_config_override_without_webui: true # 未启用WebUI时,默认覆盖 + enable_config_override_with_webui: false # 启用WebUI时,默认不覆盖 # adapter的config.toml adapter_config: |