Skip to content

Commit

Permalink
Merge pull request #242 from uyuni-project/migration_fix
Browse files Browse the repository at this point in the history
Migration fix
  • Loading branch information
deneb-alpha authored Apr 16, 2024
2 parents 3fa1d23 + 16090c5 commit 6e1326a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion mgradm/cmd/migrate/podman/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func migrateToPodman(globalFlags *types.GlobalFlags, flags *podmanMigrateFlags,
}

if oldPgVersion != newPgVersion {
log.Info().Msgf("Previous postgresql is %s, instead new one is %s. Performing a DB version upgrade...", oldPgVersion, newPgVersion)
if err := podman.RunPgsqlVersionUpgrade(flags.Image, flags.MigrationImage, oldPgVersion, newPgVersion); err != nil {
return fmt.Errorf("cannot run PostgreSQL version upgrade script: %s", err)
}
Expand Down
1 change: 0 additions & 1 deletion mgradm/cmd/upgrade/podman/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func upgradePodman(globalFlags *types.GlobalFlags, flags *podmanUpgradeFlags, cm
err = shared_podman.StartService(shared_podman.ServerService)
}()
if inspectedValues["image_pg_version"] > inspectedValues["current_pg_version"] {
log.Info().Msgf("Previous postgresql is %s, instead new one is %s. Performing a DB version upgrade...", inspectedValues["current_pg_version"], inspectedValues["image_pg_version"])
if err := podman.RunPgsqlVersionUpgrade(flags.Image, flags.MigrationImage, inspectedValues["current_pg_version"], inspectedValues["image_pg_version"]); err != nil {
return fmt.Errorf("cannot run PostgreSQL version upgrade script: %s", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ chown -R postgres:postgres /etc/pki/tls/certs/spacewalk.crt
echo "Initialize new postgresql $NEW_VERSION database..."
. /etc/sysconfig/postgresql 2>/dev/null # Load locale for SUSE
PGHOME=$(getent passwd postgres | awk -F: '{print $6}')
PGHOME=$(getent passwd postgres | cut -d ":" -f6)
#. $PGHOME/.i18n 2>/dev/null # Load locale for Enterprise Linux
if [ -z $POSTGRES_LANG ]; then
POSTGRES_LANG="en_US.UTF-8"
Expand Down
2 changes: 1 addition & 1 deletion mgradm/shared/templates/postUpgradeScriptTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ grep uyuni_authentication_endpoint /etc/cobbler/settings.yaml
if [ $? -eq 1 ]; then
echo 'uyuni_authentication_endpoint: "http://localhost"' >> /etc/cobbler/settings.yaml
else
sed 's/uyuni_authentication_endpoint.*/spacewalk_authentication_endpoint: http:\/\/localhost/' -i /etc/cobbler/settings.yaml;
sed 's/uyuni_authentication_endpoint.*/uyuni_authentication_endpoint: http:\/\/localhost/' -i /etc/cobbler/settings.yaml;
fi
{{ end }}
`
Expand Down
3 changes: 3 additions & 0 deletions uyuni-tools.changes.cbosdo.migration_fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Fix wrong cobbler spacewalk_authentication_endpoint property
after upgrade or migration
- Fix migration script using awk missing in migration image

0 comments on commit 6e1326a

Please sign in to comment.