Skip to content

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Sep 9, 2024

Issue

The pgAudit plugin/extension is available in the latest revision of the Charmed PostgreSQL rock, but not in this charm.

Solution

Expose pgAudit as another plugin/extension charm config option and enable it when requested by:

  • Using the new rock, which contains the pgAudit plugin/extension.
  • Adding pgaudit to the PostgreSQL shared_preload_libraries parameter.
  • Configuring the requested parameters from DPE-2573 on lib/charms/postgresql_k8s/v0/postgresql.py.

Added new unit and integration tests.

Also, some adjustments were made in the plugin retrieval, which is used in the config-changed and database-requested hook handlers.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.81%. Comparing base (e70eb0e) to head (7d4e11c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #688      +/-   ##
==========================================
+ Coverage   70.72%   70.81%   +0.08%     
==========================================
  Files          11       11              
  Lines        2972     2981       +9     
  Branches      518      520       +2     
==========================================
+ Hits         2102     2111       +9     
  Misses        758      758              
  Partials      112      112              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
config.yaml Outdated
type: boolean
description: Enable timescaledb extension
plugin_audit_enable:
default: false
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as VM, check default with Mohamed, please.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing that out, Alex! After syncing with Mohamed, I updated the plugin to enable it by default on 3243718.

Copy link

@lucasgameiroborges lucasgameiroborges left a comment

Choose a reason for hiding this comment

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

Nice :)

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel merged commit f882a87 into main Sep 19, 2024
96 checks passed
@marceloneppel marceloneppel deleted the dpe-5116-add-pgaudit branch September 19, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants