Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

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 force-pushed the deprecate_services_json branch from 65ab237 to 394a471 Compare August 11, 2022 19:51
@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".
@jordigilh jordigilh force-pushed the deprecate_services_json branch from 394a471 to 84d1280 Compare August 11, 2022 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant