This repository was archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
[WIP] Deprecate services.json and workload-mapping.json #235
Open
jordigilh
wants to merge
13
commits into
project-flotta:main
Choose a base branch
from
jordigilh:deprecate_services_json
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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
65ab237 to
394a471
Compare
…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".
394a471 to
84d1280
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theBoundByproperty 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.service not found.