Skip to content

Commit

Permalink
Update "sed" command in other Postgres BPs (#1797)
Browse files Browse the repository at this point in the history
* Update sed command in dep-config BP

* Update RDS postgresRestore

* Update unit test
  • Loading branch information
pavannd1 authored Dec 16, 2022
1 parent b243676 commit 8663ebd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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"/"LC_COLLATE"/' | psql -q -U "${PGUSER}"
delete:
inputArtifactNames:
- cloudObject
Expand Down
2 changes: 1 addition & 1 deletion pkg/function/rds_functions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (s *RDSFunctionsTest) TestPrepareCommand(c *C) {
command: []string{"bash", "-o", "errexit", "-o", "pipefail", "-c",
fmt.Sprintf(`
export PGHOST=%s
kando location pull --profile '%s' --path "%s" - | gunzip -c -f | sed 's/LOCALE/LC_COLLATE/' | psql -q -U "${PGUSER}" %s
kando location pull --profile '%s' --path "%s" - | gunzip -c -f | sed 's/"LOCALE"/"LC_COLLATE"/' | psql -q -U "${PGUSER}" %s
`, "db-endpoint", "null", fmt.Sprintf("%s/%s", "/backup/postgres-backup", "backup-id"), []string{"template1"}[0]),
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/function/restore_rds_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func postgresRestoreCommand(pgHost, username, password string, dbList []string,
}
// Verify Constraints
if constraints.Check(v1) {
replaceCommand = " sed 's/LOCALE/LC_COLLATE/' |"
replaceCommand = ` sed 's/"LOCALE"/"LC_COLLATE"/' |`
}

return []string{
Expand Down

0 comments on commit 8663ebd

Please sign in to comment.