From b90e6119f7c1a512a1aba8a6651914cbd5e6d9b3 Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:48:59 -0800 Subject: [PATCH 1/2] chore: remove images entirely from charts --- charts/crunchy/templates/PostgresCluster.yaml | 6 ------ charts/crunchy/values.yaml | 4 ---- 2 files changed, 10 deletions(-) diff --git a/charts/crunchy/templates/PostgresCluster.yaml b/charts/crunchy/templates/PostgresCluster.yaml index 70f643a74..17856d2a7 100644 --- a/charts/crunchy/templates/PostgresCluster.yaml +++ b/charts/crunchy/templates/PostgresCluster.yaml @@ -7,9 +7,6 @@ metadata: spec: metadata: labels: {{ include "crunchy-postgres.labels" . | nindent 6 }} - {{ if .Values.crunchy.crunchyImage }} - image: {{ .Values.crunchy.crunchyImage }} - {{ end }} imagePullPolicy: {{.Values.crunchy.imagePullPolicy}} postgresVersion: {{ .Values.crunchy.postgresVersion }} {{ if .Values.crunchy.postGISVersion }} @@ -115,9 +112,6 @@ spec: {{- if .Values.crunchy.pgBackRest.enabled }} backups: pgbackrest: - {{ if .Values.crunchy.pgBackRest.image }} - image: {{ .Values.crunchy.pgBackRest.image }} - {{ end }} {{- if .Values.crunchy.pgBackRest.s3.enabled}} configuration: - secret: diff --git a/charts/crunchy/values.yaml b/charts/crunchy/values.yaml index 748288961..3703dc9f5 100644 --- a/charts/crunchy/values.yaml +++ b/charts/crunchy/values.yaml @@ -3,8 +3,6 @@ global: dbName: app #test crunchy: # enable it for TEST and PROD, for PR based pipelines simply use single postgres enabled: true - # it is recommended by platform team , not to use explicit images - #crunchyImage: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-postgres-gis:ubi8-16.2-3.4-0 postgresVersion: 16 postGISVersion: '3.4' imagePullPolicy: IfNotPresent @@ -49,8 +47,6 @@ crunchy: # enable it for TEST and PROD, for PR based pipelines simply use single enabled: true backupPath: /backups/test/cluster/version # change it for PROD, create values-prod.yaml clusterCounter: 1 # this is the number to identify what is the current counter for the cluster, each time it is cloned it should be incremented. - # it is recommended by platform team , not to use explicit images - # image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-pgbackrest:ubi8-2.49-0 # If retention-full-type set to 'count' then the oldest backups will expire when the number of backups reach the number defined in retention # If retention-full-type set to 'time' then the number defined in retention will take that many days worth of full backups before expiration retentionFullType: count From f3dfacace7fccb75362237025599eb018881557f Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:56:08 -0800 Subject: [PATCH 2/2] chore: fix multiple instance of prisma client --- backend/src/prisma.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/prisma.service.ts b/backend/src/prisma.service.ts index 8444c4407..6a844dc89 100644 --- a/backend/src/prisma.service.ts +++ b/backend/src/prisma.service.ts @@ -12,8 +12,11 @@ const dataSourceURL = `postgresql://${DB_USER}:${DB_PWD}@${DB_HOST}:${DB_PORT}/$ @Injectable() class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy { private logger = new Logger("PRISMA"); - + private static instance: PrismaService; constructor() { + if (PrismaService.instance) { + return PrismaService.instance; + } super({ errorFormat: 'pretty', datasources: { @@ -28,7 +31,7 @@ class PrismaService extends PrismaClient im { emit: 'stdout', level: 'error' }, ] }); - + PrismaService.instance = this; }