Invalid network policy when using allUdp and allTcp #2176
Labels
bug
Something isn't working
@component/cdk8s-plus
Issue related to cdk8s-plus
effort/small
1 day tops
priority/p1
Should be on near term plans
Description of the bug:
When using
ports: [kplus.NetworkPolicyPort.allTcp(), kplus.NetworkPolicyPort.allUdp()]
when rendering aNetworkPolicy
, it will generate a manifest likeHowever, when applying this to AWS, the following error is generated
The NetworkPolicy "mynetworkpolicy" is invalid: \n* spec.egress[0].ports[0].port: Invalid value: 0: must be between 1 and 65535, inclusive\n* spec.egress[0].ports[1].port: Invalid value: 0: must be between 1 and 65535, inclusive
This seems to originate from: https://github.com/cdk8s-team/cdk8s-plus/blob/k8s-29/main/src/network-policy.ts#L60
Reproduction Steps:
Error Log:
The NetworkPolicy "mynetworkpolicy" is invalid: \n* spec.egress[0].ports[0].port: Invalid value: 0: must be between 1 and 65535, inclusive\n* spec.egress[0].ports[1].port: Invalid value: 0: must be between 1 and 65535, inclusive
Environment:
cdk8s: 2.198.138
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
Other:
We use Kubectl layer 1.29, and cluster version 1.29.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: