-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Host CCNP policies rejected on master #12834
Copy link
Copy link
Closed
Labels
area/host-firewallImpacts the host firewall or the host endpoint.Impacts the host firewall or the host endpoint.area/k8sImpacts the kubernetes API, or kubernetes -> cilium internals translation layers.Impacts the kubernetes API, or kubernetes -> cilium internals translation layers.kind/bugThis is a bug in the Cilium logic.This is a bug in the Cilium logic.
Metadata
Metadata
Assignees
Labels
area/host-firewallImpacts the host firewall or the host endpoint.Impacts the host firewall or the host endpoint.area/k8sImpacts the kubernetes API, or kubernetes -> cilium internals translation layers.Impacts the kubernetes API, or kubernetes -> cilium internals translation layers.kind/bugThis is a bug in the Cilium logic.This is a bug in the Cilium logic.
#11607 broke host policies on master. They are now all rejected with:
This error is printed because
CiliumNetworkPolicy.Parse()has some new checks to prevent usingNodeSelectorin CNPs. It assumesCiliumClusterwideNetworkPolicy.Parse()will be called in the case of CCNPs withNodeSelectors. However, the k8s watcher for CCNPs callsaddCiliumNetworkPolicyV2which takes atypes.SlimCNPand therefore callsCiliumNetworkPolicy.Parse().I took a stab at a fix, but couldn't figure out an easy way to fix this (with my limited Golang skills). Of course, I could implement a counterpart to
addCiliumNetworkPolicyV2for CCNPs (e.g.,addCiliumClusterwideNetworkPolicyV2) but that's likely to result in a bit more code duplication. I'm opening this to discuss better solutions (happy to implementaddCiliumClusterwideNetworkPolicyV2is that's the best solution we have).EDIT: I found this while rebasing #12621, which will ensure we don't get any more regressions on this code.
/cc @aanm @christarazi