Skip to content

Commit 92e2e9b

Browse files
authored
Merge pull request #5319 from asood-rh/CORENET-5959
K8s rebase 1.33
2 parents 627204a + ee7d6f3 commit 92e2e9b

File tree

1,054 files changed

+80574
-22980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,054 files changed

+80574
-22980
lines changed

.coderabbit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
paths_ignore:
2+
- "**/vendor/**"

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
env:
23-
K8S_VERSION: v1.32.3
23+
K8S_VERSION: v1.33.1
2424
KIND_CLUSTER_NAME: ovn
2525
KIND_INSTALL_INGRESS: true
2626
KIND_ALLOW_SYSTEM_WRITES: true
@@ -61,7 +61,7 @@ jobs:
6161
- name: Verify
6262
uses: golangci/golangci-lint-action@v6
6363
with:
64-
version: v1.60.3
64+
version: v1.64.8
6565
working-directory: go-controller
6666
args: --modules-download-mode=vendor --timeout=15m0s --verbose
6767

contrib/kind-common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if_error_exit() {
3434

3535
set_common_default_params() {
3636
KIND_IMAGE=${KIND_IMAGE:-kindest/node}
37-
K8S_VERSION=${K8S_VERSION:-v1.32.3}
37+
K8S_VERSION=${K8S_VERSION:-v1.33.1}
3838
}
3939

4040
run_kubectl() {

docs/ci/ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ and set the environmental variable `K8S_VERSION` to the same value. Also make su
120120
your go directory with `export GOPATH=(...)`.
121121

122122
```
123-
K8S_VERSION=v1.32.3
123+
K8S_VERSION=v1.33.1
124124
git clone --single-branch --branch $K8S_VERSION https://github.com/kubernetes/kubernetes.git $GOPATH/src/k8s.io/kubernetes/
125125
pushd $GOPATH/src/k8s.io/kubernetes/
126126
make WHAT="test/e2e/e2e.test vendor/github.com/onsi/ginkgo/ginkgo cmd/kubectl"

docs/installation/launching-ovn-kubernetes-on-kind.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ sudo ln -s /usr/bin/kubectl-v1.17.3 /usr/bin/kubectl
375375
Download and install latest version of `kubectl`:
376376

377377
```
378-
$ K8S_VERSION=v1.32.3
378+
$ K8S_VERSION=v1.33.1
379379
$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubectl
380380
$ chmod +x kubectl
381381
$ sudo mv kubectl /usr/bin/kubectl-$K8S_VERSION
@@ -431,7 +431,7 @@ $ cd ../dist/images/
431431
$ make fedora-image
432432
433433
$ cd ../../contrib/
434-
$ PLATFORM_IPV4_SUPPORT=true PLATFORM_IPV6_SUPPORT=true K8S_VERSION=v1.32.3 ./kind.sh
434+
$ PLATFORM_IPV4_SUPPORT=true PLATFORM_IPV6_SUPPORT=true K8S_VERSION=v1.33.1 ./kind.sh
435435
```
436436

437437
Once `kind.sh` completes, setup kube config file:
@@ -457,7 +457,7 @@ one (or both of) the following variables:
457457

458458
```
459459
$ cd ../../contrib/
460-
$ KIND_IMAGE=example.com/kindest/node K8S_VERSION=v1.32.3 ./kind.sh
460+
$ KIND_IMAGE=example.com/kindest/node K8S_VERSION=v1.33.1 ./kind.sh
461461
```
462462

463463
### Using kind local registry to deploy non ovn-k containers

go-controller/cmd/ovnkube-trace/ovnkube-trace.go

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ import (
1515
"strings"
1616

1717
corev1 "k8s.io/api/core/v1"
18+
discoveryv1 "k8s.io/api/discovery/v1"
1819
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1920
"k8s.io/apimachinery/pkg/runtime"
2021
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
22+
discoveryv1client "k8s.io/client-go/kubernetes/typed/discovery/v1"
2123
"k8s.io/client-go/rest"
2224
"k8s.io/client-go/tools/clientcmd"
2325
"k8s.io/client-go/tools/remotecommand"
@@ -44,7 +46,7 @@ const (
4446
const (
4547
// nbdb and sbdb local socket file path and protocol string which are
4648
// used by ovnkube-trace for establishing the connection when node
47-
// runs on its own zone in an interconnect environment.
49+
// runs on its own zone in an interconnect environment
4850
nbdbServerSock = "unix:/var/run/ovn/ovnnb_db.sock"
4951
sbdbServerSock = "unix:/var/run/ovn/ovnsb_db.sock"
5052
sockProtocol = "unix"
@@ -364,72 +366,90 @@ func getSvcInfo(coreclient *corev1client.CoreV1Client, restconfig *rest.Config,
364366
ClusterIP: clusterIPStr,
365367
}
366368

367-
ep, err := coreclient.Endpoints(namespace).Get(context.TODO(), svcName, metav1.GetOptions{})
369+
discoveryClient, err := discoveryv1client.NewForConfig(restconfig)
368370
if err != nil {
369-
return nil, fmt.Errorf("endpoints for service %s in namespace %s not found, err: %v", svcName, namespace, err)
371+
return nil, fmt.Errorf("failed to create discovery client: %w", err)
370372
}
371-
klog.V(5).Infof("==> Got Endpoint %v for service %s in namespace %s\n", ep, svcName, namespace)
372373

373-
err = extractSubsetInfo(coreclient, restconfig, ep.Subsets, svcInfo, ovnNamespace, addressFamily)
374+
es, err := discoveryClient.EndpointSlices(namespace).List(context.TODO(), metav1.ListOptions{
375+
LabelSelector: fmt.Sprintf("kubernetes.io/service-name=%s", svcName),
376+
})
377+
if err != nil {
378+
return nil, fmt.Errorf("EndpointSlices for service %s in namespace %s not found, err: %w", svcName, namespace, err)
379+
}
380+
klog.V(5).Infof("==> Got EndpointSlices %v for service %s in namespace %s\n", es, svcName, namespace)
381+
382+
err = extractEndpointSliceInfo(coreclient, restconfig, es.Items, svcInfo, ovnNamespace, addressFamily)
374383
if err != nil {
375384
return nil, err
376385
}
377386

378387
return svcInfo, err
379388
}
380389

381-
// extractSubsetInfo copies information from the endpoint subsets into the SvcInfo object.
390+
// extractEndpointSliceInfo copies information from the endpoint slices into the SvcInfo object.
382391
// Modifies the svcInfo object the pointer of which is passed to it.
383-
func extractSubsetInfo(coreclient *corev1client.CoreV1Client, restconfig *rest.Config, subsets []corev1.EndpointSubset, svcInfo *SvcInfo, ovnNamespace, addressFamily string) error {
384-
for _, subset := range subsets {
385-
klog.V(5).Infof("==> Trying to extract information for service %s in namespace %s from subset %v",
386-
svcInfo.SvcName, svcInfo.SvcNamespace, subset)
392+
// slice is *discoveryv1.EndpointSlice slices is
393+
func extractEndpointSliceInfo(coreclient *corev1client.CoreV1Client, restconfig *rest.Config, slices []discoveryv1.EndpointSlice, svcInfo *SvcInfo, ovnNamespace, addressFamily string) error {
394+
395+
for _, slice := range slices {
396+
klog.V(5).Infof("==> Trying to extract information for service %s in namespace %s from slice %v",
397+
svcInfo.SvcName, svcInfo.SvcNamespace, slice)
387398

388-
// Find a port for the subset.
399+
// Find a port for the endpoint slice.
389400
var podPort string
390-
for _, port := range subset.Ports {
391-
podPort = strconv.Itoa(int(port.Port))
401+
for _, epPort := range slice.Ports {
402+
if epPort.Port == nil {
403+
klog.V(5).Infof("==> Endpoint Port is nil, skipping.")
404+
continue // with the next port
405+
}
406+
podPort = strconv.Itoa(int(*epPort.Port))
392407
if podPort == "" {
393-
klog.V(5).Infof("==> Could not parse port %v, skipping.", port)
408+
klog.V(5).Infof("==> Could not parse port %v, skipping.", epPort)
394409
continue // with the next port
395410
}
396411
}
397-
// Continue with the next subset if podPort is empty.
412+
// Continue with the next slice if podPort is empty.
398413
if podPort == "" {
399-
continue // with the next subset
414+
continue // with the next slice
400415
}
401416

402-
// Parse pod information from the subset addresses. One of the subsets must have a valid address which does not belong
417+
// Parse pod information from the endpoint slice addresses. One of the slices must have a valid address which does not belong
403418
// to a host networked pod.
404-
for _, epAddress := range subset.Addresses {
419+
for _, endpoint := range slice.Endpoints {
420+
epAddress := endpoint.Addresses
421+
if len(epAddress) == 0 {
422+
klog.V(5).Infof("Address is empty for endpoint. Skipping.")
423+
continue
424+
}
405425
// This is nil for host networked services.
406-
if epAddress.TargetRef == nil {
426+
if endpoint.TargetRef == nil {
407427
klog.V(5).Infof("Address %v belongs to a host networked pod. Skipping.", epAddress)
408428
continue // with the next address
409429
}
410-
if epAddress.TargetRef.Name == "" || epAddress.TargetRef.Namespace == "" || epAddress.IP == "" {
411-
klog.V(5).Infof("Address %v contains invalid data. podName %s, podNamespace %s, podIP %s. Skipping.",
412-
epAddress, epAddress.TargetRef.Name, epAddress.TargetRef.Namespace, epAddress.IP)
430+
if endpoint.TargetRef.Name == "" || endpoint.TargetRef.Namespace == "" {
431+
klog.V(5).Infof("Address %v contains invalid data. podName %s, podNamespace %s. Skipping.",
432+
epAddress, endpoint.TargetRef.Name, endpoint.TargetRef.Namespace)
413433
continue // with the next address
414434
}
415435

416436
// Get info needed for the src Pod
417-
svcPodInfo, err := getPodInfo(coreclient, restconfig, epAddress.TargetRef.Name, ovnNamespace, epAddress.TargetRef.Namespace, addressFamily)
437+
svcPodInfo, err := getPodInfo(coreclient, restconfig, endpoint.TargetRef.Name, ovnNamespace, endpoint.TargetRef.Namespace, addressFamily)
418438
if err != nil {
419-
klog.Exitf("Failed to get information from pod %s: %v", epAddress.TargetRef.Name, err)
439+
klog.Exitf("Failed to get information from pod %s: %v", endpoint.TargetRef.Name, err)
420440
}
421441
klog.V(5).Infof("svcPodInfo is %s\n", svcPodInfo)
422442

423443
// At this point, we should have found valid pod information + a port, so set them and return nil.
424444
svcInfo.PodInfo = svcPodInfo
425445
svcInfo.PodPort = podPort
426-
klog.V(5).Infof("==> Got address and port information for service endpoint. podName: %s, podNamespace: %s, podIP: %s, podPort: %s, podNodeName: %s",
446+
klog.V(5).Infof("==> Got address and port information for service endpoint slice. podName: %s, podNamespace: %s, podIP: %s, podPort: %s, podNodeName: %s",
427447
svcInfo.PodInfo.PodName, svcInfo.PodInfo.PodNamespace, svcInfo.PodInfo.IP, svcInfo.PodPort, svcInfo.PodInfo.NodeName)
428448
return nil
429449
}
430450
}
431451

432-
return fmt.Errorf("could not extract pod and port information from endpoints for service %s in namespace %s", svcInfo.SvcName, svcInfo.SvcNamespace)
452+
return fmt.Errorf("could not extract pod and port information from endpointslice for service %s in namespace %s", svcInfo.SvcName, svcInfo.SvcNamespace)
433453
}
434454

435455
// getPodInfo returns a pointer to a fully populated PodInfo struct, or error on failure.
@@ -1222,7 +1242,6 @@ func main() {
12221242
}
12231243

12241244
klog.V(5).Infof("OVN Kubernetes namespace is %s", ovnNamespace)
1225-
12261245
if *dumpVRFTableIDs {
12271246
nodesVRFTableIDs, err := findUserDefinedNetworkVRFTableIDs(coreclient, restconfig, ovnNamespace)
12281247
if err != nil {

go-controller/go.mod

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/ovn-org/ovn-kubernetes/go-controller
22

3-
go 1.23.0
3+
go 1.24.0
44

5-
toolchain go1.23.6
5+
toolchain go1.24.5
66

77
require (
88
github.com/Microsoft/hcsshim v0.9.6
@@ -18,7 +18,7 @@ require (
1818
github.com/go-logr/logr v1.4.2
1919
github.com/go-logr/stdr v1.2.2
2020
github.com/godbus/dbus/v5 v5.1.0
21-
github.com/google/go-cmp v0.6.0
21+
github.com/google/go-cmp v0.7.0
2222
github.com/google/gopacket v1.1.19
2323
github.com/google/uuid v1.6.0
2424
github.com/gorilla/mux v1.8.0
@@ -39,42 +39,43 @@ require (
3939
github.com/openshift/api v0.0.0-20231120222239-b86761094ee3
4040
github.com/openshift/client-go v0.0.0-20231121143148-910ca30a1a9a
4141
github.com/ovn-kubernetes/libovsdb v0.8.0
42-
github.com/prometheus/client_golang v1.19.1
42+
github.com/prometheus/client_golang v1.22.0
4343
github.com/prometheus/client_model v0.6.1
4444
github.com/safchain/ethtool v0.3.1-0.20231027162144-83e5e0097c91
4545
github.com/spf13/afero v1.9.5
46-
github.com/stretchr/testify v1.9.0
46+
github.com/stretchr/testify v1.10.0
4747
github.com/urfave/cli/v2 v2.27.2
4848
github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa
4949
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
5050
golang.org/x/net v0.38.0
5151
golang.org/x/sync v0.12.0
5252
golang.org/x/sys v0.31.0
53-
golang.org/x/time v0.7.0
54-
google.golang.org/grpc v1.65.0
53+
golang.org/x/time v0.9.0
54+
google.golang.org/grpc v1.68.1
5555
google.golang.org/grpc/security/advancedtls v0.0.0-20240425232638-1e8b9b7fc655
56-
google.golang.org/protobuf v1.35.1
56+
google.golang.org/protobuf v1.36.5
5757
gopkg.in/fsnotify/fsnotify.v1 v1.4.7
5858
gopkg.in/gcfg.v1 v1.2.3
5959
gopkg.in/natefinch/lumberjack.v2 v2.2.1
60-
k8s.io/api v0.32.5
61-
k8s.io/apimachinery v0.32.5
62-
k8s.io/client-go v0.32.5
63-
k8s.io/component-helpers v0.32.3
60+
k8s.io/api v0.33.3
61+
k8s.io/apimachinery v0.33.3
62+
k8s.io/client-go v0.33.3
63+
k8s.io/component-helpers v0.33.3
6464
k8s.io/klog/v2 v2.130.1
65-
k8s.io/kubernetes v1.32.6
65+
k8s.io/kubernetes v1.33.3
6666
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
6767
kubevirt.io/api v1.0.0-alpha.0
68-
sigs.k8s.io/controller-runtime v0.20.3
68+
sigs.k8s.io/controller-runtime v0.21.0
6969
sigs.k8s.io/knftables v0.0.18
7070
sigs.k8s.io/network-policy-api v0.1.5
71-
sigs.k8s.io/structured-merge-diff/v4 v4.4.2
71+
sigs.k8s.io/structured-merge-diff/v4 v4.6.0
7272
sigs.k8s.io/yaml v1.4.0
7373
)
7474

7575
require (
7676
github.com/Microsoft/go-winio v0.6.2 // indirect
7777
github.com/beorn7/perks v1.0.1 // indirect
78+
github.com/blang/semver/v4 v4.0.0 // indirect
7879
github.com/cenkalti/hub v1.0.1 // indirect
7980
github.com/cenkalti/rpc2 v0.0.0-20210604223624-c1acbc6ec984 // indirect
8081
github.com/cespare/xxhash/v2 v2.3.0 // indirect
@@ -90,12 +91,10 @@ require (
9091
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
9192
github.com/gogo/protobuf v1.3.2 // indirect
9293
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
93-
github.com/golang/protobuf v1.5.4 // indirect
9494
github.com/google/btree v1.1.3 // indirect
95-
github.com/google/gnostic-models v0.6.8 // indirect
96-
github.com/google/gofuzz v1.2.0 // indirect
95+
github.com/google/gnostic-models v0.6.9 // indirect
9796
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
98-
github.com/gorilla/websocket v1.5.0 // indirect
97+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
9998
github.com/josharian/intern v1.0.0 // indirect
10099
github.com/josharian/native v1.0.0 // indirect
101100
github.com/json-iterator/go v1.1.12 // indirect
@@ -114,7 +113,7 @@ require (
114113
github.com/pborman/uuid v1.2.0 // indirect
115114
github.com/pkg/errors v0.9.1 // indirect
116115
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
117-
github.com/prometheus/common v0.55.0 // indirect
116+
github.com/prometheus/common v0.62.0 // indirect
118117
github.com/prometheus/procfs v0.15.1 // indirect
119118
github.com/russross/blackfriday/v2 v2.1.0 // indirect
120119
github.com/sirupsen/logrus v1.9.3 // indirect
@@ -124,23 +123,28 @@ require (
124123
github.com/x448/float16 v0.8.4 // indirect
125124
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
126125
go.opencensus.io v0.24.0 // indirect
126+
go.opentelemetry.io/otel v1.33.0 // indirect
127+
go.opentelemetry.io/otel/trace v1.33.0 // indirect
127128
golang.org/x/crypto v0.36.0 // indirect
128129
golang.org/x/oauth2 v0.27.0 // indirect
129130
golang.org/x/term v0.30.0 // indirect
130131
golang.org/x/text v0.23.0 // indirect
131132
golang.org/x/tools v0.26.0 // indirect
132133
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
133-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect
134+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
134135
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
135136
gopkg.in/inf.v0 v0.9.1 // indirect
136137
gopkg.in/warnings.v0 v0.1.2 // indirect
137138
gopkg.in/yaml.v3 v3.0.1 // indirect
138-
k8s.io/apiextensions-apiserver v0.32.3 // indirect
139-
k8s.io/component-base v0.32.3 // indirect
140-
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
139+
k8s.io/apiextensions-apiserver v0.33.3 // indirect
140+
k8s.io/apiserver v0.33.3 // indirect
141+
k8s.io/component-base v0.33.3 // indirect
142+
k8s.io/controller-manager v0.33.3 // indirect
143+
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
141144
kubevirt.io/containerized-data-importer-api v1.55.0 // indirect
142145
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
143146
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
147+
sigs.k8s.io/randfill v1.0.0 // indirect
144148
)
145149

146150
replace (

0 commit comments

Comments
 (0)