Skip to content

Commit c1b2f4c

Browse files
committed
Fix mgradm start / stop to work with 5.0 for upgrade
When upgrading from 5.0 to 5.1 mgradm is upgraded but the containers are still the old ones. mgradm stop and start need to handle the missing Saline and database containers in such a case. (bsc#1243331)
1 parent 715722f commit c1b2f4c

35 files changed

Lines changed: 629 additions & 145 deletions

File tree

check_localizable

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# SPDX-License-Identifier: Apache-2.0
66

77
res=0
8-
grep -r . --include '*.go' --exclude '*_test.go' --exclude-dir='vendor' -n \
8+
grep -r . --include '*.go' --exclude '*_test.go' --exclude-dir 'testutils' --exclude-dir='vendor' -n \
99
-e 'fmt\.Errorf("[^"]\+"' \
1010
-e 'errors.New("[^"]\+"' \
1111
-e '\(Fatal\|Error\|Info\|Warn\)()\(\.Err(err)\)\?\.Msgf\?("' \
@@ -35,15 +35,15 @@ if test $res -ne 0; then
3535
res=1
3636
fi
3737

38-
grep -r . --include '*.go' --exclude '*_test.go' --exclude-dir='vendor' -n \
38+
grep -r . --include '*.go' --exclude '*_test.go' --exclude-dir 'testutils' --exclude-dir='vendor' -n \
3939
-e '\(Trace\|Debug\)()\(\.Err(err)\)\?\.Msgf\?(P\?N\?L("' \
4040

4141
if test $? -eq 0; then
4242
echo -e "Trace and debug messages shouldn't be localizable\n"
4343
res=1
4444
fi
4545

46-
grep -r . --include '*.go' --exclude '*_test.go' --exclude-dir='vendor' -n \
46+
grep -r . --include '*.go' --exclude '*_test.go' --exclude-dir 'testutils' --exclude-dir='vendor' -n \
4747
-e '\(Short\|Long\): \+P\?N\?L(["`][a-z]'
4848
if test $? -eq 0; then
4949
echo -e "Short and Long messages shouldn't start with a lowercase letter\n"

mgradm/cmd/backup/create/systemd_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/uyuni-project/uyuni-tools/shared/utils"
2020
)
2121

22-
var systemd podman.Systemd = podman.SystemdImpl{}
22+
var systemd podman.Systemd = podman.NewSystemd()
2323

2424
func exportSystemdConfiguration(outputDir string, dryRun bool) error {
2525
filesToBackup := gatherSystemdItems()

mgradm/cmd/backup/restore/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
var runCmdInput = utils.RunCmdInput
2626
var runCmd = utils.RunCmd
27-
var systemd = podman.SystemdImpl{}
27+
var systemd = podman.NewSystemd()
2828

2929
func Restore(
3030
_ *types.GlobalFlags,

mgradm/cmd/install/podman/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/uyuni-project/uyuni-tools/shared/utils"
2727
)
2828

29-
var systemd shared_podman.Systemd = shared_podman.SystemdImpl{}
29+
var systemd shared_podman.Systemd = shared_podman.NewSystemd()
3030

3131
func installForPodman(
3232
_ *types.GlobalFlags,

mgradm/cmd/migrate/podman/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/uyuni-project/uyuni-tools/shared/utils"
1818
)
1919

20-
var systemd podman_utils.Systemd = podman_utils.SystemdImpl{}
20+
var systemd podman_utils.Systemd = podman_utils.NewSystemd()
2121

2222
func migrateToPodman(
2323
_ *types.GlobalFlags,

mgradm/cmd/restart/podman.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/uyuni-project/uyuni-tools/shared/utils"
1212
)
1313

14-
var systemd podman.Systemd = podman.SystemdImpl{}
14+
var systemd podman.Systemd = podman.NewSystemd()
1515

1616
func podmanRestart(
1717
_ *types.GlobalFlags,

mgradm/cmd/scale/podman.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
. "github.com/uyuni-project/uyuni-tools/shared/l10n"
1717
)
1818

19-
var systemd podman.Systemd = podman.SystemdImpl{}
19+
var systemd podman.Systemd = podman.NewSystemd()
2020

2121
func podmanScale(
2222
_ *types.GlobalFlags,

mgradm/cmd/status/podman.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/uyuni-project/uyuni-tools/shared/utils"
1717
)
1818

19-
var systemd podman.Systemd = podman.SystemdImpl{}
19+
var systemd podman.Systemd = podman.NewSystemd()
2020

2121
func podmanStatus(
2222
_ *types.GlobalFlags,

mgradm/cmd/support/config/extractor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/uyuni-project/uyuni-tools/shared/utils"
1818
)
1919

20-
var systemd podman.Systemd = podman.SystemdImpl{}
20+
var systemd podman.Systemd = podman.NewSystemd()
2121

2222
func filesRemover(files []string) {
2323
for _, file := range files {

mgradm/cmd/support/ptf/podman/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/uyuni-project/uyuni-tools/shared/utils"
1919
)
2020

21-
var systemd podman_shared.Systemd = podman_shared.SystemdImpl{}
21+
var systemd podman_shared.Systemd = podman_shared.NewSystemd()
2222

2323
func ptfForPodman(
2424
_ *types.GlobalFlags,

0 commit comments

Comments
 (0)