You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
The module provider.systemdmanager.systemdunit is complex and hard to test because the service unit logic and the underlying INI file format are merged together. For more popular file formats like XML, JSON, and YAML it is obvious to use a separate module or library. The same can be done for the INI file format.
Furthermore the mapping from Kubernetes to a systemd service could be factored out. This would yield the following modules:
service_generator which maps a PodSpec to a SystemdService.
systemd_service which provides the structure SystemdService and a function serialize which maps this structure to an IniFile and calls serialize on it.
ini_file with a structure IniFile and a function serialize.
The amount of code would be roughly the same but there would be smaller and better testable modules.
The text was updated successfully, but these errors were encountered:
The module
provider.systemdmanager.systemdunit
is complex and hard to test because the service unit logic and the underlying INI file format are merged together. For more popular file formats like XML, JSON, and YAML it is obvious to use a separate module or library. The same can be done for the INI file format.Furthermore the mapping from Kubernetes to a systemd service could be factored out. This would yield the following modules:
service_generator
which maps aPodSpec
to aSystemdService
.systemd_service
which provides the structureSystemdService
and a functionserialize
which maps this structure to anIniFile
and callsserialize
on it.ini_file
with a structureIniFile
and a functionserialize
.The amount of code would be roughly the same but there would be smaller and better testable modules.
The text was updated successfully, but these errors were encountered: