1593 Commits

Author SHA1 Message Date
dodgex
67f25dcaa1 feat(healthcheck): make healtcheck bind address configurable 2026-05-03 12:00:57 -05:00
dependabot[bot]
e5f2a3536c build(deps): bump github.com/aws/aws-sdk-go-v2/service/ec2
Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.295.0 to 1.299.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.295.0...service/ec2/v1.299.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2
  dependency-version: 1.299.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-01 21:36:43 +09:00
dependabot[bot]
ae29924d2c build(deps): bump github.com/aws/aws-sdk-go-v2/config
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.32.13 to 1.32.17.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.13...config/v1.32.17)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-01 18:16:42 +09:00
dependabot[bot]
93ee89c4b5 build(deps): bump golang.org/x/net from 0.52.0 to 0.53.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.52.0 to 0.53.0.
- [Commits](https://github.com/golang/net/compare/v0.52.0...v0.53.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.53.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-01 18:16:28 +09:00
Cat C
c869af25a3
build: Dependency bumps to prep for release 2.9.0 (#2063)
* build: Dependency bumps to prep for release 2.9.0
* fix(typos): Update typos config to match IZ on txt files in testdata
* chore(lint): Address issues from newer versions of golangci-lint
* fix(dockerfile): Update iptables-wrapper install according to updated installation instructions
v2.9.0
2026-04-27 22:03:39 -07:00
Cat C
8fc453c9e9
Merge commit from fork
fix: Make GoBGP server address configurable. Default it to localhost
2026-04-27 16:44:42 -07:00
Cat C
4f4be8e515 fix: Add CLI flag to make GoBGP server address configurable, and default it to localhost. Update docs to match new flag. 2026-04-26 20:45:47 -07:00
Manuel Rüger
99e0011527 chore: fix gofmt, perfsprint, and staticcheck lint issues
- Fix import ordering in lballoc.go (gofmt)
- Replace static fmt.Errorf with errors.New across multiple files (perfsprint)
- Replace fmt.Sprintf string-only calls with concatenation (perfsprint)
- Replace fmt.Sprint(int) with strconv.Itoa/FormatUint (perfsprint)
- Replace fmt.Sprintf("%x") with hex.EncodeToString (perfsprint)
- Lowercase capitalized error strings to follow Go conventions (staticcheck ST1005)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-26 16:01:52 -05:00
Manuel Rüger
5f0361188f fact: modernize Go primitives to use 1.13+ stdlib features
- Replace fmt.Errorf %s/%v + err.Error() with %w for proper error
  wrapping and errors.Is/As chain support across all packages
- Replace errors.New("msg" + err.Error()) with fmt.Errorf("msg: %w", err)
- Replace strings.Contains(err.Error(), ...) with errors.Is(err,
  syscall.EEXIST) and errors.Is(err, syscall.ESRCH) in linux_networking.go
- Remove now-unused IfaceHasAddr and IpvsServerExists string constants
- Replace sort.Strings with slices.Sort in bgp_policies.go, ipset.go,
  and testhelpers
- Replace sort.SliceStable with slices.SortStableFunc in bgp_policies.go
- Replace reflect.DeepEqual on []string with slices.Equal in bgp_policies.go
  (also fixes bug: was comparing map to slice instead of slice to slice)
- Replace reflect.DeepEqual on []*gobgpapi.Prefix with slices.EqualFunc
  comparing exported fields to avoid protobuf internal state comparison
- Replace strings.Index + manual slicing with strings.Cut in docker.go
  and classify.go
- Update cni_test.go to use assert.EqualError instead of assert.Equal
  for wrapped error comparison

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-26 16:01:52 -05:00
dependabot[bot]
d2359f280e build(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp](https://github.com/open-telemetry/opentelemetry-go) from 1.24.0 to 1.43.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.24.0...v1.43.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
  dependency-version: 1.43.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-09 10:43:56 +02:00
Cat C
90551068a8 docs(RELEASE.md): Nest prep-release instructions under major/minor revision. Add an additional lint/test step into patch release instructions 2026-04-05 15:56:19 -05:00
Aaron U'Ren
2e2fb598ea
fix(ci): use real commit SHA not annotated tag SHA for all github actions 2026-04-05 15:41:26 -05:00
Aaron U'Ren
a69544995c
fix(scorecard.yml): use the actual SHA not the annotated tag SHA for version 2026-04-05 15:32:03 -05:00
Cat C
5e2bb9f12d
Merge pull request #2052 from cloudnativelabs/advisory-fix-1
fix(NRC): Remove debug logging of raw node annotations
2026-04-05 13:29:57 -07:00
Aaron U'Ren
f439d20fc9 fact(go): switch gomoq & gotestsum to go tool
Use new Go Tool directive (available since v1.24) for generate Moqs and
gotestsum instead of install and run directives. This also consolidates
dependencies in go.mod rather than spreading them out.
2026-04-05 15:20:31 -05:00
Aaron U'Ren
8b770bc1aa fix(ci): set provenance mode to min to remove potential errors from the PR body 2026-04-05 15:20:31 -05:00
Aaron U'Ren
cca9390a45 feat(ci): add OpenSSF scorecard to workflow + README badge 2026-04-05 15:20:31 -05:00
Aaron U'Ren
eba34b5eef feat(Makefile): version gotestsum 2026-04-05 15:20:31 -05:00
Aaron U'Ren
3e9acbd2fe feat(ci): add sboms and cosign verification for official build artifacts 2026-04-05 15:20:31 -05:00
Aaron U'Ren
98712faf89 feat(Makefile): introduce grype for container scanning
Adds a scan target which is automatically added to the prep-release
target that checks for grype vulnerabilities during the release
preparation flow.
2026-04-05 15:20:31 -05:00
Aaron U'Ren
a748497da6 fix(codeql-analysis.yml): explicitly specify golang
When this is not explicitely set, codeql still works, but if anything
ever changes (with autodetection) in the future, it will just silently
succeed without producing results. This corrects that by explicitely
saying that we want it to look for golang.
2026-04-05 15:20:31 -05:00
Aaron U'Ren
4aa5c136a3 feat(ci): pin all GitHub actions using SHA sums
With the prevalance of recent supply chain attacks, this helps avert
dependency tampering with re-released versions by pinning to specific
SHA sums.

This is fully compliant with dependabot as it will update both the SHA
and the commented version when it does its updates.

This also helps prepare for OpenSSF integration by hardening the CI
process.
2026-04-05 15:20:31 -05:00
Aaron U'Ren
f6d333c709 fact(ci): split ci flow across multiple files
Attempts to bound the context a bit when people have to look at these
files by splitting them across multiple files and making each one
logical part of the CI lifecycle.
2026-04-05 15:20:31 -05:00
Aaron U'Ren
3e622b0c90 fix(ci.yml): replace deprecated set-output with GITHUB_OUTPUT 2026-04-05 15:20:31 -05:00
Aaron U'Ren
3ce2952cfe feat(ci.yml): add unicode security checks and restructure CI pipeline 2026-04-05 15:20:31 -05:00
Aaron U'Ren
7943828294 fix(prep-release): handle yaml anchors in GH actions and add tests 2026-04-05 15:00:03 -05:00
Aaron U'Ren
770f905723 feat(prep-release): handle non-versioned docker images also 2026-04-05 15:00:03 -05:00
Aaron U'Ren
518ce542c0 fix(Makefile): run doctoc and spellcheck from tagged images 2026-04-05 15:00:03 -05:00
Aaron U'Ren
6f161fb9f0 fix(prep-release): ensure toolchain atomicity
Ensure that the go version (and others) is the same across all points of
reference. In the case of golang, we start by derriving the available go
version from our distro of choice (Alpine) to ensure that it is used the
same everywhere.
2026-04-05 15:00:03 -05:00
Aaron U'Ren
9ae5497995 feat(prep-release): create authoritative pre-release update process
Previously, this was done manually by humans and was therefore not
always done consistently. Sometimes dependencies would be missed,
other times dependencies would not be updated at all.

Additionally, we only used tags which, while good from a release point
of view, were not proof against supply chain attacks. This automates the
process to hopefully bring in a sense of consistently and allow us to
leverage SHA sums to guard against supply chain attacks.
2026-04-05 15:00:03 -05:00
Cat C
878eebbd01 fix(NRC): Remove debug logging of raw node annotations that leaks BGP password. Credit to: @offset 2026-04-02 18:45:22 -07:00
dependabot[bot]
a1b642bb88 build(deps): bump github.com/aws/aws-sdk-go-v2/config
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.32.12 to 1.32.13.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.12...config/v1.32.13)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 11:25:21 +02:00
dependabot[bot]
1e35839c59 build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.41.4 to 1.41.5
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.41.4 to 1.41.5.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.41.4...v1.41.5)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.41.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 11:17:12 +02:00
dependabot[bot]
0dd38237b5 build(deps): bump github.com/hashicorp/go-version from 1.8.0 to 1.9.0
Bumps [github.com/hashicorp/go-version](https://github.com/hashicorp/go-version) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/hashicorp/go-version/releases)
- [Changelog](https://github.com/hashicorp/go-version/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-version/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-version
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 11:16:51 +02:00
Cat C
a051e0eec7
Merge pull request #2017 from 1fabi0/feature_kep-1860
feat(services): support ipMode Proxy for LoadBalancer ingresses
2026-03-31 19:28:21 -07:00
Aprazors
20a2e034b9 test(NSC): reorganize test files per reviewer feedback
Move tests from hardening_test.go into the files requested by aauren:
- TestShuffleDoesNotPanicOnEmptySlice → network_services_controller_test.go
- TestSetupMangleTableRuleRejectsInvalidIP → network_services_controller_test.go
- TestNodePortHealthCheckConcurrentAccess → new nodeport_healthcheck_test.go

Delete hardening_test.go (now empty).
2026-03-31 20:30:15 -05:00
Aprazors
59c5ec69fd test(NSC): add tests for shuffle, healthcheck concurrency, and invalid IP handling
Table-driven tests following project conventions (testify assertions,
subtests) covering:
- shuffle: empty, single, and multi-element slices don't panic
- NodePort healthcheck: concurrent read/write with RWMutex is safe
- ParseIP: invalid IPs correctly return nil
2026-03-31 20:30:15 -05:00
Aprazors
aba49a9892 fix(NSC): harden Network Services Controller against panics, races, and sync errors
This combines five defensive fixes in the Network Services Controller:

1. shuffle(): check rand.Int error before dereferencing result
   - rand.Int returns (nil, err) on failure, but the result was
     dereferenced before the error check, causing a nil panic

2. NodePort healthcheck: add RWMutex to protect shared maps
   - UpdateServicesInfo writes serviceInfoMap/endpointsInfoMap from
     the sync goroutine while HTTP handlers read concurrently

3. setupIpvsFirewall: use continue instead of return in dual-stack loop
   - return nil after clearing one IP family's chain skipped the
     second family entirely on dual-stack nodes

4. setupMangleTableRule/cleanupMangleTableRule: add nil check for ParseIP
   - net.ParseIP result was used without nil check, causing panic
     on malformed IP strings from service annotations

5. synctypeIpvs: track errors across both sync steps for heartbeat
   - err from syncIpvsServices was overwritten by syncHairpinIptablesRules,
     masking IPVS failures from the health check system
2026-03-31 20:30:15 -05:00
Aprazors
01f8216d24 fix(NRC): extend atomic.Bool to initSrcDstCheckDone and ec2IamAuthorized
bgpServerStarted was already fixed. This commit applies the same pattern
to initSrcDstCheckDone and ec2IamAuthorized, which are written from Run()
and the AWS src-dst-check path and read from syncInternalPeers() via
bgp_peers.go — potential data race under concurrent BGP peer syncs.

Also adds TestAtomicBoolFieldsNoConcurrentDataRace to
network_routes_controller_test.go to exercise all three fields under
the race detector.
2026-03-31 20:21:44 -05:00
Aprazors
fc89d09356 fix(NRC): use atomic.Bool for bgpServerStarted to prevent data race
bgpServerStarted is written in Run() on the controller goroutine and
read from informer callbacks (OnNodeUpdate, handleServiceUpdate,
handleServiceDelete, OnEndpointsAdd, OnEndpointsUpdate) which run on
a separate goroutine. This is a data race.

Replace the plain bool with sync/atomic.Bool, using Store() for writes
and Load() for reads, to make cross-goroutine access safe without
requiring the caller to hold nrc.mu.
2026-03-31 20:21:44 -05:00
Kamp, Fabian
421fd43623 feat(services): support ipMode Proxy for LoadBalancer ingresses
This implements support for KEP-1860. When a LoadBalancer ingress has ipMode set to 'Proxy', kube-router will skip adding the IP to the local IPVS table and will not hijack the traffic. If ipMode is 'VIP' or unset, the current behavior is maintained.

Fixes #2014
2026-03-24 16:58:26 +01:00
dependabot[bot]
9904bd3572 build(deps): bump github.com/aws/aws-sdk-go-v2/service/ec2
Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.285.0 to 1.295.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.285.0...service/ec2/v1.295.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2
  dependency-version: 1.295.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-21 02:36:48 +01:00
dependabot[bot]
ebb9c71710 build(deps): bump github.com/aws/aws-sdk-go-v2/config
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.32.7 to 1.32.12.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.32.7...config/v1.32.12)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 17:13:20 +01:00
dependabot[bot]
d4fae3cd64 build(deps): bump github.com/aws/aws-sdk-go-v2/feature/ec2/imds
Bumps [github.com/aws/aws-sdk-go-v2/feature/ec2/imds](https://github.com/aws/aws-sdk-go-v2) from 1.18.17 to 1.18.20.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/config/v1.18.20/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.17...config/v1.18.20)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/ec2/imds
  dependency-version: 1.18.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 11:06:16 +01:00
dependabot[bot]
b66791fbbb build(deps): bump golang.org/x/net from 0.51.0 to 0.52.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.51.0 to 0.52.0.
- [Commits](https://github.com/golang/net/compare/v0.51.0...v0.52.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.52.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 10:48:44 +01:00
dependabot[bot]
8d2292e823 build(deps): bump docker/setup-buildx-action from 3 to 4
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3 to 4.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 10:48:34 +01:00
dependabot[bot]
05955f49e0 build(deps): bump docker/setup-qemu-action from 3 to 4
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3 to 4.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 08:57:05 +01:00
dependabot[bot]
1a2e20413d build(deps): bump docker/login-action from 3 to 4
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 08:56:55 +01:00
dependabot[bot]
0802c742a5 build(deps): bump docker/build-push-action from 6 to 7
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6 to 7.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 08:56:46 +01:00
dependabot[bot]
8929cc7a32 build(deps): bump google.golang.org/grpc from 1.78.0 to 1.79.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.78.0 to 1.79.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.78.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 08:28:54 +01:00