• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cilium / cilium / 11152
39%

Build:
DEFAULT BRANCH: master
Ran 04 Oct 2019 04:21PM UTC
Jobs 1
Files 442
Run time 37s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Oct 2019 04:00PM UTC coverage: 45.483% (-0.03%) from 45.516%
11152

push

travis-ci-com

ianvernon
policy: remove checking of CIDR-based fields from `IsLabelBased` checks

CIDR-based policy is converted to a label-based representation, so CIDR-policy
is in a sense label-based. Update the `IsLabelBased` functions for ingress and
egress rules, as well as add unit tests accordingly. The removal of checking of
CIDR-based fields in the `IsLabelBased` checks means that we now do wildcarding
at L7 for CIDR-based rules as well in addition to `EndpointSelector` based
rules. Policies like the following will now result in wildcarding at L7:

```
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
description: "L3-L4-L7 CIDR policy"
metadata:
  name: "l7-cidr-cnp"
spec:
  egress:
  - toCIDR:
    - 1.2.3.4/32
    toPorts:
    - ports:
      - port: "80"
        protocol: TCP
      rules:
        http:
        - headers:
          - 'X-My-Header: true'
          method: GET
          path: /
  endpointSelector:
    matchLabels:
      id: app1
```

```
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
description: "L3 CIDR policy"
metadata:
  name: "l3-cidr-cnp"
spec:
  egress:
  - toCIDR:
    - 1.2.3.4/32
  endpointSelector:
    matchLabels:
      id: app1
```

In other words, even though there is one rule (l7-cidr-cnp) which only allows
egress access to `GET /` with `X-My-Header:true` to `1.2.3.4/32` on port 80/TCP,
the second rule (l3-cidr-cnp) pokes a wider hole in the firewall to allow all
egress traffic to 1.2.3.4. However, we still will redirect to the proxy, but
we will allow all traffic to preserve existing behavior for visibility purposes.

Note that rules with `ToServices` and `ToFQDNs` are not considered label based
as of this commit.

Signed-off by: Ian Vernon <ian@cilium.io>

25792 of 56707 relevant lines covered (45.48%)

1202.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11152.1 04 Oct 2019 04:21PM UTC 0
45.48
Travis Job 11152.1
Source Files on build 11152
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #11152
  • 19c4b54f on github
  • Prev Build on master (#11146)
  • Next Build on master (#11163)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc