(cleanup) Make the netpol/ model.go model stateful #102919
Comments
@jayunit100: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/good-first-issue |
@jayunit100: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig network |
/assign @SANDWISH |
@yangjunmyfm192085: GitHub didn't allow me to assign the following users: sandwish. Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign sanwishe |
@yangjunmyfm192085: GitHub didn't allow me to assign the following users: sanwishe. Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign |
take a look @sanwishe |
What happened
In #102354 (comment) @aojea brought up the fact that to get Service IPs we currently need to make an API call, i suppose that is suboptimal .
in a nutshell...
(model.go)
So we should in an ideal way, find a way to cache the data we get for free in the first bullet, with the function that reads the service data, in the second bullet.
basically any solution that makes this easier to deal with is probably a small win for us, so , good first issue to hack on :)
details
This is because we create the model using a function (rather then caching it somehow).
The functional approach imo is nice bc the model offers no gaurantees, so, we can call it as much as we want and have less state to carry over.
However, i think maybe at some point it would be faster to cache this data, and not call Spec.ClusterIP for ever pod on every test.
Fix
This is a good first issue i think: Take a look at the code path in the netpol suite, and see if you can get it to pass by extending the model class somehow, so that when we converge
getK8SModel()
andgetK8sModelWithServiceIPs()
, into a single call to getting the Model, which uses a cached model, that is capable of creating itself somehow, that way, once the model exists, it can be reused.I think to merge this since we're adding state carry over,it would be interesting to measure wether the tests run any faster afterwards.
I dont have any strong opinions here, but thought i'd follow this as a follow on to #102354
The text was updated successfully, but these errors were encountered: