Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
098a3aa
Fix UDN nftables mark chain cleanup
kyrtapz Mar 20, 2025
a0101b5
kv, e2e: Download virtctl at tests
qinqon Apr 25, 2025
b60dbcd
kv, e2e: ensure there is no dots at podtest name
qinqon Apr 25, 2025
318782b
kv, e2e: Use the ExternalContainer struct instead of name
qinqon Apr 29, 2025
7c1de13
e2e: Remove harcoded breth0
qinqon Apr 29, 2025
f1c76a6
e2e, kv: Increase network status timeout
qinqon Apr 29, 2025
9fed90c
e2e: Use ovnk allocator and reserve IPs
qinqon Apr 30, 2025
1870116
e2e, kv: Use bgpnet for external container network
qinqon May 28, 2025
ae5b638
e2e: Move underlay setup to providers
qinqon Apr 29, 2025
115b25a
e2e: Move http servers to external container
qinqon Jun 16, 2025
956981a
kv, e2e: Use PrimaryNetwork()
qinqon Jun 25, 2025
f1a4b4b
[node/egressipgw] Move egressIP functionality to its own package.
npinaeva Jul 2, 2025
b65a01e
[node/bridgeconfig] move [udn]bridgeconfig to ite own package.
npinaeva Jul 2, 2025
420d9f1
[bridgeconfig] make mutex a public field to turn it into internal later
npinaeva Jul 2, 2025
3b07332
[bridgeconfig] only create BridgeConfigurations inside the package.
npinaeva Jul 2, 2025
a4d421a
[bridgeconfig] simply move functions around, no change
npinaeva Jul 2, 2025
cf93ef3
[bridgeconfig] start moving methods that use internal mutex to the pkg
npinaeva Jul 2, 2025
836e0f6
[bridgeconfig] move setBridgeOfPorts to the package.
npinaeva Jul 2, 2025
b607e93
[bridgeconfig] add some getters/setters with lock to the pkg.
npinaeva Jul 2, 2025
28f9c1e
[bridgeconfig] move bridge flows generation functions to the pkg.
npinaeva Jul 2, 2025
5a5e3b6
[bridgeconfig] move flow generation locking into methods.
npinaeva Jul 2, 2025
4ad1727
[bridgeconfig] make most members internal, ensure correct locking.
npinaeva Jul 2, 2025
fa6076b
[bridgeconfig] move nextHops to the gateway where it is used.
npinaeva Jul 2, 2025
a0c90f2
[bridgeconfig] make mutex internal.
npinaeva Jul 2, 2025
fd5e791
[node/gateway] nodePortWatcher should use its own bridgeConfiguration.
npinaeva Jul 2, 2025
f531e3d
[node/gateway] make PatchedNetConfigs internal, remove locking
npinaeva Jul 2, 2025
33e20b8
[bridgeconfig] AI suggested fixes.
npinaeva Jul 2, 2025
290eb03
Add metrics for UDN
danwinship Apr 28, 2025
9ac781e
Merge pull request #5345 from npinaeva/bridgeconfig-v2
trozet Jul 18, 2025
54d6ce3
Merge pull request #5220 from qinqon/kv-e2e-integrate-providers
trozet Jul 18, 2025
527c19f
Add support for --disable-requestedchassis flag in ovnkube controller
aserdean Jul 18, 2025
293f6dd
ci: run tests only if files other than docs are changed
booxter Jul 17, 2025
ec378a7
Bump golang.org/x/oauth2
dependabot[bot] Jul 18, 2025
3d32558
Remove routes of ex gw pods in terminating or not ready state
arkadeepsen Jun 12, 2025
d942a7d
Add unit tests for ex gw pods in terminating or not ready state
arkadeepsen Jun 12, 2025
d565fd8
Add e2e tests for ex gw pods in terminating or not ready state
arkadeepsen Jun 12, 2025
76ad0ea
Merge pull request #5400 from aserdean/add_disable_req_chassis_ovn_ic
girishmg Jul 21, 2025
fa12bb2
Bump fedora from 41 -> 42
trozet Jul 21, 2025
0cb2181
Merge pull request #5401 from ovn-kubernetes/dependabot/go_modules/te…
trozet Jul 21, 2025
4dce9cb
Merge pull request #5218 from danwinship/udn-metrics
trozet Jul 21, 2025
b6b0842
Merge pull request #5300 from arkadeepsen/remove-ex-gw
tssurya Jul 21, 2025
b4eabd9
Bump the go_modules group across 2 directories with 1 update
dependabot[bot] Jul 21, 2025
349fbbf
Merge pull request #5406 from ovn-kubernetes/dependabot/go_modules/go…
tssurya Jul 22, 2025
dc437b6
RouteAdvertisements: appropriately update status even if no updates
jcaamano Jul 3, 2025
90e56b9
e2e: rename testdata package to testscenario
jcaamano Jun 19, 2025
3dea4f5
e2e: add RuntimeArgs to container infra provider API
jcaamano Jun 19, 2025
acef39f
e2e: make ExtPort not required in container infra provider API
jcaamano Jun 19, 2025
926ba1a
e2e: use index in kind infra inspect templates to allow special chara…
jcaamano Jul 2, 2025
edb05ca
kind.sh: Use FRRConfiguration label when advertising default network
jcaamano Jul 3, 2025
5ece846
e2e: add VRF-Lite test cases
jcaamano Jun 19, 2025
dfc14b4
e2e: refactor podIPOfFamilyOnPrimaryNetwork into more reusable code
jcaamano Jul 15, 2025
e72e62b
Remove unused portbinding code
booxter Jul 22, 2025
5eceb7d
Merge pull request #5405 from trozet/bump_fedora_42
npinaeva Jul 22, 2025
34b5a46
e2e: test against L2 networks in VRF-Lite test cases
jcaamano Jul 18, 2025
d127877
build, vendor: consume ipamclaims v0.5.0-alpha
maiqueb Jun 12, 2025
5b5bc06
gateway: Refactor gateway initialization and DPU host handling
aserdean Jul 18, 2025
9b56178
Merge pull request #5307 from aserdean/switch_dpu_annotation
trozet Jul 23, 2025
45bf0b3
Revert "e2e: Use ovnk allocator and reserve IPs"
qinqon Jul 21, 2025
6c4bc78
e2e: label RouteAdvertisement test cases & skip extended ones
jcaamano Jul 22, 2025
b90abc5
fix: skip gw IP check for DPU and improve gateway initialization read…
aserdean Jul 22, 2025
53a6bd1
Merge pull request #5299 from maiqueb/consume-ipamclaims-v0.5.0-alpha
trozet Jul 23, 2025
f3c4eae
Merge pull request #5398 from booxter/dont-run-tests-on-doc-only-change
trozet Jul 23, 2025
bfaa748
Merge pull request #5408 from aserdean/refactor-gateway-init-readability
npinaeva Jul 23, 2025
8fadf90
Merge pull request #5409 from booxter/remove-portbinding-code
trozet Jul 23, 2025
6b8fc2d
Merge pull request #5348 from jcaamano/vrf-lite-e2e
trozet Jul 23, 2025
ef2228d
Merge pull request #5137 from kyrtapz/fix_mark_chain_cleanup
trozet Jul 23, 2025
b6e5459
Merge remote-tracking branch 'upstream/master' into d/s-merge-07-25-2025
Jul 25, 2025
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/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
merge_group:
pull_request:
branches: [ master ]
# Only run jobs if at least one non-doc file is changed
paths-ignore:
- '**/*.md'
- 'mkdocs.yml'
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
Expand Down
23 changes: 0 additions & 23 deletions contrib/kind-common
Original file line number Diff line number Diff line change
Expand Up @@ -388,30 +388,7 @@ install_kubevirt() {

local kubevirt_stable_release_url=$(get_kubevirt_release_url "stable")
kubectl -n kubevirt patch kubevirt kubevirt --type=json --patch '[{"op":"add","path":"/spec/configuration/network","value":{}},{"op":"add","path":"/spec/configuration/network/binding","value":{"l2bridge":{"domainAttachmentType":"managedTap","migration":{}}}}]'

if [ ! -d "./bin" ]
then
mkdir -p ./bin
if_error_exit "Failed to create bin dir!"
fi

if [[ "$OSTYPE" == "linux-gnu" ]]; then
OS_TYPE="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
OS_TYPE="darwin"
fi

pushd ./bin
if [ ! -f ./virtctl ]; then
kubevirt_stable_release_url=$(get_kubevirt_release_url "stable")
cli_name="virtctl-${kubevirt_stable_release_url##*/}-${OS_TYPE}-${ARCH}"
curl -LO "${kubevirt_stable_release_url}/${cli_name}"
mv ${cli_name} virtctl
if_error_exit "Failed to download virtctl!"
fi
popd

chmod +x ./bin/virtctl
}

install_cert_manager() {
Expand Down
10 changes: 5 additions & 5 deletions dist/images/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ARG OVN_FROM=koji
#############################################
# Stage to get OVN and OVS RPMs from source #
#############################################
FROM quay.io/fedora/fedora:41 AS ovnbuilder
FROM quay.io/fedora/fedora:42 AS ovnbuilder

USER root

Expand Down Expand Up @@ -78,8 +78,8 @@ RUN git log -n 1
########################################
# Stage to download OVN RPMs from koji #
########################################
FROM quay.io/fedora/fedora:41 AS kojidownloader
ARG ovnver=ovn-24.09.2-71.fc41
FROM quay.io/fedora/fedora:42 AS kojidownloader
ARG ovnver=ovn-24.09.2-71.fc42

USER root

Expand All @@ -99,14 +99,14 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] || [ -z "$TARGETPLATFORM"] ; then k
######################################
# Stage to copy OVN RPMs from source #
######################################
FROM quay.io/fedora/fedora:41 AS source
FROM quay.io/fedora/fedora:42 AS source
COPY --from=ovnbuilder /root/ovn/rpm/rpmbuild/RPMS/x86_64/*.rpm /
COPY --from=ovnbuilder /root/ovs/rpm/rpmbuild/RPMS/x86_64/*.rpm /

####################################
# Stage to copy OVN RPMs from koji #
####################################
FROM quay.io/fedora/fedora:41 AS koji
FROM quay.io/fedora/fedora:42 AS koji

COPY --from=kojidownloader /*.rpm /

Expand Down
7 changes: 7 additions & 0 deletions dist/images/ovnkube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,12 @@ ovnkube-controller-with-node() {
ovn_stateless_netpol_enable_flag="--enable-stateless-netpol"
fi

ovn_disable_requestedchassis_flag=
if [[ ${ovn_disable_requestedchassis} == "true" ]]; then
ovn_disable_requestedchassis_flag="--disable-requestedchassis"
fi
echo "ovn_disable_requestedchassis_flag=${ovn_disable_requestedchassis_flag}"

echo "=============== ovnkube-controller-with-node --init-ovnkube-controller-with-node=========="
/usr/bin/ovnkube --init-ovnkube-controller ${K8S_NODE} --init-node ${K8S_NODE} \
${anp_enabled_flag} \
Expand Down Expand Up @@ -2150,6 +2156,7 @@ ovnkube-controller-with-node() {
${ssl_opts} \
${network_qos_enabled_flag} \
${ovn_enable_dnsnameresolver_flag} \
${ovn_disable_requestedchassis_flag} \
--cluster-subnets ${net_cidr} --k8s-service-cidr=${svc_cidr} \
--export-ovs-metrics \
--gateway-mode=${ovn_gateway_mode} ${ovn_gateway_opts} \
Expand Down
4 changes: 3 additions & 1 deletion dist/templates/ovn-setup.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ spec:
networkSelectors:
- networkSelectionType: DefaultNetwork
nodeSelector: {}
frrConfigurationSelector: {}
frrConfigurationSelector:
matchLabels:
name: receive-all
advertisements:
- "PodNetwork"
{%- endif %}
4 changes: 4 additions & 0 deletions go-controller/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ linters-settings:
# Other frequently used deps
- pkg: github.com/ovn-kubernetes/libovsdb/ovsdb
alias: ""
- pkg: github.com/ovn-org/ovn-kubernetes/go-controller/pkg/node/util
alias: nodeutil
- pkg: github.com/ovn-org/ovn-kubernetes/go-controller/pkg/node/types
alias: nodetypes

revive:
rules:
Expand Down
10 changes: 5 additions & 5 deletions go-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.0
github.com/k8snetworkplumbingwg/govdpa v0.1.5-0.20230926073613-07c1031aea47
github.com/k8snetworkplumbingwg/ipamclaims v0.4.0-alpha
github.com/k8snetworkplumbingwg/ipamclaims v0.5.0-alpha
github.com/k8snetworkplumbingwg/multi-networkpolicy v1.0.1
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.6.0
github.com/k8snetworkplumbingwg/sriovnet v1.2.1-0.20230427090635-4929697df2dc
Expand Down Expand Up @@ -57,9 +57,9 @@ require (
gopkg.in/fsnotify/fsnotify.v1 v1.4.7
gopkg.in/gcfg.v1 v1.2.3
gopkg.in/natefinch/lumberjack.v2 v2.2.1
k8s.io/api v0.32.3
k8s.io/apimachinery v0.32.3
k8s.io/client-go v0.32.3
k8s.io/api v0.32.5
k8s.io/apimachinery v0.32.5
k8s.io/client-go v0.32.5
k8s.io/component-helpers v0.32.3
k8s.io/klog/v2 v2.130.1
k8s.io/kubernetes v1.32.6
Expand Down Expand Up @@ -125,7 +125,7 @@ require (
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/tools v0.26.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go-controller/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CIm
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/k8snetworkplumbingwg/govdpa v0.1.5-0.20230926073613-07c1031aea47 h1:iSncnlC+rtlNOIpPa3fbqQMhpTscGJIlkiWaPl1VcS4=
github.com/k8snetworkplumbingwg/govdpa v0.1.5-0.20230926073613-07c1031aea47/go.mod h1:SPaDIyUmwN03Bgn0u/mhoiE4o/+koeKh11VUsdsUX0U=
github.com/k8snetworkplumbingwg/ipamclaims v0.4.0-alpha h1:ss+EP77GlQmh90hGKpnAG4Q3VVxRlB7GoncemaPtO4g=
github.com/k8snetworkplumbingwg/ipamclaims v0.4.0-alpha/go.mod h1:qlR+sKxQ2OGfwhFCuXSd7rJ/GgC38vQBeHKQ7f2YnpI=
github.com/k8snetworkplumbingwg/ipamclaims v0.5.0-alpha h1:b3iHeks/KTzhG2dNanaUZcFEJwJbYBZY16jxCaVv9i8=
github.com/k8snetworkplumbingwg/ipamclaims v0.5.0-alpha/go.mod h1:MGaMX1tJ7MlHDee4/xmqp3guQh+eDiuCLAauqD9K11Q=
github.com/k8snetworkplumbingwg/multi-networkpolicy v1.0.1 h1:Egj1hEVYNXWFlKpgzAXxe/2o8VNiVcAJLrKzlinILQo=
github.com/k8snetworkplumbingwg/multi-networkpolicy v1.0.1/go.mod h1:kEJ4WM849yNmXekuSXLRwb+LaZ9usC06O8JgoAIq+f4=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.6.0 h1:BT3ghAY0q7lWib9rz+tVXDFkm27dJV6SLCn7TunZwo4=
Expand Down Expand Up @@ -945,8 +945,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -1317,26 +1317,26 @@ k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ=
k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8=
k8s.io/api v0.22.7/go.mod h1:7hejA1BgBEiSsWljUyRkIjj+AISXO16IwsaDgFjJsQE=
k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ=
k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=
k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k=
k8s.io/api v0.32.5 h1:uqjjsYo1kTJr5NIcoIaP9F+TgXgADH7nKQx91FDAhtk=
k8s.io/api v0.32.5/go.mod h1:bXXFU3fGCZ/eFMZvfHZC69PeGbXEL4zzjuPVzOxHF64=
k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY=
k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss=
k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc=
k8s.io/apimachinery v0.22.7/go.mod h1:ZvVLP5iLhwVFg2Yx9Gh5W0um0DUauExbRhe+2Z8I1EU=
k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM=
k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U=
k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apimachinery v0.32.5 h1:6We3aJ6crC0ap8EhsEXcgX3LpI6SEjubpiOMXLROwPM=
k8s.io/apimachinery v0.32.5/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU=
k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM=
k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q=
k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y=
k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k=
k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0=
k8s.io/client-go v0.22.7/go.mod h1:pGU/tWSzzvsYT7M3npHhoZ3Jh9qJTTIvFvDtWuW31dw=
k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU=
k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY=
k8s.io/client-go v0.32.5 h1:huFmQMzgWu0z4kbWsuZci+Gt4Fo72I4CcrvhToZ/Qp0=
k8s.io/client-go v0.32.5/go.mod h1:Qchw6f9WIVrur7DKojAHpRgGLcANT0RLIvF39Jz58xA=
k8s.io/code-generator v0.22.7/go.mod h1:iOZwYADSgFPNGWfqHFfg1V0TNJnl1t0WyZluQp4baqU=
k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk=
k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk=
Expand Down
14 changes: 11 additions & 3 deletions go-controller/pkg/clustermanager/routeadvertisements/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -951,10 +951,18 @@ func (c *Controller) updateRAStatus(ra *ratypes.RouteAdvertisements, hadUpdates
return nil
}

var updateStatus bool
condition := meta.FindStatusCondition(ra.Status.Conditions, "Accepted")
updateStatus := hadUpdates || condition == nil || condition.ObservedGeneration != ra.Generation
updateStatus = updateStatus || err != nil

switch {
case condition == nil:
fallthrough
case condition.ObservedGeneration != ra.Generation:
fallthrough
case (err == nil) != (condition.Status == metav1.ConditionTrue):
fallthrough
case hadUpdates:
updateStatus = true
}
if !updateStatus {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type testRA struct {
SelectsDefault bool
AdvertisePods bool
AdvertiseEgressIPs bool
Status *metav1.ConditionStatus
}

func (tra testRA) RouteAdvertisements() *ratypes.RouteAdvertisements {
Expand Down Expand Up @@ -92,6 +93,9 @@ func (tra testRA) RouteAdvertisements() *ratypes.RouteAdvertisements {
MatchLabels: tra.FRRConfigurationSelector,
}
}
if tra.Status != nil {
ra.Status.Conditions = []metav1.Condition{{Type: "Accepted", Status: *tra.Status}}
}
return ra
}

Expand Down Expand Up @@ -776,6 +780,38 @@ func TestController_reconcile(t *testing.T) {
},
expectNADAnnotations: map[string]map[string]string{"default": {types.OvnRouteAdvertisementsKey: "[\"ra\"]"}, "red": {types.OvnRouteAdvertisementsKey: "[\"ra\"]"}},
},
{
name: "reconciles RouteAdvertisements status even when no other updates are required",
ra: &testRA{Name: "ra", AdvertisePods: true, AdvertiseEgressIPs: true, SelectsDefault: true, Status: ptr.To(metav1.ConditionFalse)},
frrConfigs: []*testFRRConfig{
{
Name: "frrConfig",
Namespace: frrNamespace,
Routers: []*testRouter{
{ASN: 1, Prefixes: []string{"1.1.1.0/24"}, Neighbors: []*testNeighbor{
{ASN: 1, Address: "1.0.0.100"},
}},
},
},
{
Labels: map[string]string{types.OvnRouteAdvertisementsKey: "ra"},
Annotations: map[string]string{types.OvnRouteAdvertisementsKey: "ra/frrConfig/node"},
NodeSelector: map[string]string{"kubernetes.io/hostname": "node"},
Routers: []*testRouter{
{ASN: 1, Prefixes: []string{"1.0.1.1/32", "1.1.0.0/24"}, Neighbors: []*testNeighbor{
{ASN: 1, Address: "1.0.0.100", Advertise: []string{"1.0.1.1/32", "1.1.0.0/24"}, Receive: []string{"1.1.0.0/16/24"}},
}},
},
},
},
nads: []*testNAD{
{Name: "default", Namespace: "ovn-kubernetes", Network: "default", Annotations: map[string]string{types.OvnRouteAdvertisementsKey: "[\"ra\"]"}},
},
nodes: []*testNode{{Name: "node", SubnetsAnnotation: "{\"default\":\"1.1.0.0/24\"}"}},
eips: []*testEIP{{Name: "eip", EIPs: map[string]string{"node": "1.0.1.1"}}},
reconcile: "ra",
expectAcceptedStatus: metav1.ConditionTrue,
},
{
name: "fails to reconcile a secondary network",
ra: &testRA{Name: "ra", AdvertisePods: true, NetworkSelector: map[string]string{"selected": "true"}},
Expand Down Expand Up @@ -1005,11 +1041,6 @@ func TestController_reconcile(t *testing.T) {

c := NewController(nm.Interface(), wf, fakeClientset)

// prime the default network NAD
if defaultNAD == nil {
defaultNAD, err = c.getOrCreateDefaultNetworkNAD()
g.Expect(err).ToNot(gomega.HaveOccurred())
}
// prime the default network NAD namespace
namespace := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -1018,11 +1049,15 @@ func TestController_reconcile(t *testing.T) {
}
_, err = fakeClientset.KubeClient.CoreV1().Namespaces().Create(context.Background(), namespace, metav1.CreateOptions{})
g.Expect(err).ToNot(gomega.HaveOccurred())

// update it with the annotation that network manager would set
defaultNAD.Annotations = map[string]string{types.OvnNetworkNameAnnotation: types.DefaultNetworkName}
_, err = fakeClientset.NetworkAttchDefClient.K8sCniCncfIoV1().NetworkAttachmentDefinitions(defaultNAD.Namespace).Update(context.Background(), defaultNAD, metav1.UpdateOptions{})
g.Expect(err).ToNot(gomega.HaveOccurred())
// prime the default network NAD
if defaultNAD == nil {
defaultNAD, err = c.getOrCreateDefaultNetworkNAD()
g.Expect(err).ToNot(gomega.HaveOccurred())
// update it with the annotation that network manager would set
defaultNAD.Annotations = map[string]string{types.OvnNetworkNameAnnotation: types.DefaultNetworkName}
_, err = fakeClientset.NetworkAttchDefClient.K8sCniCncfIoV1().NetworkAttachmentDefinitions(defaultNAD.Namespace).Update(context.Background(), defaultNAD, metav1.UpdateOptions{})
g.Expect(err).ToNot(gomega.HaveOccurred())
}

err = wf.Start()
g.Expect(err).ToNot(gomega.HaveOccurred())
Expand All @@ -1039,7 +1074,13 @@ func TestController_reconcile(t *testing.T) {
)

err = nm.Start()
g.Expect(err).ToNot(gomega.HaveOccurred())
// some test cases start with a bad RA status, avoid asserting
// initial sync in this case as it will fail
if tt.ra == nil || tt.ra.Status == nil || *tt.ra.Status == metav1.ConditionTrue {
g.Expect(err).ToNot(gomega.HaveOccurred())
} else {
g.Expect(err).To(gomega.HaveOccurred())
}
// we just need the inital sync
nm.Stop()

Expand Down
Loading