Skip to content

Commit 6ef95a3

Browse files
committed
Merge branch 'capture/fix-iptables-error' of github.com:mainred/retina into capture/fix-iptables-error
2 parents fac1200 + f8cfb2d commit 6ef95a3

File tree

28 files changed

+284
-124
lines changed

28 files changed

+284
-124
lines changed

cmd/legacy/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949

5050
const (
5151
logFileName = "retina.log"
52-
heartbeatInterval = 10 * time.Minute
52+
heartbeatInterval = 15 * time.Minute
5353

5454
nodeNameEnvKey = "NODE_NAME"
5555
nodeIPEnvKey = "NODE_IP"

deploy/legacy/manifests/controller/helm/retina/templates/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,4 @@ spec:
397397
selector:
398398
matchLabels:
399399
app: {{ .Values.operator.name }}
400-
{{- end }}
400+
{{- end }}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ require (
291291
github.com/aws/aws-sdk-go-v2 v1.32.2
292292
github.com/aws/aws-sdk-go-v2/config v1.28.0
293293
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
294-
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.0
294+
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1
295295
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5
296296
github.com/cilium/cilium v1.16.0-pre.1.0.20240403152809-b9853ecbcaeb
297297
github.com/cilium/ebpf v0.16.0
@@ -311,7 +311,7 @@ require (
311311
github.com/onsi/gomega v1.34.2
312312
github.com/pkg/errors v0.9.1
313313
github.com/prometheus/client_model v0.6.1
314-
github.com/prometheus/common v0.60.0
314+
github.com/prometheus/common v0.60.1
315315
github.com/safchain/ethtool v0.4.1
316316
github.com/sirupsen/logrus v1.9.3
317317
github.com/spf13/viper v1.19.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8
147147
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0=
148148
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 h1:t7iUP9+4wdc5lt3E41huP+GvQZJD38WLsgVp4iOtAjg=
149149
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2/go.mod h1:/niFCtmuQNxqx9v8WAPq5qh7EH25U4BF6tjoyq9bObM=
150-
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.0 h1:xA6XhTF7PE89BCNHJbQi8VvPzcgMtmGC5dr8S8N7lHk=
151-
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.0/go.mod h1:cB6oAuus7YXRZhWCc1wIwPywwZ1XwweNp2TVAEGYeB8=
150+
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1 h1:MkQ4unegQEStiQYmfFj+Aq5uTp265ncSmm0XTQwDwi0=
151+
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1/go.mod h1:cB6oAuus7YXRZhWCc1wIwPywwZ1XwweNp2TVAEGYeB8=
152152
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk=
153153
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U=
154154
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o=
@@ -759,8 +759,8 @@ github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQy
759759
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
760760
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
761761
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
762-
github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA=
763-
github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
762+
github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
763+
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
764764
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
765765
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
766766
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=

hack/tools/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
go.uber.org/mock v0.5.0
1111
mvdan.cc/gofumpt v0.7.0
1212
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20211110210527-619e6b92dab9
13-
sigs.k8s.io/controller-tools v0.16.4
13+
sigs.k8s.io/controller-tools v0.16.5
1414
)
1515

1616
require (
@@ -156,7 +156,7 @@ require (
156156
github.com/emirpasic/gods v1.18.1 // indirect
157157
github.com/ettle/strcase v0.2.0 // indirect
158158
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
159-
github.com/fatih/color v1.17.0 // indirect
159+
github.com/fatih/color v1.18.0 // indirect
160160
github.com/fatih/structtag v1.2.0 // indirect
161161
github.com/felixge/httpsnoop v1.0.4 // indirect
162162
github.com/firefart/nonamedreturns v1.0.5 // indirect
@@ -453,9 +453,9 @@ require (
453453
gopkg.in/yaml.v2 v2.4.0 // indirect
454454
gopkg.in/yaml.v3 v3.0.1 // indirect
455455
honnef.co/go/tools v0.5.1 // indirect
456-
k8s.io/api v0.31.1 // indirect
457-
k8s.io/apiextensions-apiserver v0.31.1 // indirect
458-
k8s.io/apimachinery v0.31.1 // indirect
456+
k8s.io/api v0.31.2 // indirect
457+
k8s.io/apiextensions-apiserver v0.31.2 // indirect
458+
k8s.io/apimachinery v0.31.2 // indirect
459459
k8s.io/klog/v2 v2.130.1 // indirect
460460
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
461461
lukechampine.com/blake3 v1.2.1 // indirect

hack/tools/go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q=
346346
github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A=
347347
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
348348
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
349-
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
350-
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
349+
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
350+
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
351351
github.com/fatih/set v0.2.1 h1:nn2CaJyknWE/6txyUDGwysr3G5QC6xWB/PtVjPBbeaA=
352352
github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI=
353353
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
@@ -1405,12 +1405,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
14051405
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
14061406
honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
14071407
honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs=
1408-
k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
1409-
k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
1410-
k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
1411-
k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
1412-
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
1413-
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
1408+
k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0=
1409+
k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk=
1410+
k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0=
1411+
k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM=
1412+
k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw=
1413+
k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
14141414
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
14151415
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
14161416
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
@@ -1423,8 +1423,8 @@ mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8
14231423
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ=
14241424
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20211110210527-619e6b92dab9 h1:ylYUI5uaq/guUFerFRVG81FHSA5/3+fERCE1RQbQUZ4=
14251425
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20211110210527-619e6b92dab9/go.mod h1:+sJcI1F0QI0Cv+8fp5rH5B2fK1LxzrAQqYnaPx9nY8I=
1426-
sigs.k8s.io/controller-tools v0.16.4 h1:VXmar78eDXbx1by/H09ikEq1hiq3bqInxuV3lMr3GmQ=
1427-
sigs.k8s.io/controller-tools v0.16.4/go.mod h1:kcsZyYMXiOFuBhofSPtkB90zTSxVRxVVyvtKQcx3q1A=
1426+
sigs.k8s.io/controller-tools v0.16.5 h1:5k9FNRqziBPwqr17AMEPPV/En39ZBplLAdOwwQHruP4=
1427+
sigs.k8s.io/controller-tools v0.16.5/go.mod h1:8vztuRVzs8IuuJqKqbXCSlXcw+lkAv/M2sTpg55qjMY=
14281428
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
14291429
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
14301430
sigs.k8s.io/kind v0.23.0 h1:8fyDGWbWTeCcCTwA04v4Nfr45KKxbSPH1WO9K+jVrBg=

pkg/k8s/cell_linux.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@ var Cell = cell.Module(
5757
func() resource.Resource[*cilium_api_v2alpha1.CiliumEndpointSlice] {
5858
return &fakeresource[*cilium_api_v2alpha1.CiliumEndpointSlice]{}
5959
},
60-
func() resource.Resource[*types.CiliumEndpoint] {
61-
return &fakeresource[*types.CiliumEndpoint]{}
62-
},
6360
func() resource.Resource[*cilium_api_v2.CiliumNode] {
6461
return &fakeresource[*cilium_api_v2.CiliumNode]{}
6562
},
66-
func() daemonk8s.ServiceNonHeadless {
67-
return &fakeresource[*slim_corev1.Service]{}
68-
},
6963
func() daemonk8s.EndpointsNonHeadless {
7064
return &fakeresource[*ciliumk8s.Endpoints]{}
7165
},
@@ -74,6 +68,12 @@ var Cell = cell.Module(
7468
},
7569
),
7670

71+
// Provide the resources needed by the watchers.
72+
73+
cell.Provide(func(lc cell.Lifecycle, cs client.Clientset) (resource.Resource[*types.CiliumEndpoint], error) {
74+
return ciliumk8s.CiliumSlimEndpointResource(lc, cs, nil)
75+
}),
76+
7777
cell.Provide(func(lc cell.Lifecycle, cs client.Clientset) (resource.Resource[*ciliumk8s.Endpoints], error) {
7878
//nolint:wrapcheck // a wrapped error here is of dubious value
7979
return ciliumk8s.EndpointsResource(lc, ciliumk8s.Config{
@@ -88,7 +88,18 @@ var Cell = cell.Module(
8888
lc,
8989
ciliumk8s.Config{
9090
EnableK8sEndpointSlice: false,
91-
K8sServiceProxyName: "",
91+
},
92+
cs,
93+
func(*metav1.ListOptions) {},
94+
)
95+
}),
96+
97+
cell.Provide(func(lc cell.Lifecycle, cs client.Clientset) (daemonk8s.ServiceNonHeadless, error) {
98+
//nolint:wrapcheck // a wrapped error here is of dubious value
99+
return ciliumk8s.ServiceResource(
100+
lc,
101+
ciliumk8s.Config{
102+
EnableK8sEndpointSlice: false,
92103
},
93104
cs,
94105
func(*metav1.ListOptions) {},

pkg/k8s/watcher_linux.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ import (
1919

2020
const (
2121
K8sAPIGroupCiliumEndpointV2 = "cilium/v2::CiliumEndpoint"
22+
K8sAPIGroupServiceV1Core = "core/v1::Service"
2223
)
2324

2425
var (
25-
once sync.Once
26-
w *watchers.K8sWatcher
27-
logger = logging.DefaultLogger.WithField(logfields.LogSubsys, "k8s-watcher")
28-
// k8sResources = []string{K8sAPIGroupCiliumEndpointV2, resources.K8sAPIGroupServiceV1Core}
29-
k8sResources = []string{}
26+
once sync.Once
27+
w *watchers.K8sWatcher
28+
logger = logging.DefaultLogger.WithField(logfields.LogSubsys, "k8s-watcher")
29+
k8sResources = []string{K8sAPIGroupCiliumEndpointV2, K8sAPIGroupServiceV1Core}
3030
)
3131

3232
type watcherParams struct {

pkg/metrics/metrics.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,11 @@ func InitializeMetrics() {
134134
exporter.DefaultRegistry,
135135
utils.DNSRequestCounterName,
136136
dnsRequestCounterDescription,
137-
utils.DNSRequestLabels...,
138137
)
139138
DNSResponseCounter = exporter.CreatePrometheusCounterVecForMetric(
140139
exporter.DefaultRegistry,
141140
utils.DNSResponseCounterName,
142141
dnsResponseCounterDescription,
143-
utils.DNSResponseLabels...,
144142
)
145143

146144
// InfiniBand Metrics

pkg/plugin/conntrack/_cprog/conntrack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static __always_inline __attribute__((unused)) bool ct_process_packet(struct pac
315315
// Update the packet accordingly.
316316
p->is_reply = true;
317317
p->traffic_direction = entry->traffic_direction;
318-
return _ct_should_report_packet(entry, p->flags, CT_PACKET_DIR_RX, &key);
318+
return _ct_should_report_packet(entry, p->flags, CT_PACKET_DIR_RX, &reverse_key);
319319
}
320320

321321
// If the connection is still not found, the connection is new.

0 commit comments

Comments
 (0)