Skip to content
51 changes: 51 additions & 0 deletions helm/templates/secret-workloads.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Workload Secrets referenced by the backend Deployment, worker Deployment, and
migration Job. These hold the credentials the application pods consume directly:
- <fullname>-db (key: postgres-password) — only when db.type == "postgres"
- <fullname>-minio (key: secret-key) — only when minio.enabled

Gated identically to the secretKeyRef usages so `helm template` renders coherently
with default values. Values are seeded from values.yaml (db.postgres.password,
minio.secretKey) so they stay in sync with the bundled subcharts; when unset they
fall back to an existing in-cluster value (idempotent on upgrade) or a fresh random,
so no install-time --set wiring is required.
*/}}
{{- if eq .Values.db.type "postgres" }}
{{- $dbSecret := lookup "v1" "Secret" .Release.Namespace (printf "%s-db" (include "open-git.fullname" .)) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "open-git.fullname" . }}-db
labels:
{{- include "open-git.labels" . | nindent 4 }}
app.kubernetes.io/component: db
type: Opaque
data:
{{- if .Values.db.postgres.password }}
postgres-password: {{ .Values.db.postgres.password | b64enc | quote }}
{{- else if and $dbSecret (index $dbSecret.data "postgres-password") }}
postgres-password: {{ index $dbSecret.data "postgres-password" | quote }}
{{- else }}
postgres-password: {{ randAlphaNum 32 | b64enc | quote }}
{{- end }}
{{- end }}
{{- if .Values.minio.enabled }}
{{- $minioSecret := lookup "v1" "Secret" .Release.Namespace (printf "%s-minio" (include "open-git.fullname" .)) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "open-git.fullname" . }}-minio
labels:
{{- include "open-git.labels" . | nindent 4 }}
app.kubernetes.io/component: minio
type: Opaque
data:
{{- if .Values.minio.secretKey }}
secret-key: {{ .Values.minio.secretKey | b64enc | quote }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 [high] Secret キー名が Task 指定と不一致

Task では単一 Secret 内のキー名として db-passwordminio-root-password が指定されていますが、diff では別 Secret 名・別キー名を使用しています。Task Step 4 が secretKeyRef.key: db-password / minio-root-password を前提としている場合、生成される Secret と Deployment 参照が一致せず env 注入に失敗します。

該当箇所:

  postgres-password: {{ .Values.db.postgres.password | b64enc | quote }}
...
  secret-key: {{ .Values.minio.secretKey | b64enc | quote }}

Task 指定: db-password, minio-root-password

@@ -24,1 +24,1 @@
-  postgres-password: {{ .Values.db.postgres.password | b64enc | quote }}
+  db-password: {{ .Values.db.postgres.password | b64enc | quote }}
@@ -45,1 +45,1 @@
-  secret-key: {{ .Values.minio.secretKey | b64enc | quote }}
+  minio-root-password: {{ .Values.minio.secretKey | b64enc | quote }}

code.logic.secret_key_name_mismatch | confidence: 0.88

{{- else if and $minioSecret (index $minioSecret.data "secret-key") }}
secret-key: {{ index $minioSecret.data "secret-key" | quote }}
{{- else }}
secret-key: {{ randAlphaNum 32 | b64enc | quote }}
{{- end }}
{{- end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 [critical] Task 指定の jwt-secret が Secret テンプレートに存在しない

Task Step 2 および Verification Checklist では Secret に jwt-secret / db-password / minio-root-password の 3 キーが必要です。diff 上のテンプレートは postgres 用と minio 用の 2 Secret のみを条件付きで生成しており、jwt-secret を作成するブロックがありません。Deployment が JWT_SECRETsecretKeyRef で参照する変更(Task Step 4)とセットでマージされる前提なら、インストール時に Secret が存在せず Pod 起動が失敗します。

該当箇所:

{{- if eq .Values.db.type "postgres" }}
...
  postgres-password: {{ .Values.db.postgres.password | b64enc | quote }}
...
{{- end }}
{{- if .Values.minio.enabled }}
...
  secret-key: {{ .Values.minio.secretKey | b64enc | quote }}
...
{{- end }}

code.logic.missing_secret_key | confidence: 0.90

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 [high] PR スコープが Task / PR タイトルと一致しない

PR タイトルおよび Task Goal では pvc.yaml / secret.yaml / configmap.yaml の追加と deployment.yamlvalues.yaml の更新が求められていますが、提供 diff には secret-workloads.yaml の新規追加のみが含まれています。Task で必須とされた PVC・ConfigMap・Deployment 参照の変更が diff 上に存在せず、縦串要件を満たしていません。

該当箇所:

{{/*
Workload Secrets referenced by the backend Deployment, worker Deployment, and
migration Job. These hold the credentials the application pods consume directly:
  - <fullname>-db    (key: postgres-password) — only when db.type == "postgres"
  - <fullname>-minio (key: secret-key)        — only when minio.enabled
...
{{- end }}

maintainability.requirements.prd_mismatch | confidence: 0.95

Loading