Commit 0e4207a
committed
pkg/multus: skip GetAsVersion conversion when cniVersion is already 1.x
@gemini-code-assist suggestion on k8snetworkplumbingwg#1505: emptyCNIResult already
returns a *cni100.Result, so GetAsVersion is a no-op (or worse, an
unnecessary allocation) for 1.x configs. Gate the conversion on
non-1.x cniVersions only; 1.x callers now return the *cni100.Result
directly as they did before the panic fix.
Behaviour for 0.3.x / 0.4.0 is unchanged: still downcast so skel's
conversion chain dispatches convertFrom04x correctly.
Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>1 parent dd95690 commit 0e4207a
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
777 | 778 | | |
778 | 779 | | |
779 | 780 | | |
| |||
0 commit comments