-
Notifications
You must be signed in to change notification settings - Fork 56
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
base: main
Are you sure you want to change the base?
Conversation
@@ -42,3 +47,28 @@ func Uninstall(archivePath string) error { | |||
|
|||
return nil | |||
} | |||
|
|||
func DisableCustomExtensionsInPostgreSQL(ctx context.Context, customExtensionsForDeletion []string, exec postgres.Executor) error { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
@@ -535,6 +539,47 @@ func (r *PGClusterReconciler) reconcileCustomExtensions(cr *v2.PerconaPGCluster) | |||
extensionKeys = append(extensionKeys, key) | |||
} | |||
|
|||
if cr.CompareVersion("2.6.0") >= 0 { |
There was a problem hiding this comment.
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.
…ercona-postgresql-operator into K8SPG-594_delete_installed_ext
commit: 4c6bf22 |
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
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability