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

Syslog Implementation #1437

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open

Syslog Implementation #1437

wants to merge 2 commits into from

Conversation

XK4MiLX
Copy link
Member

@XK4MiLX XK4MiLX commented Feb 7, 2025

feat(appDockerCreate): add conditional static IP assignment with syslog integration

  • Implemented helper function getNextAvailableIPForApp using the ip library to inspect the Docker network (derived from the app name) and automatically determine the next available static IP.
  • Updated appDockerCreate to conditionally include the NetworkingConfig section:
    • If an auto-assigned IP is available, it is set via EndpointsConfig using the object spread operator.
    • If no IP is available (i.e. the helper returns null), the NetworkingConfig is omitted so that Docker assigns a dynamic IP.
  • Integrated syslog functionality:
    • Checks environment parameters for syslog roles (e.g., LOG=SEND and LOG=COLLECT).
    • If the container is a log sender and a syslog collector is identified, the collector’s IP is retrieved (via getContainerIP) and used to configure the container's LogConfig with a syslog address (e.g., udp://<collectorIP>:514).

- Implemented helper function `getNextAvailableIPForApp` using the ip library to inspect the Docker network (derived from the app name) and automatically determine the next available static IP.
- Updated `appDockerCreate` to conditionally include the `NetworkingConfig` section:
  - If an auto-assigned IP is available, it is set via `EndpointsConfig` using the object spread operator.
  - If no IP is available (i.e. the helper returns null), the `NetworkingConfig` is omitted so that Docker assigns a dynamic IP.
- Integrated syslog functionality:
  - Checks environment parameters for syslog roles (e.g., `LOG=SEND` and `LOG=COLLECT`).
  - If the container is a log sender and a syslog collector is identified, the collector’s IP is retrieved (via `getContainerIP`) and used to configure the container's `LogConfig` with a syslog address (e.g., `udp://<collectorIP>:514`).
- This commit enhances container creation by supporting both automatic static IP assignment and integrated syslog logging.
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 34.69388% with 32 lines in your changes missing coverage. Please review.

Project coverage is 47.77%. Comparing base (6b61e41) to head (b32ea79).
Report is 811 commits behind head on development.

Files with missing lines Patch % Lines
ZelBack/src/services/dockerService.js 34.69% 32 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1437      +/-   ##
===============================================
- Coverage        47.84%   47.77%   -0.08%     
===============================================
  Files               50       60      +10     
  Lines            15622    18404    +2782     
===============================================
+ Hits              7475     8793    +1318     
- Misses            8147     9611    +1464     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Cabecinha84 Cabecinha84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

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.

2 participants