Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firewall: don't return error in DEL if prevResult is not found. #390

Merged
merged 2 commits into from Oct 2, 2019

Conversation

sipsma
Copy link
Contributor

@sipsma sipsma commented Sep 23, 2019

The CNI spec states that for DEL implementations, "when CNI_NETNS and/or
prevResult are not provided, the plugin should clean up as many resources as
possible (e.g. releasing IPAM allocations) and return a successful response".
This change results in the firewall plugin conforming to the spec by not
returning an error whenever the del method is not provided a prevResult.

Signed-off-by: Erik Sipsma sipsma@amazon.com

The CNI spec states that for DEL implementations, "when CNI_NETNS and/or
prevResult are not provided, the plugin should clean up as many resources as
possible (e.g. releasing IPAM allocations) and return a successful response".
This change results in the firewall plugin conforming to the spec by not
returning an error whenever the del method is not provided a prevResult.

Signed-off-by: Erik Sipsma <sipsma@amazon.com>
Copy link
Member

@jellonek jellonek left a comment

Choose a reason for hiding this comment

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

LGTM

@mars1024
Copy link
Member

Since CNI_NETNS is not necessary for DEL, could you help to clean

containerNS, err := ns.GetNS(args.Netns)
too?

@bboreham
Copy link
Contributor

@mars1024 you're suggesting to delete those five lines? sgtm.

@mars1024
Copy link
Member

@mars1024 you're suggesting to delete those five lines? sgtm.

yeah, I think those lines look useless.

Signed-off-by: Erik Sipsma <sipsma@amazon.com>
@sipsma
Copy link
Contributor Author

sipsma commented Sep 25, 2019

Since CNI_NETNS is not necessary for DEL, could you help to clean

containerNS, err := ns.GetNS(args.Netns)

too?

Yeah for sure, done!

Copy link
Member

@mars1024 mars1024 left a comment

Choose a reason for hiding this comment

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

/lgtm thanks!

@squeed
Copy link
Member

squeed commented Oct 2, 2019

lgtm!

@dcbw dcbw merged commit d0eeb27 into containernetworking:master Oct 2, 2019
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.

None yet

6 participants