You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging #2303, I found that listing the networkpolicy.v1beta1.controlplane.antrea.tanzu.vmware.com API didn't get error when listing networkpolicy.v1beta1.networking.antrea.tanzu.vmware.com got "MarshalJSON error", while they were supposed to use same types and get same results.
It turned out thatv1beta1.controlplane.antrea.tanzu.vmware.com was actually using v1beta2 types by mistake. It was introduced when renaming the API group to antrea.io:
This would cause the consumer of the legacy controlplane v1beta1 API got unexpected response.
Beside, the field selectors of v1beta1.controlplane.antrea.tanzu.vmware.com and v1beta1.networking.antrea.tanzu.vmware.com were not registered, which caused "nodeName" fieldSelector not working.
# kubectl get networkpolicy.v1beta1.networking.antrea.tanzu.vmware.com --field-selector "nodeName=abc"
Error from server (BadRequest): Unable to find "networking.antrea.tanzu.vmware.com/v1beta1, Resource=networkpolicies" that match label selector "", field selector "nodeName=abc": "nodeName" is not a known field selector: only "metadata.name", "metadata.namespace"
# kubectl get networkpolicy.v1beta1.controlplane.antrea.tanzu.vmware.com --field-selector "nodeName=abc"
Error from server (BadRequest): Unable to find "controlplane.antrea.tanzu.vmware.com/v1beta1, Resource=networkpolicies" that match label selector "", field selector "nodeName=abc": "nodeName" is not a known field selector: only "metadata.name", "metadata.namespace"
Versions:
Please provide the following information:
Antrea version (Docker image tag). 1.0.0-1.1.0
The text was updated successfully, but these errors were encountered:
Describe the bug
When debugging #2303, I found that listing the
networkpolicy.v1beta1.controlplane.antrea.tanzu.vmware.com
API didn't get error when listingnetworkpolicy.v1beta1.networking.antrea.tanzu.vmware.com
got "MarshalJSON error", while they were supposed to use same types and get same results.It turned out that
v1beta1.controlplane.antrea.tanzu.vmware.com
was actually usingv1beta2
types by mistake. It was introduced when renaming the API group toantrea.io
:antrea/pkg/legacyapis/controlplane/v1beta1/register.go
Lines 47 to 55 in ef14ad1
This would cause the consumer of the legacy controlplane v1beta1 API got unexpected response.
Beside, the field selectors of
v1beta1.controlplane.antrea.tanzu.vmware.com
andv1beta1.networking.antrea.tanzu.vmware.com
were not registered, which caused "nodeName" fieldSelector not working.Versions:
Please provide the following information:
The text was updated successfully, but these errors were encountered: