Skip to content
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

fix: chart fixes for upstream #1306

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ spec:
labels:
{{- include "canary-checker.labels" . | nindent 10 }}
spec:
{{- if not (eq .Values.db.embedded.storageClass "") }}
storageClassName: {{ .Values.db.embedded.storageClass }}
{{- end }}
accessModes: ["ReadWriteOnce"]
resources:
requests:
Expand Down Expand Up @@ -96,7 +98,7 @@ spec:
{{- if .Values.upstream.enabled }}
envFrom:
- secretRef:
name: {{ include "canary-checker.name" . }}
name: {{ .Values.upstream.secretKeyRef.name }}
{{- end }}
volumeMounts:
{{- if eq .Values.dockerSocket true }}
Expand Down Expand Up @@ -140,7 +142,7 @@ spec:
{{- end }}
{{- if .Values.upstream.enabled }}
- --agent-name={{ .Values.upstream.agentName }}
- --upstream-host={{ .Values.upstream.host }}
- --upstream-host=$UPSTREAM_HOST
- --upstream-user=$UPSTREAM_USER
- --upstream-password=$UPSTREAM_PASSWORD
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/postgres-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ spec:
name: postgresql
spec:
accessModes: ["ReadWriteOnce"]
{{- if not (eq .Values.db.external.storageClass "") }}
storageClassName: {{ .Values.db.external.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.db.external.storage }}
Expand Down
9 changes: 0 additions & 9 deletions chart/templates/secret.yaml

This file was deleted.

12 changes: 6 additions & 6 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ db:
# If the database is embedded, setting this to true will persist the contents of the database
# through a persistent volume
persist: false
storageClass:
storageClass: ""
storage: 20Gi
external:
# Setting enabled to true will use a external postgres DB, disabling the embedded DB
Expand All @@ -54,7 +54,7 @@ db:
# this is the key it will look for in the secret(if secretRefKey is
# mentioned). The name of the key is mandatory to set.
key: DB_URL
storageClass:
storageClass: ""
storage: 20Gi

nameOverride: ""
Expand All @@ -72,10 +72,10 @@ data:

upstream:
enabled: false
host: ""
agentName: ""
username: ""
password: ""
agentName: default-agent
# Must contain: UPSTREAM_USER, UPSTREAM_PASS & UPSTREAM_HOST
secretKeyRef:
name: canary-checker-upstream

ingress:
enabled: false
Expand Down
9 changes: 2 additions & 7 deletions pkg/db/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ func IsConnected() bool {

func embeddedDB() error {
embeddedPath := strings.TrimSuffix(strings.TrimPrefix(ConnectionString, "embedded://"), "/")
err := os.Chmod(embeddedPath, 0750)
if err != nil {
logger.Errorf("Error changing permission of dataPath: %v, Error: %v", embeddedPath, err)
return err
}
_ = os.Chmod(embeddedPath, 0750)

logger.Infof("Starting embedded postgres server at %s", embeddedPath)

Expand All @@ -73,8 +69,7 @@ func embeddedDB() error {
Username("postgres").Password("postgres").
Database("canary"))
ConnectionString = "postgres://postgres:postgres@localhost:6432/canary?sslmode=disable"
err = PostgresServer.Start()
if err != nil {
if err := PostgresServer.Start(); err != nil {
return fmt.Errorf("error starting embedded postgres: %v", err)
}
return nil
Expand Down
Loading