Skip to content

Commit 0bb8ed5

Browse files
committed
resourceread: fix codec in ReadNetworkPolicyV1OrDie
ReadNetworkPolicyV1OrDie should use netCodecs instead of coreCodecs, otherwise it panics because NetworkPolicy is not in the core scheme.
1 parent 378de07 commit 0bb8ed5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/operator/resource/resourceread/networking.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func init() {
1818
}
1919

2020
func ReadNetworkPolicyV1OrDie(objBytes []byte) *networkingv1.NetworkPolicy {
21-
requiredObj, err := runtime.Decode(coreCodecs.UniversalDecoder(networkingv1.SchemeGroupVersion), objBytes)
21+
requiredObj, err := runtime.Decode(netCodecs.UniversalDecoder(networkingv1.SchemeGroupVersion), objBytes)
2222
if err != nil {
2323
panic(err)
2424
}

0 commit comments

Comments
 (0)