-
Notifications
You must be signed in to change notification settings - Fork 8
Adapt for memos 0.30.0 #5
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
26cc42a
75e8101
f86fdb3
0579b67
93f151b
d29bae0
dbb5a4c
cb7354a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,9 @@ spec: | |
| {{- include "memos.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| {{- with .Values.podAnnotations }} | ||
| annotations: | ||
| checksum/settings: {{ include (print $.Template.BasePath "/settings.yaml") . | sha256sum }} | ||
| {{- with .Values.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
|
|
@@ -35,7 +36,12 @@ spec: | |
| claimName: {{ .Values.persistence.existPersistClaim | default (include "memos.fullname" .) }} | ||
| {{- else }} | ||
| emptyDir: { } | ||
| {{ end }} | ||
| {{- end }} | ||
| {{- if .Values.settings.enabled }} | ||
| - name: settings | ||
| configMap: | ||
| name: {{ include "memos.fullname" . }} | ||
| {{- end }} | ||
| containers: | ||
| - name: {{ .Chart.Name }} | ||
| securityContext: | ||
|
|
@@ -57,10 +63,34 @@ spec: | |
| volumeMounts: | ||
| - name: memos-data | ||
| mountPath: /var/opt/memos | ||
| {{- if .Values.settings.enabled }} | ||
| - name: settings | ||
| mountPath: /etc/secrets | ||
| readOnly: true | ||
| {{- end }} | ||
| # avoid * cannot parse 'Port' as int: strconv.ParseInt: parsing "tcp://10.233.40.219:5230": invalid syntax | ||
| env: | ||
| - name: MEMOS_PORT | ||
| value: "{{ .Values.service.port }}" | ||
| - name: MEMOS_LOG_LEVEL | ||
| value: {{ .Values.instance.logLevel | quote }} | ||
| - name: MEMOS_DRIVER | ||
| value: {{ .Values.database.driver | quote }} | ||
| {{- if .Values.database.connectionString }} | ||
| - name: MEMOS_DSN | ||
| value: {{ .Values.database.connectionString }} | ||
| {{- end }} | ||
| {{- if .Values.database.existingSecret }} | ||
| - name: MEMOS_DSN | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.database.existingSecret.name }} | ||
| key: {{ .Values.database.existingSecret.key }} | ||
| {{- end }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🌐 Web query:
💡 Result: According to the Kubernetes API documentation and established behavior, when a container's environment variable list (env) contains multiple entries with the same name, the values defined in the env list take precedence over values defined in envFrom [1][2][3]. While Kubernetes allows these duplicates to be persisted, they are generally discouraged [4][5]. The behavior associated with duplicate env entries is as follows: 1. Precedence: Values defined explicitly in the env list take precedence over those defined via envFrom [1][2][3]. 2. Patching and Updates: The presence of duplicate names in the env list can cause significant issues with kubectl apply and other patching mechanisms [4][5]. Because the env list uses the name field as a merge key, these tools often treat the key as ambiguous [5]. Consequently, attempting to update or remove one duplicate entry can result in all entries with that name being deleted or cause patch errors [4][5][6][7]. 3. Validation: Historically, Kubernetes has not strictly enforced uniqueness for the name field within the env list at the API level, allowing such configurations to be created and run [7]. However, it is strongly recommended to avoid duplicate names to prevent unexpected application behavior and operational issues with tooling [4][5]. Users are advised to maintain unique names for all environment variables within a container's configuration [4][5]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== locate deployment.yaml and values docs =="
fd -a 'deployment.yaml|README|values\.yaml|\.yaml$' . | sed 's#^\./##' | head -200
echo
echo "== templates/deployment.yaml relevant section =="
if [ -f templates/deployment.yaml ]; then
nl -ba templates/deployment.yaml | sed -n '60,105p'
else
fd -a 'deployment.yaml' .
fi
echo
echo "== search MEMOS_DSN and database values doc =="
rg -n "MEMOS_DSN|database:|existingSecret|connectionString|existingSecret:" -S .Repository: usememos/helm Length of output: 774 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== templates/deployment.yaml relevant section =="
sed -n '60,105p' templates/deployment.yaml
echo
echo "== search MEMOS_DSN and database values doc =="
rg -n "MEMOS_DSN|database:|existingSecret|connectionString|existingSecret:" -S .
echo
echo "== values.yaml database section =="
sed -n '1,160p' values.yamlRepository: usememos/helm Length of output: 5939 Make
🤖 Prompt for AI Agents |
||
| {{- if .Values.instance.url }} | ||
| - name: MEMOS_INSTANCE_URL | ||
| value: {{ .Values.instance.url }} | ||
| {{- end }} | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
| {{- with .Values.nodeSelector }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| {{- if .Values.httpRoute.enabled -}} | ||
| {{- $fullName := include "memos.fullname" . -}} | ||
| {{- $svcPort := .Values.service.port -}} | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | ||
| metadata: | ||
| name: {{ $fullName }} | ||
| labels: | ||
| {{- include "memos.labels" . | nindent 4 }} | ||
| {{- with .Values.httpRoute.annotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| parentRefs: | ||
| {{- with .Values.httpRoute.parentRefs }} | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.httpRoute.hostnames }} | ||
| hostnames: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| rules: | ||
| {{- range .Values.httpRoute.rules }} | ||
| {{- with .matches }} | ||
| - matches: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .filters }} | ||
| filters: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| backendRefs: | ||
| - name: {{ $fullName }} | ||
| port: {{ $svcPort }} | ||
| weight: 1 | ||
| {{- end }} | ||
|
RobSlgm marked this conversation as resolved.
|
||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| {{- if .Values.settings.enabled -}} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "memos.fullname" . }} | ||
| labels: | ||
| {{- include "memos.labels" . | nindent 4 }} | ||
| data: | ||
| {{- if .Values.settings.general }} | ||
| memos-instance-setting-general.json: > | ||
| {{- .Values.settings.general | toJson | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.settings.idps }} | ||
| {{- range $idp := .Values.settings.idps }} | ||
| memos-idp-{{- $idp.name -}}.json: > | ||
| {{- $idp.config | toJson | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if .Values.settings.storage }} | ||
| memos-instance-setting-storage.json: > | ||
| {{- .Values.settings.storage | toJson | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.settings.memo }} | ||
| memos-instance-setting-memo-related.json: > | ||
| {{- .Values.settings.memo | toJson | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.settings.notification }} | ||
| memos-instance-setting-notification.json: > | ||
| {{- .Values.settings.notification | toJson | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.settings.ai }} | ||
| memos-instance-setting-ai.json: > | ||
| {{- .Values.settings.ai | toJson | nindent 4 }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| {{- end }} | ||
| {{- end }} | ||
Uh oh!
There was an error while loading. Please reload this page.