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

K8SPG-594 delete custom extensions from installed #967

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

Conversation

nmarukovich
Copy link
Contributor

@nmarukovich nmarukovich commented Dec 2, 2024

K8SPG-594 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
We need to delete custom extensions not only from available but from installed too. If we deleted a custom extension from available extensions it doesn't work correctly so anyway we should delete it.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
As solution, custom annotations with the list of installed custom extensions were added.
Under each reconciliation extension either added to annotations (if it's new one and were deleted in custom extensions in CR or if it was deleted from custom extensions we should delete in from DB and from annotations too )

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

percona/controller/pgcluster/controller.go Outdated Show resolved Hide resolved
percona/controller/pgcluster/controller.go Outdated Show resolved Hide resolved
@@ -42,3 +47,28 @@ func Uninstall(archivePath string) error {

return nil
}

func DisableCustomExtensionsInPostgreSQL(ctx context.Context, customExtensionsForDeletion []string, exec postgres.Executor) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would name it simply like DropExtension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@inelpandzic We have similar method for pgaudit and I decided to keep the same name for consistency. What do you think?
But I agree that the name you suggested is easier.

percona/controller/pgcluster/controller.go Outdated Show resolved Hide resolved
percona/controller/pgcluster/controller.go Outdated Show resolved Hide resolved
percona/controller/pgcluster/controller.go Outdated Show resolved Hide resolved
percona/controller/pgcluster/controller.go Outdated Show resolved Hide resolved
@@ -535,6 +539,47 @@ func (r *PGClusterReconciler) reconcileCustomExtensions(cr *v2.PerconaPGCluster)
extensionKeys = append(extensionKeys, key)
}

if cr.CompareVersion("2.6.0") >= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put all this block in the extensions package (in the k8s.go file) we have and here you just call some function, like extension.Remove or something.

@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions failure
custom-tls failure
demand-backup failure
finalizers failure
init-deploy failure
monitoring failure
one-pod failure
operator-self-healing failure
pitr failure
scaling failure
scheduled-backup failure
self-healing failure
start-from-backup failure
tablespaces failure
telemetry-transfer failure
upgrade-consistency failure
upgrade-minor failure
users failure
We run 18 out of 18

commit: 4c6bf22
image: perconalab/percona-postgresql-operator:PR-967-4c6bf2278

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.

3 participants