Network policy creation job doesn't trigger rollback handler
Context
When running the create-netpol-gzserver
job, an error is thrown in the Orchestrator
component:
2021/03/12 13:25:08 [[Ignition Cloudsim - SubT]]Creating network policy with name [sim-6f6b9a9c-fa2b-4944-93ca-22310248da2e-gzserver] in namespace [default] failed. Error: NetworkPolicy.extensions "sim-6f6b9a9c-fa2b-4944-93ca-22310248da2e-gzserver" is invalid: [spec.ingress[1].from[0].ipBlock.cidr: Invalid value: "/32": not a valid CIDR, spec.egress[0].to[0].ipBlock.cidr: Invalid value: "/32": not a valid CIDR]
This doesn't make the action execution fail
Proposed changes
Make the create-netpol-gzserver
fail if there's an error while creating network policies.