Revision 525007f69a87282cb4056820c722a1593402bf0d authored by Jarno Rajahalme on 07 June 2023, 08:04:31 UTC, committed by Dylan Reimerink on 07 June 2023, 17:00:46 UTC
CreateOrUpdateRedirect called nil revertFunc when any local error was
returned. This was done using the pattern `return 0, err, nil, nil` which
sets the revertFunc return variable as nil, but this was called on a
deferred function to revert any changes on a local error.

Fix this by calling ReverStack.Revert() directly on the deferred
function, and setting the return variable if there was no local error.

This was hit any time a CiliumNetworkPolicy referred to a non-existing
listener.

Add a test case that reproduced the panic and works after the fix.

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
1 parent 63db66a
History
File Mode Size
.devcontainer
.github
.nvim
.travis
.vscode
Documentation
api
bpf
bugtool
cilium
cilium-health
clustermesh-apiserver
contrib
daemon
envoy
examples
hack
hubble-relay
images
install
jenkinsfiles
operator
pkg
plugins
proxylib
test
tools
vendor
.authors.aux -rw-r--r-- 416 bytes
.clang-format -rw-r--r-- 3.9 KB
.clomonitor.yml -rw-r--r-- 984 bytes
.gitattributes -rw-r--r-- 842 bytes
.gitignore -rw-r--r-- 1.8 KB
.golangci.yaml -rw-r--r-- 3.6 KB
.mailmap -rw-r--r-- 6.4 KB
.travis.yml -rw-r--r-- 506 bytes
AUTHORS -rw-r--r-- 40.0 KB
CODEOWNERS -rw-r--r-- 24.7 KB
CODE_OF_CONDUCT.md -rw-r--r-- 2.2 KB
CONTRIBUTING.md -rw-r--r-- 691 bytes
FURTHER_READINGS.rst -rw-r--r-- 6.4 KB
LICENSE -rw-r--r-- 11.1 KB
MAINTAINERS.md -rw-r--r-- 4.3 KB
Makefile -rw-r--r-- 31.7 KB
Makefile.defs -rw-r--r-- 6.9 KB
Makefile.docker -rw-r--r-- 7.1 KB
Makefile.quiet -rw-r--r-- 818 bytes
README.rst -rw-r--r-- 19.4 KB
SECURITY.md -rw-r--r-- 1.0 KB
USERS.md -rw-r--r-- 27.8 KB
VERSION -rw-r--r-- 11 bytes
Vagrantfile -rw-r--r-- 14.9 KB
go.mod -rw-r--r-- 12.2 KB
go.sum -rw-r--r-- 147.0 KB
netlify.toml -rw-r--r-- 92 bytes
stable.txt -rw-r--r-- 8 bytes
vagrant_box_defaults.rb -rw-r--r-- 334 bytes

README.rst

back to top