Skip to content

Conversation

@ncode
Copy link
Owner

@ncode ncode commented Feb 8, 2025

This pull request includes significant refactoring and improvements to the logging and configuration handling in the outbound plugin, as well as updates to the testing framework. The most important changes include extracting the Go version from go.mod, restructuring the logging setup, and enhancing the configuration parsing logic.

Configuration and Build Improvements:

  • Makefile: Extracted the Go version directly from go.mod and passed it as a build argument to the Docker build process. Introduced targets for testing and cleaning Docker images.

Logging Enhancements:

  • outbound.go: Refactored the logging setup by renaming setupLogging to setupPluginLogging and updating the logging configuration process. Added new structured logging instances and metadata handling. [1] [2] [3]

Configuration Parsing Refactor:

  • outbound.go: Split the parseConfig function into smaller, more manageable functions (readJSONConfig, setupPluginLogging, parsePrevResult, applyAdditionalRules). This improves readability and maintainability. [1] [2]

Testing Updates:

  • outbound_test.go: Updated tests to reflect the refactored logging and configuration parsing functions. Added new tests to handle scenarios where parsing previous results or finding IPv4 addresses fails. [1] [2]

IPTables Management:

@codecov
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 94.65241% with 10 lines in your changes missing coverage. Please review.

Project coverage is 95.76%. Comparing base (90a2e77) to head (85c6d94).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
outbound.go 95.68% 4 Missing and 1 partial ⚠️
pkg/iptables/iptables_manager.go 92.95% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
- Coverage   96.01%   95.76%   -0.26%     
==========================================
  Files           2        2              
  Lines         628      661      +33     
==========================================
+ Hits          603      633      +30     
- Misses         22       24       +2     
- Partials        3        4       +1     

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

@ncode ncode marked this pull request as draft February 8, 2025 19:40
@ncode ncode force-pushed the juliano/new_feature_set branch from f771589 to d3bf19a Compare February 8, 2025 23:13
@ncode ncode marked this pull request as ready for review February 12, 2025 13:41
@ncode ncode merged commit bf0ed7a into main Feb 12, 2025
5 of 7 checks passed
@ncode ncode deleted the juliano/new_feature_set branch February 12, 2025 13:43
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