What is this error in n/w policies?

controlplane $ kubectl create -f np.yaml
error: error validating “np.yaml”: error validating data: ValidationError(NetworkPolicy.spec.ingress): invalid type for io.k8s.api.networking.v1.NetworkPolicySpec.ingress: got “map”, expected “array”; if you choose to ignore these errors, turn validation off with --validate=false


Screenshot 2021-06-26 at 7.07.12 PM

Hello, Ajey
Under the ingress rule. It should be an array.

  - ports:
     - protocol: TCP
       port: 80