Skip to content

Commit

Permalink
test: Populate world CIDR map in high-scale ipcache test
Browse files Browse the repository at this point in the history
Now that the datapath encapsulation and decapsulation are implemented,
the end-to-end test will fail. To decide whether we should encapsulate
or not, we lookup the world CIDR map. If no match is found, we
encapsulate. That means that we will currently always encapsulate (even
when e.g. resolving a domain name from 8.8.8.8) because the world CIDR
map is not currently populated.

The world CIDR map will be populate once the patchset introducing the
new CRD is merged. Until then, we can add a catch-all 0.0.0.0/0 entry to
not encapsulate anything. This commit can be reverted once the
CiliumWorldCIDRSet CRD is merged.

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
  • Loading branch information
pchaigno committed May 22, 2023
1 parent 705d3b6 commit 0df4db7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/k8s/datapath_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ import (

. "github.com/onsi/gomega"

"github.com/cilium/cilium/pkg/defaults"
"github.com/cilium/cilium/test/config"
. "github.com/cilium/cilium/test/ginkgo-ext"
"github.com/cilium/cilium/test/helpers"
)

var _ = Describe("K8sDatapathConfig", func() {
const (
bpffsDir string = defaults.BPFFSRoot + "/" + defaults.TCGlobalsPath + "/"
)

var (
kubectl *helpers.Kubectl
Expand Down Expand Up @@ -492,6 +496,9 @@ var _ = Describe("K8sDatapathConfig", func() {
}
deploymentManager.DeployCilium(options, DeployCiliumOptionsAndDNS)

cmd := fmt.Sprintf("bpftool map update pinned %scilium_world_cidrs4 key 0 0 0 0 0 0 0 0 value 1", bpffsDir)
kubectl.CiliumExecMustSucceedOnAll(context.TODO(), cmd)

hsIPcacheYAML := helpers.ManifestGet(kubectl.BasePath(), hsIPcacheFile)
kubectl.Create(hsIPcacheYAML).ExpectSuccess("Unable to create resource %q", hsIPcacheYAML)

Expand Down

0 comments on commit 0df4db7

Please sign in to comment.