Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Remove special case for host identity when remote-node identity is disabled #16450

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 4 additions & 23 deletions test/k8sT/Policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,6 @@ var _ = SkipDescribeIf(func() bool {
var (
cnpFromEntitiesHost string
cnpFromEntitiesRemoteNode string
cnpFromEntitiesWorld string
cnpFromEntitiesCluster string
cnpFromEntitiesAll string

Expand All @@ -1629,7 +1628,6 @@ var _ = SkipDescribeIf(func() bool {
BeforeAll(func() {
cnpFromEntitiesHost = helpers.ManifestGet(kubectl.BasePath(), "cnp-from-entities-host.yaml")
cnpFromEntitiesRemoteNode = helpers.ManifestGet(kubectl.BasePath(), "cnp-from-entities-remote-node.yaml")
cnpFromEntitiesWorld = helpers.ManifestGet(kubectl.BasePath(), "cnp-from-entities-world.yaml")
cnpFromEntitiesCluster = helpers.ManifestGet(kubectl.BasePath(), "cnp-from-entities-cluster.yaml")
cnpFromEntitiesAll = helpers.ManifestGet(kubectl.BasePath(), "cnp-from-entities-all.yaml")

Expand Down Expand Up @@ -1733,29 +1731,12 @@ var _ = SkipDescribeIf(func() bool {
})

It("Allows from all hosts with cnp fromEntities host policy", func() {
if helpers.NativeRoutingEnabled() {
// When running native-routing mode,
// the source IP from host traffic is
// unlikely the IP assigned to the
// cilium-host interface. In the
// remote-node identity legacy mode,
// only the IP of the cilium-host
// interface is considered host. All
// other IPs are considered world.
By("Installing fromEntities host and world policy")
importPolicy(kubectl, testNamespace, cnpFromEntitiesWorld, "from-entities-world")
importPolicy(kubectl, testNamespace, cnpFromEntitiesHost, "from-entities-host")

By("Checking policy correctness")
validateConnectivity(HostConnectivityAllow, RemoteNodeConnectivityAllow, PodConnectivityDeny, WorldConnectivityAllow)
} else {
By("Installing fromEntities host policy")
importPolicy(kubectl, testNamespace, cnpFromEntitiesHost, "from-entities-host")

By("Checking policy correctness")
validateConnectivity(HostConnectivityAllow, RemoteNodeConnectivityAllow, PodConnectivityDeny, WorldConnectivityDeny)
}
By("Installing fromEntities host policy")
importPolicy(kubectl, testNamespace, cnpFromEntitiesHost, "from-entities-host")

By("Checking policy correctness")
validateConnectivity(HostConnectivityAllow, RemoteNodeConnectivityAllow, PodConnectivityDeny, WorldConnectivityDeny)
})
})

Expand Down