<commit_before>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hydra.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
{{ include "hydra.labels" . | indent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "hydra.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "hydra.name" . }}
        app.kubernetes.io/instance: {{ .Release.Name }}
      {{- with .Values.deployment.annotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
    spec:
    {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- if .Values.hydra.autoMigrate }}
      initContainers:
        - name: {{ .Chart.Name }}-automigrate
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          command: ["hydra"]
          args: ["migrate", "sql", "-e", "--yes"]
          env:
            - name: DSN
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: dsn
    {{- end}}
      volumes:
        - name: {{ include "hydra.name" . }}-config-volume
          configMap:
            name: {{ include "hydra.fullname" . }}
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          command: ["hydra"]
          volumeMounts:
            - name: {{ include "hydra.name" . }}-config-volume
              mountPath: /etc/config
              readOnly: true
          args: [
            "serve",
            "all",
            {{- if .Values.hydra.dangerousForceHttp }}
            "--dangerous-force-http",
            {{- end}}
            {{- if .Values.hydra.dangerousAllowInsecureRedirectUrls }}
            "--dangerous-allow-insecure-redirect-urls",
            {{ include "hydra.utils.joinListWithComma" .Values.hydra.dangerousAllowInsecureRedirectUrls | quote }},
            {{- end}}
            "--config",
            "/etc/config/config.yaml"
          ]
          ports:
            - name: http-public
              containerPort: 4444
              protocol: TCP
            - name: http-admin
              containerPort: 4445
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /health/alive
              port: http-admin
            initialDelaySeconds: 30
            periodSeconds: 10
            failureThreshold: 5
          readinessProbe:
            httpGet:
              path: /health/ready
              port: http-admin
            initialDelaySeconds: 30
            periodSeconds: 10
            failureThreshold: 5
          env:
            {{- $issuer := include "hydra.config.urls.issuer" . -}}
            {{- if $issuer }}
            - name: URLS_SELF_ISSUER
              value: {{ $issuer | quote }}
            {{- end }}
            - name: DSN
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: dsn
            - name: SECRETS_SYSTEM
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: secretsSystem
            - name: SECRETS_COOKIE
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: secretsCookie
          resources:
            {{- toYaml .Values.deployment.resources | nindent 12 }}
      {{- with .Values.deployment.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
    {{- with .Values.affinity }}
    affinity:
      {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- with .Values.deployment.tolerations }}
    tolerations:
      {{- toYaml . | nindent 8 }}
    {{- end }}
<commit_msg>fix: automigrate crashing without config given (#56)<commit_after>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hydra.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
{{ include "hydra.labels" . | indent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "hydra.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "hydra.name" . }}
        app.kubernetes.io/instance: {{ .Release.Name }}
      {{- with .Values.deployment.annotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
    spec:
    {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- if .Values.hydra.autoMigrate }}
      initContainers:
        - name: {{ .Chart.Name }}-automigrate
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          command: ["hydra"]
          args: ["migrate", "sql", "-e", "--yes", "--config", "/etc/config/config.yaml"]
          volumeMounts:
            - name: {{ include "hydra.name" . }}-config-volume
              mountPath: /etc/config
              readOnly: true
          env:
            - name: DSN
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: dsn
    {{- end}}
      volumes:
        - name: {{ include "hydra.name" . }}-config-volume
          configMap:
            name: {{ include "hydra.fullname" . }}
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          command: ["hydra"]
          volumeMounts:
            - name: {{ include "hydra.name" . }}-config-volume
              mountPath: /etc/config
              readOnly: true
          args: [
            "serve",
            "all",
            {{- if .Values.hydra.dangerousForceHttp }}
            "--dangerous-force-http",
            {{- end}}
            {{- if .Values.hydra.dangerousAllowInsecureRedirectUrls }}
            "--dangerous-allow-insecure-redirect-urls",
            {{ include "hydra.utils.joinListWithComma" .Values.hydra.dangerousAllowInsecureRedirectUrls | quote }},
            {{- end}}
            "--config",
            "/etc/config/config.yaml"
          ]
          ports:
            - name: http-public
              containerPort: 4444
              protocol: TCP
            - name: http-admin
              containerPort: 4445
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /health/alive
              port: http-admin
            initialDelaySeconds: 30
            periodSeconds: 10
            failureThreshold: 5
          readinessProbe:
            httpGet:
              path: /health/ready
              port: http-admin
            initialDelaySeconds: 30
            periodSeconds: 10
            failureThreshold: 5
          env:
            {{- $issuer := include "hydra.config.urls.issuer" . -}}
            {{- if $issuer }}
            - name: URLS_SELF_ISSUER
              value: {{ $issuer | quote }}
            {{- end }}
            - name: DSN
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: dsn
            - name: SECRETS_SYSTEM
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: secretsSystem
            - name: SECRETS_COOKIE
              valueFrom:
                secretKeyRef:
                  name: {{ include "hydra.fullname" . }}
                  key: secretsCookie
          resources:
            {{- toYaml .Values.deployment.resources | nindent 12 }}
      {{- with .Values.deployment.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
    {{- with .Values.affinity }}
    affinity:
      {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- with .Values.deployment.tolerations }}
    tolerations:
      {{- toYaml . | nindent 8 }}
    {{- end }}

{'fraction_non_alphanumeric': 0.13463126843657816, 'fraction_numerical': 0.006607669616519174, 'mean_word_length': 1.4038570618264323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4430277', 'n_tokens_mistral': 2516, 'n_tokens_neox': 2380, 'n_words': 465}