Skip to content

Commit

Permalink
pkg/redirectpolicy: Delete unused variable in getAndUpsertPolicySvcCo…
Browse files Browse the repository at this point in the history
…nfig

In the handler of case svcFrontendNamedPorts, the "ports" is allocated
and assigned with values, but never used. Thus, delete the related code.

Fixes: e7bb8a7 ("k8s/cilium Event handlers and processing logic for LRPs")

Signed-off-by: Zijian Zhang <[email protected]>
  • Loading branch information
Sm0ckingBird authored and julianwiedmann committed Nov 8, 2024
1 parent 51b5d7f commit 0cdca97
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/redirectpolicy/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,6 @@ func (rpm *Manager) getAndUpsertPolicySvcConfig(config *LRPConfig) error {

case svcFrontendNamedPorts:
// Get service frontends with the clusterIP and the policy config named ports.
ports := make([]string, len(config.frontendMappings))
for i, mapping := range config.frontendMappings {
ports[i] = mapping.fePort
}
ip := rpm.svcCache.GetServiceFrontendIP(*config.serviceID, lb.SVCTypeClusterIP)
if ip == nil {
// The LRP will be applied when the selected service is added later.
Expand Down

0 comments on commit 0cdca97

Please sign in to comment.