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

Merge main to Release 1.0 #147

Merged
merged 69 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
9e93bfa
Move to mainline sdk changes (#25)
jayanthvn Aug 16, 2023
5c43fa2
Reuse eBPF SDK Client (#26)
achevuru Aug 16, 2023
77bf766
Code refactoring - Sync to SDK's new API interface (#27)
achevuru Aug 22, 2023
079989b
Additional UTs for eBPF pkg (#29)
achevuru Aug 25, 2023
0605731
Events refactor (#30)
jayanthvn Aug 26, 2023
d51ade9
update readme (#31)
geoffcline Aug 28, 2023
cb02230
Third party attribution doc (#32)
jayanthvn Aug 28, 2023
a95d0f3
README Updates (#34)
achevuru Aug 28, 2023
cf57309
Update README.md (#35)
achevuru Aug 28, 2023
c4922c5
Update go.mod and go.sum for master (#38)
jayanthvn Aug 29, 2023
475ab55
Run Conformance and Performance tests with github actions (#5)
jaydeokar Aug 29, 2023
e5c1e3c
Updated conformance and performance test parameters (#39)
jaydeokar Aug 31, 2023
7e61c86
Fix problem with policy not being applied to pods on IPv6 nodes (#40)
rxnew Sep 1, 2023
55936d4
Update the session duration to 5 hrs for github actions (#53)
jaydeokar Sep 7, 2023
e2a4670
Update scripts to run cyclonus suite and install latest MAO
jaydeokar Sep 11, 2023
8cb6c86
Merge pull request #57 from jaydeokar/move_scripts
jaydeokar Sep 11, 2023
b6e6964
Handle 0 entries in cli (#60)
jayanthvn Sep 12, 2023
364227d
Update test pkg (#61)
jayanthvn Sep 12, 2023
5cec743
Ignore policy restrictions against Node IP (#65)
achevuru Sep 14, 2023
a2760c2
feat: Add flag enable-policy-event-logs (#48)
mycrEEpy Sep 15, 2023
eec548b
Issue#45 Modified Default Metrics Bind Port (#46)
kareem-rady Sep 15, 2023
5fb09ba
Bump github.com/google/uuid from 1.3.0 to 1.3.1 (#43)
dependabot[bot] Sep 15, 2023
dc4b2c2
Bump github.com/vishvananda/netlink (#42)
dependabot[bot] Sep 15, 2023
f05b687
Add update image script and make targets (#59)
jaydeokar Sep 16, 2023
7a03fbe
Fixes to cyclonus test script (#69)
jaydeokar Sep 19, 2023
f0f9916
Remove KUBECONFIG environment variable from cyclonus test script
jaydeokar Sep 20, 2023
1c29fff
Merge pull request #70 from jaydeokar/main
jaydeokar Sep 20, 2023
fb7bac9
With catchALL honor "except" (#58)
jayanthvn Sep 21, 2023
6ed6854
Remove unnecessary header files (#71)
achevuru Sep 21, 2023
318cd93
Return exit status if test verification fails
jaydeokar Sep 26, 2023
8d84200
Merge pull request #75 from jaydeokar/main
jaydeokar Sep 26, 2023
84ea335
Merge branch 'release-1.0' into main
achevuru Sep 26, 2023
a9ac72a
V6 Optimizations (#80)
jayanthvn Oct 1, 2023
9bd3912
Bump github.com/aws/amazon-vpc-cni-k8s from 1.13.4 to 1.15.0 (#82)
dependabot[bot] Oct 2, 2023
c7dc25f
Honor V6 Elf file updates (#84)
jayanthvn Oct 2, 2023
a0f76d8
Build latest image with conformance tests (#85)
jaydeokar Oct 3, 2023
4ca0abd
Create a github action to build multi-arch docker image
jaydeokar Oct 3, 2023
79155de
Update credentials action to v3
jaydeokar Oct 3, 2023
de7e237
Merge pull request #86 from jaydeokar/build-image-e2e-2
jaydeokar Oct 3, 2023
0a8a9c2
Log rotate support (#87)
achevuru Oct 4, 2023
1979f2d
Bump go.uber.org/zap from 1.25.0 to 1.26.0 (#81)
dependabot[bot] Oct 4, 2023
d764caf
Merge branch 'release-1.0' into main
achevuru Oct 4, 2023
9752cb7
Race condition with init and cw setup (#93)
jayanthvn Oct 9, 2023
644ae96
Bump golang.org/x/net from 0.12.0 to 0.17.0 (#95)
dependabot[bot] Oct 11, 2023
18cc20f
upgrade Go to 1.21.3 and upgrade dependencies
jdn5126 Oct 13, 2023
6c44a6b
Merge pull request #96 from jdn5126/main
jdn5126 Oct 14, 2023
653cf1f
Fix conntrack issue and increase supported port/protocol (#102)
jayanthvn Oct 20, 2023
87d7121
Pull test images from internal test infra accounts (#79)
jaydeokar Oct 24, 2023
2db5125
Handle PolicyEndpoint split scenario when the target pods are paired …
achevuru Oct 24, 2023
9396466
inherit firewall rules from larger cidrs (#104)
jayanthvn Oct 24, 2023
312e175
Update pr-tests.yaml (#112)
jayanthvn Oct 25, 2023
52bb111
Handle for controller not adding prefix lens (#113)
jayanthvn Oct 25, 2023
d0dfca8
Minor refactor (#116)
jayanthvn Oct 26, 2023
e1c9064
README Update (#117)
achevuru Oct 27, 2023
8a27f18
Update issue templates (#121)
jayanthvn Oct 31, 2023
ed94728
add more checks in pr actions
haouc Nov 3, 2023
8308067
Merge pull request #128 from haouc/update-actions
haouc Nov 4, 2023
ab71f87
Bump github.com/go-logr/logr from 1.2.4 to 1.3.0 (#126)
dependabot[bot] Nov 8, 2023
3865cfb
Bump github.com/aws/aws-sdk-go from 1.45.19 to 1.47.5 (#134)
dependabot[bot] Nov 8, 2023
e5d75e2
Bump k8s.io/client-go from 0.28.2 to 0.28.3 (#123)
dependabot[bot] Nov 8, 2023
533f69c
Bump sigs.k8s.io/controller-runtime from 0.16.2 to 0.16.3 (#122)
dependabot[bot] Nov 8, 2023
d967398
Conntrack cleanup issue with v1.0.5 (#133)
jayanthvn Nov 9, 2023
836ea81
force vulns check to use specified go patch version (#137)
haouc Nov 18, 2023
67f85ca
Updating the expected results for known flaky test cases
jaydeokar Nov 20, 2023
341290d
Merge pull request #140 from jaydeokar/update_test_cases
jaydeokar Nov 20, 2023
8545aef
Memory corruption (#142)
jayanthvn Nov 24, 2023
54b25c9
Merge main to rel-1.0
jayanthvn Nov 24, 2023
94caf30
Merge extra call
jayanthvn Nov 24, 2023
6b33bc7
remove unwanted prints
jayanthvn Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.4'
cache-dependency-path: "**/go.sum"
- name: Install `govulncheck`
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run `govulncheck`
Expand Down
35 changes: 21 additions & 14 deletions pkg/ebpf/bpf_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func NewBpfClient(policyEndpointeBPFContext *sync.Map, nodeIP string, enablePoli
GlobalMaps: new(sync.Map),
}
ebpfClient.logger = ctrl.Log.WithName("ebpf-client")

ingressBinary, egressBinary, eventsBinary,
cliBinary, hostMask := TC_INGRESS_BINARY, TC_EGRESS_BINARY, EVENTS_BINARY, EKS_CLI_BINARY, IPv4_HOST_MASK
if enableIPv6 {
Expand Down Expand Up @@ -739,6 +738,8 @@ func sortFirewallRulesByPrefixLength(rules []EbpfFirewallRules, prefixLenStr str
}

func (l *bpfClient) computeMapEntriesFromEndpointRules(firewallRules []EbpfFirewallRules) (map[string]uintptr, error) {

firewallMap := make(map[string][]byte)
mapEntries := make(map[string]uintptr)
ipCIDRs := make(map[string][]v1alpha1.Port)
nonHostCIDRs := make(map[string][]v1alpha1.Port)
Expand All @@ -749,7 +750,7 @@ func (l *bpfClient) computeMapEntriesFromEndpointRules(firewallRules []EbpfFirew
_, mapKey, _ := net.ParseCIDR(l.nodeIP + l.hostMask)
key := utils.ComputeTrieKey(*mapKey, l.enableIPv6)
value := utils.ComputeTrieValue([]v1alpha1.Port{}, l.logger, true, false)
mapEntries[string(key)] = uintptr(unsafe.Pointer(&value[0]))
firewallMap[string(key)] = value

//Sort the rules
sortFirewallRulesByPrefixLength(firewallRules, l.hostMask)
jayanthvn marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -758,10 +759,10 @@ func (l *bpfClient) computeMapEntriesFromEndpointRules(firewallRules []EbpfFirew
catchAllIPPorts, isCatchAllIPEntryPresent, allowAll = l.checkAndDeriveCatchAllIPPorts(firewallRules)
if isCatchAllIPEntryPresent {
//Add the Catch All IP entry
_, mapKey, _ = net.ParseCIDR("0.0.0.0/0")
key = utils.ComputeTrieKey(*mapKey, l.enableIPv6)
value = utils.ComputeTrieValue(catchAllIPPorts, l.logger, allowAll, false)
mapEntries[string(key)] = uintptr(unsafe.Pointer(&value[0]))
_, mapKey, _ := net.ParseCIDR("0.0.0.0/0")
key := utils.ComputeTrieKey(*mapKey, l.enableIPv6)
value := utils.ComputeTrieValue(catchAllIPPorts, l.logger, allowAll, false)
firewallMap[string(key)] = value
}

for _, firewallRule := range firewallRules {
Expand Down Expand Up @@ -812,22 +813,28 @@ func (l *bpfClient) computeMapEntriesFromEndpointRules(firewallRules []EbpfFirew
firewallRule.L4Info = append(firewallRule.L4Info, catchAllIPPorts...)

l.logger.Info("Updating Map with ", "IP Key:", firewallRule.IPCidr)
_, mapKey, _ = net.ParseCIDR(string(firewallRule.IPCidr))
_, firewallMapKey, _ := net.ParseCIDR(string(firewallRule.IPCidr))
// Key format: Prefix length (4 bytes) followed by 4/16byte IP address
key = utils.ComputeTrieKey(*mapKey, l.enableIPv6)
value = utils.ComputeTrieValue(firewallRule.L4Info, l.logger, allowAll, false)
mapEntries[string(key)] = uintptr(unsafe.Pointer(&value[0]))
firewallKey := utils.ComputeTrieKey(*firewallMapKey, l.enableIPv6)
firewallValue := utils.ComputeTrieValue(firewallRule.L4Info, l.logger, allowAll, false)
firewallMap[string(firewallKey)] = firewallValue
}
if firewallRule.Except != nil {
for _, exceptCIDR := range firewallRule.Except {
_, mapKey, _ = net.ParseCIDR(string(exceptCIDR))
key = utils.ComputeTrieKey(*mapKey, l.enableIPv6)
_, mapKey, _ := net.ParseCIDR(string(exceptCIDR))
key := utils.ComputeTrieKey(*mapKey, l.enableIPv6)
l.logger.Info("Parsed Except CIDR", "IP Key: ", mapKey)
value = utils.ComputeTrieValue(firewallRule.L4Info, l.logger, false, true)
mapEntries[string(key)] = uintptr(unsafe.Pointer(&value[0]))
value := utils.ComputeTrieValue(firewallRule.L4Info, l.logger, false, true)
firewallMap[string(key)] = value
}
}
}

//Add to mapEntries
for key, value := range firewallMap {
byteSlicePtr := unsafe.Pointer(&value[0])
mapEntries[key] = uintptr(byteSlicePtr)
}
return mapEntries, nil
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/lib/verify_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def verify_results(file_name,ip_family):
# expected_results maintains a mapping of the test number and the number of sub-tests that are expected to pass for v4/v6 clusters
# For the test numbers not included in this map, it is expected that all the sub-tests should be passing
if ip_family == "IPv6":
expected_results={ 2:80, 3:80, 8:80, 12:80, 23:80, 25:80, 26:80, 28:80,29:80, 31:77, 98:80, 102:72, 104:72, 106:72, 108:72, 111:80, 112:80 }
expected_results={ 2:80, 3:80, 8:80, 12:64, 23:80, 25:80, 26:80, 28:80, 29:80, 31:50, 98:80, 102:72, 104:72, 106:72, 108:72, 111:80, 112:80 }
else:
expected_results={ 2:80, 3:80, 8:80, 12:80, 23:80, 25:80, 26:80, 28:80, 29:80, 31:80, 98:80, 111:80, 112:80 }
expected_results={ 2:80, 3:80, 8:80, 12:80, 23:80, 25:80, 26:80, 28:80, 29:80, 31:50, 98:80, 111:80, 112:80 }

start="starting test case"
wrong="wrong"
Expand Down
Loading