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

Refactor #44

Merged
merged 57 commits into from
Jun 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
25ee95d
Update libs & clear src
carlcsaposs-canonical Jun 1, 2023
0dfee4a
Copy /src/ from k8s charm
carlcsaposs-canonical Jun 1, 2023
f3908a7
Update lint ignore
carlcsaposs-canonical Jun 1, 2023
c2b59d3
Remove TLS
carlcsaposs-canonical Jun 1, 2023
ba4b08f
Remove pod restart handling
carlcsaposs-canonical Jun 7, 2023
9b51fdc
temp disable lint
carlcsaposs-canonical Jun 6, 2023
567e981
temp
carlcsaposs-canonical Jun 9, 2023
f94160a
Fix recursion error
carlcsaposs-canonical Jun 12, 2023
fcdb675
temp fix for /tmp path in snap
carlcsaposs-canonical Jun 12, 2023
f90b96e
fix arg
carlcsaposs-canonical Jun 12, 2023
8e8654c
add relative_to_container method to Path
carlcsaposs-canonical Jun 12, 2023
5f04da2
cast to purepath before getting relative path
carlcsaposs-canonical Jun 12, 2023
7af5af2
fix path
carlcsaposs-canonical Jun 12, 2023
aadadbc
fix username
carlcsaposs-canonical Jun 12, 2023
473d7f8
change username
carlcsaposs-canonical Jun 12, 2023
d1362eb
fix
carlcsaposs-canonical Jun 12, 2023
3a6c42b
fix socket path
carlcsaposs-canonical Jun 12, 2023
6d077e4
remove username
carlcsaposs-canonical Jun 12, 2023
2558aae
remove installer
carlcsaposs-canonical Jun 15, 2023
6d8ab1c
sync
carlcsaposs-canonical Jun 16, 2023
27ea0de
sync & socket endpoints
carlcsaposs-canonical Jun 16, 2023
4f47eea
/run instead of /var/run
carlcsaposs-canonical Jun 16, 2023
fb8e840
Add missing_ok to unlink()
carlcsaposs-canonical Jun 16, 2023
9ce5d19
remove comment
carlcsaposs-canonical Jun 16, 2023
b039fad
Add docstring to _update_configured_socket_file_locations()
carlcsaposs-canonical Jun 16, 2023
dd433b0
docstring sync
carlcsaposs-canonical Jun 20, 2023
21c11bc
tls todo
carlcsaposs-canonical Jun 20, 2023
ff2681b
update snap
carlcsaposs-canonical Jun 20, 2023
6ad2756
sync add attributes before enable
carlcsaposs-canonical Jun 20, 2023
97f74c3
add installer to container
carlcsaposs-canonical Jun 20, 2023
15ad29a
Add abstract_charm.py
carlcsaposs-canonical Jun 21, 2023
bbd5497
update metadata.yaml, format
carlcsaposs-canonical Jun 21, 2023
d507f2c
remove pytest-order from integration tests
carlcsaposs-canonical Jun 21, 2023
46de3fc
don't use staticmethod for _on_remove
carlcsaposs-canonical Jun 21, 2023
b17ee86
remove unused snap revision var
carlcsaposs-canonical Jun 23, 2023
fb4cfe2
chown directories
carlcsaposs-canonical Jun 23, 2023
f7a3399
update docstring
carlcsaposs-canonical Jun 23, 2023
8f589e3
lint
carlcsaposs-canonical Jun 23, 2023
2297e09
subordinate in class name
carlcsaposs-canonical Jun 23, 2023
c8132ea
bind address localhost (socket)
carlcsaposs-canonical Jun 23, 2023
e384b52
logger
carlcsaposs-canonical Jun 23, 2023
15633f6
private constant
carlcsaposs-canonical Jun 23, 2023
eefb542
rename var
carlcsaposs-canonical Jun 23, 2023
61ad7e5
type annotation
carlcsaposs-canonical Jun 23, 2023
42f4429
set workload version
carlcsaposs-canonical Jun 23, 2023
a23bc2f
use pathlib to read file
carlcsaposs-canonical Jun 23, 2023
3c62bc1
update docstring
carlcsaposs-canonical Jun 23, 2023
6d7c0df
store string in var
carlcsaposs-canonical Jun 23, 2023
b9dab7d
add logging
carlcsaposs-canonical Jun 23, 2023
65bb445
Update snap revision
carlcsaposs-canonical Jun 23, 2023
6293698
format
carlcsaposs-canonical Jun 23, 2023
1dc4481
add todo comment
carlcsaposs-canonical Jun 23, 2023
3650fdd
add missing limit to backend-database endpoint
carlcsaposs-canonical Jun 23, 2023
eb1ec2c
remove installer class
carlcsaposs-canonical Jun 23, 2023
12a58a8
Fix type annotation for python 3.8 compatability
carlcsaposs-canonical Jun 26, 2023
7855afa
Remove SocketWorkload
carlcsaposs-canonical Jun 26, 2023
ea7a788
fixup
carlcsaposs-canonical Jun 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add logging
carlcsaposs-canonical committed Jun 23, 2023
commit b9dab7d72363cdd0248bf334f80af3b21cb421fb
4 changes: 4 additions & 0 deletions src/socket_workload.py
Original file line number Diff line number Diff line change
@@ -5,10 +5,12 @@

import configparser
import io
import logging
import pathlib

import workload

logger = logging.getLogger(__name__)

class SocketWorkload(workload.Workload):
"""MySQl Router workload with Unix sockets enabled"""
@@ -43,6 +45,7 @@ def _update_configured_socket_file_locations(self) -> None:
Needed since `/tmp` inside a snap is not accessible to non-root users. The socket files
must be accessible to applications related via database_provides endpoint.
"""
logger.debug("Updating configured socket file locations")
config = configparser.ConfigParser()
config.read_string(self._container.router_config_file.read_text())
for section_name, section in config.items():
@@ -54,6 +57,7 @@ def _update_configured_socket_file_locations(self) -> None:
with io.StringIO() as output:
config.write(output)
self._container.router_config_file.write_text(output.getvalue())
logger.debug("Updated configured socket file locations")

def _bootstrap_router(self, *, tls: bool) -> None:
super()._bootstrap_router(tls=tls)