Skip to content

Fix: Remove duplicate initOpenFlowPipeline() call in agent Initialize #8145

Description

@barbierajput378-pixel

Description

In pkg/agent/agent.go lines 477-494, there's a dead code branch with
an identical body in an if/else statement.

Both branches call initOpenFlowPipeline():

if i.nodeType == config.K8sNode {
    // ...route setup...
    if err := i.initOpenFlowPipeline(); err != nil { return err }
} else {
    // Install OpenFlow entries on OVS bridge.
    if err := i.initOpenFlowPipeline(); err != nil { return err }
}

The else branch is redundant — this appears to be leftover from an
earlier refactor.

Expected Behavior

The initOpenFlowPipeline() call should be moved outside the if/else block.

Suggested Fix

if i.nodeType == config.K8sNode {
    // ...route setup...
}
if err := i.initOpenFlowPipeline(); err != nil {
    return err
}

File(s) Affected

  • pkg/agent/agent.go (lines 477-494)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions