Mostly to backport to 1.3.x, main should be soon updated to 1.27.x. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com> (cherry picked from commit 28713c2c4d4d20d5ff455c40cbb8aa004d725801)