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

Fix open ports parsing from yaml. #834

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

deadly-panda
Copy link
Member

The open_ports field of the AgentDefinition class is of type PortMapping.
When reading the raw yaml agent definition to create the AgentDefinition instance, the current implementation doesn't convert the raw dict to the corresponding PortMapping objects.

This PR handles this cases in the from_yaml classmethod of the AgentDefinition class.

@deadly-panda deadly-panda requested review from 3asm and amine3 October 25, 2024 16:05
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.73%. Comparing base (bf5040f) to head (0a2dfab).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #834      +/-   ##
==========================================
+ Coverage   62.71%   62.73%   +0.02%     
==========================================
  Files         341      341              
  Lines       14299    14307       +8     
==========================================
+ Hits         8967     8975       +8     
  Misses       5332     5332              

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

Copy link
Contributor

@PiranhaSa PiranhaSa left a comment

Choose a reason for hiding this comment

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

👍 👍

@amine3 amine3 merged commit 75623fb into main Oct 25, 2024
12 checks passed
@amine3 amine3 deleted the fix/fix_open_ports_parsing_from_yaml_definition branch October 25, 2024 16:27
assert agent_definition.caps == ["NET_ADMIN"]
assert agent_definition.open_ports == [
utils_defintions.PortMapping(
source_port=4242,
Copy link
Contributor

Choose a reason for hiding this comment

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

i think you may want to test with different ports so you make sure everything is in the right place

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.

7 participants