Skip to content

Commit

Permalink
Added params for postgres oc (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahpratikr committed Jan 12, 2023
1 parent e65900e commit 7ebafce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ actions:
export PGUSER='postgres'
export PGPASSWORD='{{ index .Phases.pgRestore.Secrets.pgSecret.Data "postgresql_admin_password" | toString }}'
BACKUP_LOCATION={{ .ArtifactsIn.cloudObject.KeyValue.backupLocation }}
kando location pull --profile '{{ toJson .Profile }}' --path "${BACKUP_LOCATION}" - | gunzip -c -f | sed 's/"LOCALE"/"LC_COLLATE"/' | psql -q -U "${PGUSER}"
kando location pull --profile '{{ toJson .Profile }}' --path "${BACKUP_LOCATION}" - | gunzip -c -f | sed 's/LOCALE_PROVIDER = libc//' | sed 's/LOCALE/LC_COLLATE/' | psql -q -U "${PGUSER}"
delete:
inputArtifactNames:
- cloudObject
Expand Down
7 changes: 6 additions & 1 deletion pkg/app/postgresql-deploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type PostgreSQLDepConfig struct {
namespace string
opeshiftClient openshift.OSClient
envVar map[string]string
params map[string]string
storageType storage
// dbTemplateVersion will most probably match with the OCP version
dbTemplateVersion DBTemplate
Expand All @@ -58,6 +59,10 @@ func NewPostgreSQLDepConfig(name string, templateVersion DBTemplate, storageType
envVar: map[string]string{
"POSTGRESQL_ADMIN_PASSWORD": "secretpassword",
},
params: map[string]string{
"POSTGRESQL_VERSION": "13-el8",
"POSTGRESQL_DATABASE": "postgres",
},
storageType: storageType,
dbTemplateVersion: templateVersion,
}
Expand All @@ -83,7 +88,7 @@ func (pgres *PostgreSQLDepConfig) Install(ctx context.Context, namespace string)

dbTemplate := getOpenShiftDBTemplate(postgresDepConfigName, pgres.dbTemplateVersion, pgres.storageType)

_, err := pgres.opeshiftClient.NewApp(ctx, pgres.namespace, dbTemplate, pgres.envVar, nil)
_, err := pgres.opeshiftClient.NewApp(ctx, pgres.namespace, dbTemplate, pgres.envVar, pgres.params)
if err != nil {
return errors.Wrapf(err, "Error installing application %s on openshift cluster", pgres.name)
}
Expand Down

0 comments on commit 7ebafce

Please sign in to comment.