Skip to content

Conversation

@daschott
Copy link
Contributor

Added support for loopbackDSR policy for all IPAM modes

Previously, loopbackDSR would fail to be added when HNS was used as IPAM. This is because the IP address was not available until after the endpoint was created. In contrast, using host-local as IPAM would ensure the IP address was in the epInfo beforehand. Now I added logic to check if the IP address exists. If it doesn't exist, we will add the loopbackDSR policy after endpoint creation. Without this fix, CNI would fail to create the endpoint if loopbackDSR is enabled and HNS is used as the IPAM.

@daschott daschott force-pushed the user/daschott/loopbackdsr-fix branch from 9bd54cf to a10e195 Compare December 12, 2025 22:21
logrus.Errorf("[cni-net] Failed to create endpoint, error : %v.", err)
return err
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to have a success log (info) after the successful endpoint creation.

if err != nil {
return fmt.Errorf("failed to apply policy to endpoint: %v", err)
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to have a success log (info) after the policy is applied successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants