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

[WIP] Deprecate services.json and workload-mapping.json #235

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

jordigilh
Copy link
Contributor

@jordigilh jordigilh commented Aug 11, 2022

Notes

Please review the last commit as this PR builds on the other PR I created to refactor the events to use systemd instead of podman.
84d1280

TL;DR

Removed logic to handle services.json and workload-mapping.json as mappings for running workloads

Description

  • services.json: this file was used to list related services to the main service. Each related service manages a container in the pod spec. With the change we now extract this information from the BoundBy property in the main service.
  • workload-mapping.json: this file contains the mapping from the pod name and the pod ID. It was used to retrieve the pod ID based on the workload name and retrieve the pod report from podman. However, as it happens, the pod name equals to the workload name, and podman allows retrieval of the pod report with the pod ID or the pod name as argument, making this mapping no longer necessary.
  • Added missing error validation for starting and stopping services, including the validation whether the service exists or not before performing the action to avoid errors for service not found.

* Moved event listener instance and initialization to cmd.go main
* Added a file system watcher to the systemd enabled services directory to be notified of new services from being enabled/disabled so that the event listener can track their status
* Encapsulated the code to listen to service events generated by the systemd event listener so that it is called at the last line of the cmd.go#main function to make sure all observers are ready before start processing the service events
…ceived to avoid potential race condition between file system event and dbus event
@jordigilh jordigilh changed the title [WIP] Deprecate services json [WIP] Deprecate services.json and workload-mapping.json Aug 11, 2022
…ppings for running workloads

* services.json: this file was used to list related services to the main service. Each related service manages a container in the pod spec. With the change we now extract this information from the BoundBy property in the main service.
* workload-mapping.json: this file contains the mapping from the pod name and the pod ID. It was used to retrieve the pod ID based on the workload name and retrieve the pod report from podman. However, as it happens, the pod name equals to the workload name, and podman allows retrieval of the pod report with the pod ID or the pod name as argument, making this mapping no longer necessary.
* Added missing error validation for starting and stopping services, including the validation whether the service exists or not before performing the action to avoid errors for "service not found".
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.

1 participant