(estimator cost.Estimator, target *cost.AstNode, args []cost.AstNode)
| 725 | } |
| 726 | |
| 727 | func estimateNetworkContainsCIDRStringCost(estimator cost.Estimator, target *cost.AstNode, args []cost.AstNode) *cost.CallEstimate { |
| 728 | if len(args) < 1 { |
| 729 | return nil |
| 730 | } |
| 731 | sz := cost.RangedSizeEstimate(4, 16) |
| 732 | ipCompCost := sz.Add(sz).MultiplyByCostFactor(cost.StringCostFactor) |
| 733 | ipCompCost = ipCompCost.Add(sz.MultiplyByCostFactor(cost.StringCostFactor)) |
| 734 | argSz := cost.EstimateSize(estimator, args[0]) |
| 735 | ipCompCost = ipCompCost.Add(argSz.MultiplyByCostFactor(cost.StringCostFactor)) |
| 736 | // K8s adds one for the extra IP traversal |
| 737 | ipCompCost = ipCompCost.Add(cost.CallCostEstimate) |
| 738 | return cost.NewCallEstimate(ipCompCost, nil) |
| 739 | } |
| 740 | |
| 741 | // Runtime cost tracking functions for network extensions. |
| 742 |
nothing calls this directly
no test coverage detected