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

Dedicated container for database #482

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nadvornik
Copy link
Contributor

@nadvornik nadvornik commented Oct 30, 2024

What does this PR change?

Current state:

Works with the image from uyuni-project/uyuni#9469
mgradm install podman --pgsql-image <image> --pgsql-tag <tag>
Uses workarounds for the issues discussed in https://github.com/SUSE/spacewalk/issues/25363
Missing kubernetes.

Test coverage

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • DONE

Links

Issue(s): #

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Before you merge

Check How to branch and merge properly!

Copy link
Contributor

@aaannz aaannz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple comments, mostly typos.

Once this is merged, smdba autotune call can be also removed from mgr-setup and others.

) error {
image := pgsqlFlags.Image
currentReplicas := systemd.CurrentReplicaCount(podman.PgsqlService)
log.Debug().Msgf("Current HUB replicas running are %d.", currentReplicas)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Debug().Msgf("Current HUB replicas running are %d.", currentReplicas)
log.Debug().Msgf("Current pgsql replicas running are %d.", currentReplicas)

log.Debug().Msgf("Current HUB replicas running are %d.", currentReplicas)

if pgsqlFlags.Replicas == 0 {
log.Debug().Msg("No pgsql requested.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Debug().Msg("No pgsql requested.")
log.Info().Msg(L("No Postgres container requested."))

log.Debug().Msg("No pgsql requested.")
}
if !pgsqlFlags.IsChanged {
log.Info().Msgf(L("No changes requested for hub. Keep %d replicas."), currentReplicas)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Info().Msgf(L("No changes requested for hub. Keep %d replicas."), currentReplicas)
log.Info().Msgf(L("No changes requested for pgsql. Keep %d replicas."), currentReplicas)

if err := cnx.WaitForHealthcheck(); err != nil {
return err
}
// Now the servisce is up and ready, the admin credentials are no longer needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Now the servisce is up and ready, the admin credentials are no longer needed
// Now the service is up and ready, the admin credentials are no longer needed

@@ -0,0 +1,191 @@
// SPDX-FileCopyrightText: 2024 SUSE LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SPDX-FileCopyrightText: 2024 SUSE LLC
// SPDX-FileCopyrightText: 2025 SUSE LLC

OLD_VERSION={{ .OldVersion }}
NEW_VERSION={{ .NewVersion }}
FAST_UPGRADE=--link
FAST_UPGRADE= #--link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore

@@ -209,3 +209,21 @@ Leave it unset if you want to keep the previous number of replicas.
_ = utils.AddFlagToHelpGroupID(cmd, "saline-replicas", "saline-container")
_ = utils.AddFlagToHelpGroupID(cmd, "saline-port", "saline-container")
}

// AddPgsqlFlags adds hub XML-RPC related parameters to cmd.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// AddPgsqlFlags adds hub XML-RPC related parameters to cmd.
// AddPgsqlFlags adds postgres related parameters to cmd.

_ = utils.AddFlagToHelpGroupID(cmd, "pgsql-replicas", "pgsql-container")
}

// AddUpgradePgsqlFlags adds hub XML-RPC related parameters to cmd upgrade.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// AddUpgradePgsqlFlags adds hub XML-RPC related parameters to cmd upgrade.
// AddUpgradePgsqlFlags adds postgres related parameters to cmd upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants