acrlabs / simkube

Record-and-replay Kubernetes simulator based on KWOK
https://appliedcomputing.io/simkube
MIT License
164 stars 7 forks source link

drop ports when running sim #102

Closed drmorr0 closed 4 months ago

drmorr0 commented 4 months ago

Description

It is possible to create a container with two different ports referencing the same port number, but you can't apply a patch to that pod later, even if you're not changing the port definitions. So in the short term we're just stripping port definitions from the podspec during the simulation.

One could make the argument that we should just strip them from the trace entirely but my working hypothesis is that it's better to leave them in the trace data and let the consumers of the trace figure out what to do with it? But that requires us to make changes in two different places whenever we touch the pod spec in the simulation -- this impacts the hash we compute for the pod object, so we end up having to make changes in two places at once.

I'd like to maybe have a test for this, but it's not immediately obvious how I'd write such a test so I'm ignoring it for now.

Testing done

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 7.69231% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 74.50%. Comparing base (8a9ee5e) to head (ad2f949).

Files Patch % Lines
src/k8s/pod_ext.rs 0.00% 12 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #102 +/- ## ========================================== - Coverage 74.92% 74.50% -0.42% ========================================== Files 38 38 Lines 1922 1934 +12 ========================================== + Hits 1440 1441 +1 - Misses 482 493 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.