From 3a46e344c6711fd091115050b41565852474c7c6 Mon Sep 17 00:00:00 2001 From: Matthias Bertschy Date: Fri, 11 Sep 2026 13:59:01 +0200 Subject: [PATCH 1/2] chore: upgrade Go version to 1.27 and modernize idioms - Update go.mod to Go 1.27 and run go mod tidy - Run go fix and modernize analyzer passes - Modernize slice lookups with slices.Contains and map copies with maps.Copy - Format repository code with go fmt Signed-off-by: Matthias Bertschy --- go.mod | 2 +- go.sum | 446 ------------------ pkg/cloudmetadata/metadata.go | 6 +- pkg/config/config_test.go | 10 +- .../v1/container_data_test.go | 100 ++-- .../v1/event_reporting.go | 2 +- .../v1/event_reporting_test.go | 5 +- pkg/containerprofilemanager/v1/monitoring.go | 34 +- .../v1/network_helpers.go | 4 +- .../v1/network_helpers_service_ports.go | 7 +- .../v1/queue/containerprofile_queue.go | 11 +- .../v1/queue/containerprofile_queue_errors.go | 3 +- .../containerprofile_queue_errors_test.go | 18 +- .../v1/queue/containerprofile_queue_test.go | 93 ++-- .../v1/queue/containerprofile_split_test.go | 8 +- .../container_watcher_interface.go | 3 +- pkg/containerwatcher/v2/container_watcher.go | 2 +- .../v2/container_watcher_private_test.go | 8 +- .../v2/event_handler_factory.go | 6 +- .../v2/ordered_event_queue_test.go | 6 +- .../v2/tracers/dns_retry_test.go | 36 +- pkg/containerwatcher/v2/tracers/httpparse.go | 4 +- .../v2/tracers/httpparse_test.go | 10 +- .../v2/tracers/syscall_test.go | 2 +- pkg/cooldownqueue/cooldownqueue_test.go | 14 +- pkg/dedupcache/dedup_cache.go | 2 +- pkg/dedupcache/dedup_cache_test.go | 4 +- pkg/dedupcache/keys_test.go | 2 +- pkg/dnsmanager/dns_manager.go | 23 +- pkg/dnsmanager/dns_manager_interface.go | 1 - pkg/dnsmanager/dns_manager_test.go | 8 +- pkg/exporters/alert_bulk_manager.go | 5 +- pkg/exporters/alert_bulk_manager_test.go | 72 ++- pkg/exporters/alert_limit_test.go | 14 +- pkg/exporters/alert_manager.go | 90 ++-- pkg/exporters/alert_manager_test.go | 12 +- pkg/exporters/http_exporter.go | 16 +- pkg/fimmanager/fim_manager.go | 4 +- pkg/hostfimsensor/v1/filetree/comparator.go | 4 +- pkg/hostfimsensor/v1/filetree/filetree.go | 5 +- pkg/hostfimsensor/v1/fimsensor_fanotify.go | 5 +- .../v1/fimsensor_fanotify_test.go | 1 - .../v1/fimsensor_periodic_test.go | 1 - pkg/hostfimsensor/v1/fimsensor_test.go | 9 +- pkg/hostsensormanager/crd_client.go | 12 +- pkg/hostsensormanager/sensor_cloudprovider.go | 2 +- pkg/hostsensormanager/sensor_cni.go | 2 +- pkg/hostsensormanager/sensor_controlplane.go | 8 +- pkg/hostsensormanager/sensor_kernelvars.go | 2 +- pkg/hostsensormanager/sensor_kernelversion.go | 2 +- pkg/hostsensormanager/sensor_kubelet.go | 2 +- pkg/hostsensormanager/sensor_kubeproxy.go | 2 +- pkg/hostsensormanager/sensor_network.go | 2 +- pkg/hostsensormanager/sensor_osrelease.go | 2 +- pkg/hostsensormanager/sensor_security.go | 2 +- pkg/hostsensormanager/types.go | 64 +-- pkg/k8sclient/k8sclient_mock.go | 20 +- pkg/metricsmanager/otel/resource_metrics.go | 6 +- pkg/networkstream/v1/network_stream.go | 31 +- pkg/networkstream/v1/wire_test.go | 33 +- .../nodeprofile_manager_interface.go | 4 +- .../v1/nodeprofile_manager.go | 4 +- .../v1/nodeprofile_manager_test.go | 14 +- .../callstackcache/callstackcache_test.go | 2 +- .../authored_container_section_test.go | 5 +- .../containerprofilecache.go | 2 +- .../containerprofilecache_test.go | 89 ++-- .../init_eviction_test.go | 17 +- .../integration_helpers_test.go | 9 +- .../containerprofilecache/lock_stress_test.go | 17 +- .../projection_apply_test.go | 15 +- .../projection_golden_test.go | 15 +- .../reconciler_checksum_test.go | 24 +- .../reconciler_ephemeral_test.go | 15 +- .../reconciler_notfound_test.go | 29 +- .../containerprofilecache/reconciler_test.go | 191 ++++---- .../resolve_authored_section_test.go | 15 +- .../shared_pointer_race_test.go | 33 +- pkg/objectcache/shared_container_data.go | 9 +- .../shared_container_data_ephemeral_test.go | 24 +- pkg/otelsetup/otelsetup_test.go | 2 +- .../creator/exit_manager_lifecycle_test.go | 12 +- pkg/processtree/creator/exit_manager_test.go | 26 +- .../creator/processtree_creator.go | 2 +- .../creator/processtree_creator_test.go | 18 +- pkg/processtree/creator/starttime_test.go | 36 +- pkg/processtree/errors.go | 1 - pkg/processtree/feeder/procfs_feeder.go | 8 +- pkg/processtree/feeder/procfs_feeder_test.go | 8 +- pkg/resourcelocks/resourcelocks_test.go | 18 +- pkg/rulebindingmanager/cache/cache_test.go | 150 +++--- pkg/rulebindingmanager/cache/helpers_test.go | 78 ++- pkg/rulebindingmanager/types/v1/types.go | 16 +- pkg/rulemanager/cel/cel.go | 4 +- pkg/rulemanager/cel/cel_interface.go | 2 +- pkg/rulemanager/cel/cel_tty_test.go | 7 +- .../cel/libraries/cache/function_cache.go | 11 +- .../cel/libraries/celparse/parseargs.go | 2 +- .../libraries/containerprofile/cache_test.go | 24 +- .../containerprofile/capability_test.go | 4 +- .../containerprofile/containerprofile.go | 7 +- .../containerprofile/containerprofile_test.go | 2 +- .../cel/libraries/containerprofile/exec.go | 68 +-- .../libraries/containerprofile/exec_test.go | 10 +- .../containerprofile/integration_test.go | 2 +- .../libraries/containerprofile/legacy_test.go | 10 +- .../libraries/containerprofile/open_test.go | 16 +- .../libraries/containerprofile/path_match.go | 4 +- .../containerprofile/prestop_cache_test.go | 8 +- .../containerprofile/syscall_test.go | 4 +- .../containerprofilenetwork/cache_test.go | 39 +- .../containerprofilenetwork.go | 7 +- .../containerprofilenetwork/fixtures_test.go | 2 +- .../integration_test.go | 17 +- .../containerprofilenetwork/legacy_test.go | 11 +- .../containerprofilenetwork/network_test.go | 13 +- .../containerprofilenetwork/wildcard_test.go | 5 +- pkg/rulemanager/cel/libraries/k8s/k8s.go | 2 +- pkg/rulemanager/cel/libraries/k8s/k8s_test.go | 21 +- pkg/rulemanager/cel/libraries/net/net_test.go | 8 +- pkg/rulemanager/cel/libraries/net/netlib.go | 2 +- .../parse/default_rules_yaml_lint_test.go | 6 +- .../cel/libraries/parse/integration_test.go | 4 +- .../cel/libraries/parse/parselib.go | 2 +- .../cel/libraries/parse/parsing_test.go | 12 +- .../cel/libraries/process/process.go | 2 +- .../cel/libraries/process/process_test.go | 23 +- .../cel/libraries/process/processlib.go | 2 +- pkg/rulemanager/prefilter/prefilter.go | 10 +- pkg/rulemanager/prefilter/prefilter_test.go | 50 +- pkg/rulemanager/rule_manager.go | 5 +- pkg/rulemanager/ruleadapters/adapters/bpf.go | 2 +- .../ruleadapters/adapters/capabilities.go | 2 +- pkg/rulemanager/ruleadapters/adapters/dns.go | 2 +- pkg/rulemanager/ruleadapters/adapters/exec.go | 2 +- .../ruleadapters/adapters/hardlink.go | 2 +- pkg/rulemanager/ruleadapters/adapters/http.go | 2 +- .../ruleadapters/adapters/iouring.go | 2 +- pkg/rulemanager/ruleadapters/adapters/kmod.go | 2 +- .../ruleadapters/adapters/network.go | 2 +- pkg/rulemanager/ruleadapters/adapters/open.go | 2 +- .../ruleadapters/adapters/procfs.go | 2 +- .../ruleadapters/adapters/randomx.go | 2 +- pkg/rulemanager/ruleadapters/adapters/ssh.go | 2 +- .../ruleadapters/adapters/symlink.go | 2 +- .../ruleadapters/adapters/syscall.go | 2 +- .../ruleadapters/adapters/unshare.go | 2 +- pkg/rulemanager/ruleadapters/creator.go | 2 +- .../rulecooldown/rulecooldown_test.go | 2 +- pkg/rulemanager/rulepolicy_test.go | 2 +- pkg/rulemanager/types/failure.go | 10 +- pkg/rulemanager/types/v1/doc_exec_tty_test.go | 1 - pkg/rulemanager/types/v1/profiledata.go | 18 +- pkg/rulemanager/types/v1/types.go | 4 +- pkg/sbommanager/v1/sbom_manager.go | 23 +- .../v1/sbom_manager_sharedwait_test.go | 6 +- pkg/sbomscanner/v1/client.go | 2 +- pkg/sbomscanner/v1/server.go | 2 +- pkg/sbomscanner/v1/types.go | 2 +- pkg/seccompmanager/v1/seccomp_manager_test.go | 7 +- pkg/storage/v1/seccompprofile.go | 1 - pkg/storage/v1/seccompprofile_crd.go | 9 +- pkg/storage/v1/seccompprofile_test.go | 1 - pkg/storage/v1/storage_test.go | 31 +- pkg/utils/datasource_event.go | 24 +- pkg/utils/datasource_event_tty_test.go | 11 +- pkg/utils/events.go | 4 +- pkg/utils/events_test.go | 2 +- pkg/utils/k8s.go | 6 +- pkg/utils/struct_event.go | 8 +- pkg/utils/time.go | 2 +- .../seccompprofilewatcher_test.go | 40 +- tests/resources/network_fixture_lint_test.go | 2 +- tests/testutils/k8s.go | 29 +- tests/testutils/prometheus.go | 10 +- tests/testutils/utils.go | 3 +- 176 files changed, 1080 insertions(+), 1862 deletions(-) diff --git a/go.mod b/go.mod index 61e7c658a6..475afc7f7d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubescape/node-agent -go 1.25.8 +go 1.27 require ( github.com/DmitriyVTitov/size v1.5.0 diff --git a/go.sum b/go.sum index 981d2408f0..6431a6c3cd 100644 --- a/go.sum +++ b/go.sum @@ -33,131 +33,33 @@ cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0c cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= -cloud.google.com/go/accessapproval v1.8.8/go.mod h1:RFwPY9JDKseP4gJrX1BlAVsP5O6kI8NdGlTmaeDefmk= -cloud.google.com/go/accesscontextmanager v1.9.7/go.mod h1:i6e0nd5CPcrh7+YwGq4bKvju5YB9sgoAip+mXU73aMM= -cloud.google.com/go/aiplatform v1.114.0/go.mod h1:W5yMrpIuHG/CSK8iF7XnwIfCJu6dcLRQ0cTqGR5vwwE= -cloud.google.com/go/analytics v0.30.1/go.mod h1:V/FnINU5kMOsttZnKPnXfKi6clJUHTEXUKQjHxcNK8A= -cloud.google.com/go/apigateway v1.7.7/go.mod h1:j1bCmrUK1BzVHpiIyTApxB7cRyhivKzltqLmp6j6i7U= -cloud.google.com/go/apigeeconnect v1.7.7/go.mod h1:ftGK3nca0JePiVLl0A6alaMjKdOc5C+sAkFMyH2RH8U= -cloud.google.com/go/apigeeregistry v0.10.0/go.mod h1:SAlF5OhKvyLDuwWAaFAIVJjrEqKRrGTPkJs+TWNnSqg= -cloud.google.com/go/appengine v1.9.7/go.mod h1:y1XpGVeAhbsNzHida79cHbr3pFRsym0ob8xnC8yphbo= -cloud.google.com/go/area120 v0.9.7/go.mod h1:5nJ0yksmjOMfc4Zpk+okWfJ3A1004FvB82rfia+ZLaY= -cloud.google.com/go/artifactregistry v1.19.0/go.mod h1:UEAPCgHDFC1q+A8nnVxXHPEy9KCVOeavFBF1fEChQvU= -cloud.google.com/go/asset v1.22.0/go.mod h1:q80JP2TeWWzMCazYnrAfDf36aQKf1QiKzzpNLflJwf8= -cloud.google.com/go/assuredworkloads v1.13.0/go.mod h1:o/oHEOnUlribR+uJWTKQo8A5RhSl9K9FNeMOew4TJ3M= cloud.google.com/go/auth v0.18.2 h1:+Nbt5Ev0xEqxlNjd6c+yYUeosQ5TtEUaNcN/3FozlaM= cloud.google.com/go/auth v0.18.2/go.mod h1:xD+oY7gcahcu7G2SG2DsBerfFxgPAJz17zz2joOFF3M= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= -cloud.google.com/go/automl v1.15.0/go.mod h1:U9zOtQb8zVrFNGTuW3BfxeqmLyeleLgT9B12EaXfODg= -cloud.google.com/go/baremetalsolution v1.4.0/go.mod h1:K6C6g4aS8LW95I0fEHZiBsBlh0UxwDLGf+S/vyfXbvg= -cloud.google.com/go/batch v1.14.0/go.mod h1:oeQveyG6NDS/ks2ilOP4LzKRmuIaI7GLe0CkR7WF6pk= -cloud.google.com/go/beyondcorp v1.2.0/go.mod h1:sszcgxpPPBEfLzbI0aYCTg6tT1tyt3CmKav3NZIUcvI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.72.0/go.mod h1:GUbRtmeCckOE85endLherHD9RsujY+gS7i++c1CqssQ= -cloud.google.com/go/bigtable v1.41.0/go.mod h1:JlaltP06LEFXaxQdZiarGR9tKsX/II0IkNAKMDrWspI= -cloud.google.com/go/billing v1.21.0/go.mod h1:ZGairB3EVnb3i09E2SxFxo50p5unPaMTuo1jh6jW9js= -cloud.google.com/go/binaryauthorization v1.10.0/go.mod h1:WOuiaQkI4PU/okwrcREjSAr2AUtjQgVe+PlrXKOmKKw= -cloud.google.com/go/certificatemanager v1.9.6/go.mod h1:vWogV874jKZkSRDFCMM3r7wqybv8WXs3XhyNff6o/Zo= -cloud.google.com/go/channel v1.21.0/go.mod h1:8v3TwHtgLmFxTpL2U+e10CLFOQN8u/Vr9RhYcJUS3y8= -cloud.google.com/go/cloudbuild v1.25.0/go.mod h1:lCu+T6IPkobPo2Nw+vCE7wuaAl9HbXLzdPx/tcF+oWo= -cloud.google.com/go/clouddms v1.8.8/go.mod h1:QtCyw+a73dlkDb2q20aTAPvfaTZCepDDi6Gb1AKq0a4= -cloud.google.com/go/cloudtasks v1.13.7/go.mod h1:H0TThOUG+Ml34e2+ZtW6k6nt4i9KuH3nYAJ5mxh7OM4= -cloud.google.com/go/compute v1.54.0/go.mod h1:RfBj0L1x/pIM84BrzNX2V21oEv16EKRPBiTcBRRH1Ww= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= -cloud.google.com/go/contactcenterinsights v1.17.4/go.mod h1:kZe6yOnKDfpPz2GphDHynxk/Spx+53UX/pGf+SmWAKM= -cloud.google.com/go/container v1.45.0/go.mod h1:eB6jUfJLjne9VsTDGcH7mnj6JyZK+KOUIA6KZnYE/ds= -cloud.google.com/go/containeranalysis v0.14.2/go.mod h1:FjppROiUtP9cyMegdWdY/TsBSGc6kqh1GjA2NOJXXL8= -cloud.google.com/go/datacatalog v1.26.1/go.mod h1:2Qcq8vsHNxMDgjgadRFmFG47Y+uuIVsyEGUrlrKEdrg= -cloud.google.com/go/dataflow v0.11.1/go.mod h1:3s6y/h5Qz7uuxTmKJKBifkYZ3zs63jS+6VGtSu8Cf7Y= -cloud.google.com/go/dataform v0.12.1/go.mod h1:atGS8ReRjfNDUQib0X/o/7Gi2bqHI2G7/J86LKiGimE= -cloud.google.com/go/datafusion v1.8.7/go.mod h1:4dkFb1la41qCEXh1AzYtFwl842bu2ikTUXyKhjvFCb0= -cloud.google.com/go/datalabeling v0.9.7/go.mod h1:EEUVn+wNn3jl19P2S13FqE1s9LsKzRsPuuMRq2CMsOk= -cloud.google.com/go/dataplex v1.28.0/go.mod h1:VB+xlYJiJ5kreonXsa2cHPj0A3CfPh/mgiHG4JFhbUA= -cloud.google.com/go/dataproc/v2 v2.15.0/go.mod h1:tSdkodShfzrrUNPDVEL6MdH9/mIEvp/Z9s9PBdbsZg8= -cloud.google.com/go/dataqna v0.9.8/go.mod h1:2lHKmGPOqzzuqCc5NI0+Xrd5om4ulxGwPpLB4AnFgpA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastore v1.21.0/go.mod h1:9l+KyAHO+YVVcdBbNQZJu8svF17Nw5sMKuFR0LYf1nY= -cloud.google.com/go/datastream v1.15.1/go.mod h1:aV1Grr9LFon0YvqryE5/gF1XAhcau2uxN2OvQJPpqRw= -cloud.google.com/go/deploy v1.27.3/go.mod h1:7LFIYYTSSdljYRqY3n+JSmIFdD4lv6aMD5xg0crB5iw= -cloud.google.com/go/dialogflow v1.74.0/go.mod h1:jlKHmd3/KdvWWhGZjoCnWQAQNOMHOhDK6DQ430p3T1I= -cloud.google.com/go/dlp v1.28.0/go.mod h1:C3od1fIK8lf7Kr62aU1Uh0z4OL5Z8s3do3znAiEupAw= -cloud.google.com/go/documentai v1.39.0/go.mod h1:KmlLO93F7GRU8dENXRxvt+7V8o7eCG6Y6WDitKbcYJs= -cloud.google.com/go/domains v0.10.7/go.mod h1:T3WG/QUAO/52z4tUPooKS8AY7yXaFxPYn1V3F0/JbNQ= -cloud.google.com/go/edgecontainer v1.4.4/go.mod h1:yyNVHsCKtsX/0mqFdbljQw0Uo660q2dlMPaiqYiC2Tg= -cloud.google.com/go/errorreporting v0.4.0/go.mod h1:dZGEhqzdHZSRxxWLVjC3Ue5CVaROzvP58D9rU6zbBfw= -cloud.google.com/go/essentialcontacts v1.7.7/go.mod h1:ytycWAEn/aKUMRKQPMVgMrAtphEMgjbzL8vFwM3tqXs= -cloud.google.com/go/eventarc v1.18.0/go.mod h1:/6SDoqh5+9QNUqCX4/oQcJVK16fG/snHBSXu7lrJtO8= -cloud.google.com/go/filestore v1.10.3/go.mod h1:94ZGyLTx9j+aWKozPQ6Wbq1DuImie/L/HIdGMshtwac= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= -cloud.google.com/go/firestore v1.21.0/go.mod h1:1xH6HNcnkf/gGyR8udd6pFO4Z7GWJSwLKQMx/u6UrP4= -cloud.google.com/go/functions v1.19.7/go.mod h1:xbcKfS7GoIcaXr2FSwmtn9NXal1JR4TV6iYZlgXffwA= -cloud.google.com/go/gkebackup v1.8.1/go.mod h1:GAaAl+O5D9uISH5MnClUop2esQW4pDa2qe/95A4l7YQ= -cloud.google.com/go/gkeconnect v0.12.5/go.mod h1:wMD2RXcsAWlkREZWJDVeDV70PYka1iEb9stFmgpw+5o= -cloud.google.com/go/gkehub v0.16.0/go.mod h1:ADp27Ucor8v81wY+x/5pOxTorxkPj/xswH3AUpN62GU= -cloud.google.com/go/gkemulticloud v1.6.0/go.mod h1:bGpd4o/Z5Z/XFlaojkgdVisHRwb+fLJvUPzsmV0I9ok= -cloud.google.com/go/gsuiteaddons v1.7.8/go.mod h1:DBKNHH4YXAdd/rd6zVvtOGAJNGo0ekOh+nIjTUDEJ5U= cloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc= cloud.google.com/go/iam v1.5.3/go.mod h1:MR3v9oLkZCTlaqljW6Eb2d3HGDGK5/bDv93jhfISFvU= -cloud.google.com/go/iap v1.11.3/go.mod h1:+gXO0ClH62k2LVlfhHzrpiHQNyINlEVmGAE3+DB4ShU= -cloud.google.com/go/ids v1.5.7/go.mod h1:N3ZQOIgIBwwOu2tzyhmh3JDT+kt8PcoKkn2BRT9Qe4A= -cloud.google.com/go/iot v1.8.7/go.mod h1:HvVcypV8LPv1yTXSLCNK+YCtqGHhq+p0F3BXETfpN+U= -cloud.google.com/go/kms v1.25.0/go.mod h1:XIdHkzfj0bUO3E+LvwPg+oc7s58/Ns8Nd8Sdtljihbk= -cloud.google.com/go/language v1.14.6/go.mod h1:7y3J9OexQsfkWNGCxhT+7lb64pa60e12ZCoWDOHxJ1M= -cloud.google.com/go/lifesciences v0.10.7/go.mod h1:v3AbTki9iWttEls/Wf4ag3EqeLRHofploOcpsLnu7iY= cloud.google.com/go/logging v1.13.1 h1:O7LvmO0kGLaHY/gq8cV7T0dyp6zJhYAOtZPX4TF3QtY= cloud.google.com/go/logging v1.13.1/go.mod h1:XAQkfkMBxQRjQek96WLPNze7vsOmay9H5PqfsNYDqvw= cloud.google.com/go/longrunning v0.8.0 h1:LiKK77J3bx5gDLi4SMViHixjD2ohlkwBi+mKA7EhfW8= cloud.google.com/go/longrunning v0.8.0/go.mod h1:UmErU2Onzi+fKDg2gR7dusz11Pe26aknR4kHmJJqIfk= -cloud.google.com/go/managedidentities v1.7.7/go.mod h1:nwNlMxtBo2YJMvsKXRtAD1bL41qiCI9npS7cbqrsJUs= -cloud.google.com/go/maps v1.26.0/go.mod h1:+auempdONAP8emtm48aCfNo1ZC+3CJniRA1h8J4u7bY= -cloud.google.com/go/mediatranslation v0.9.7/go.mod h1:mz3v6PR7+Fd/1bYrRxNFGnd+p4wqdc/fyutqC5QHctw= -cloud.google.com/go/memcache v1.11.7/go.mod h1:AU1jYlUqCihxapcJ1GGMtlMWDVhzjbfUWBXqsXa4rBg= -cloud.google.com/go/metastore v1.14.8/go.mod h1:h1XI2LpD4ohJhQYn9TwXqKb5sVt6KSo47ft96SiFF1s= cloud.google.com/go/monitoring v1.24.3 h1:dde+gMNc0UhPZD1Azu6at2e79bfdztVDS5lvhOdsgaE= cloud.google.com/go/monitoring v1.24.3/go.mod h1:nYP6W0tm3N9H/bOw8am7t62YTzZY+zUeQ+Bi6+2eonI= -cloud.google.com/go/networkconnectivity v1.20.0/go.mod h1:9MzGwD4ljiq+Z2Pg3ue27OEewCuHz7IUfw1fITrIdSw= -cloud.google.com/go/networkmanagement v1.21.0/go.mod h1:clG/5Yt0wQ57qSH6Yh7oehQYlobHw3F6nb3Pn4ig5hU= -cloud.google.com/go/networksecurity v0.11.0/go.mod h1:JLgDsg4tOyJ3eMO8lypjqMftbfd60SJ+P7T+DUmWBsM= -cloud.google.com/go/notebooks v1.12.7/go.mod h1:uR9pxAkKmlNloibMr9Q1t8WhIu4P2JeqJs7c064/0Mo= -cloud.google.com/go/optimization v1.7.7/go.mod h1:OY2IAlX23o52qwMAZ0w65wibKuV12a4x6IHDTCq6kcU= -cloud.google.com/go/orchestration v1.11.10/go.mod h1:tz7m1s4wNEvhNNIM3JOMH0lYxBssu9+7si5MCPw/4/0= -cloud.google.com/go/orgpolicy v1.15.1/go.mod h1:bpvi9YIyU7wCW9WiXL/ZKT7pd2Ovegyr2xENIeRX5q0= -cloud.google.com/go/osconfig v1.15.1/go.mod h1:NegylQQl0+5m+I+4Ey/g3HGeQxKkncQ1q+Il4DZ8PME= -cloud.google.com/go/oslogin v1.14.7/go.mod h1:NB6NqBHfDMwznePdBVX+ILllc1oPCdNSGp5u/WIyndY= -cloud.google.com/go/phishingprotection v0.9.7/go.mod h1:JTI4HNGyAbWolBoNOoCyCF0e3cqPNrYnlievHU49EwE= -cloud.google.com/go/policytroubleshooter v1.11.7/go.mod h1:JP/aQ+bUkt4Gz6lQXBi/+A/6nyNRZ0Pvxui5Xl9ieyk= -cloud.google.com/go/privatecatalog v0.10.8/go.mod h1:BkLHi+rtAGYBt5DocXLytHhF0n6F03Tegxgty40Y7aA= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.50.1/go.mod h1:6YVJv3MzWJUVdvQXG081sFvS0dWQOdnV+oTo++q/xFk= -cloud.google.com/go/pubsub/v2 v2.0.0/go.mod h1:0aztFxNzVQIRSZ8vUr79uH2bS3jwLebwK6q1sgEub+E= -cloud.google.com/go/pubsublite v1.8.2/go.mod h1:4r8GSa9NznExjuLPEJlF1VjOPOpgf3IT6k8x/YgaOPI= -cloud.google.com/go/recaptchaenterprise/v2 v2.21.0/go.mod h1:HxQYqZC2/zl2CvKN7jJEv71vEdDi1GMGNUiZxnpiuVI= -cloud.google.com/go/recommendationengine v0.9.7/go.mod h1:snZ/FL147u86Jqpv1j95R+CyU5NvL/UzYiyDo6UByTM= -cloud.google.com/go/recommender v1.13.6/go.mod h1:y5/5womtdOaIM3xx+76vbsiA+8EBTIVfWnxHDFHBGJM= -cloud.google.com/go/redis v1.18.3/go.mod h1:x8HtXZbvMBDNT6hMHaQ022Pos5d7SP7YsUH8fCJ2Wm4= -cloud.google.com/go/resourcemanager v1.10.7/go.mod h1:rScGkr6j2eFwxAjctvOP/8sqnEpDbQ9r5CKwKfomqjs= -cloud.google.com/go/resourcesettings v1.8.3/go.mod h1:BzgfXFHIWOOmHe6ZV9+r3OWfpHJgnqXy8jqwx4zTMLw= -cloud.google.com/go/retail v1.25.1/go.mod h1:J75G8pd+DH0SHueL9IJw7Y5d2VhTsjFsk+F1t9f8jXc= -cloud.google.com/go/run v1.15.0/go.mod h1:rgFHMdAopLl++57vzeqA+a1o2x0/ILZnEacRD6nC0EA= -cloud.google.com/go/scheduler v1.11.8/go.mod h1:bNKU7/f04eoM6iKQpwVLvFNBgGyJNS87RiFN73mIPik= -cloud.google.com/go/secretmanager v1.16.0/go.mod h1://C/e4I8D26SDTz1f3TQcddhcmiC3rMEl0S1Cakvs3Q= -cloud.google.com/go/security v1.19.2/go.mod h1:KXmf64mnOsLVKe8mk/bZpU1Rsvxqc0Ej0A6tgCeN93w= -cloud.google.com/go/securitycenter v1.38.1/go.mod h1:Ge2D/SlG2lP1FrQD7wXHy8qyeloRenvKXeB4e7zO6z0= -cloud.google.com/go/servicedirectory v1.12.7/go.mod h1:gOtN+qbuCMH6tj2dqlDY3qQL7w3V0+nkWaZElnJK8Ps= -cloud.google.com/go/shell v1.8.7/go.mod h1:OTke7qc3laNEW5Jr5OV9VR3IwU5x5VqGOE6705zFex4= -cloud.google.com/go/spanner v1.87.0/go.mod h1:tcj735Y2aqphB6/l+X5MmwG4NnV+X1NJIbFSZGaHYXw= -cloud.google.com/go/speech v1.29.0/go.mod h1:wtUmIS/h0ZYU6cPA9klcyST3f6i2FdnvNDqENjrRDds= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -165,23 +67,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.61.3 h1:VS//ZfBuPGDvakfD9xyPW1RGF1Vy3BWUoVZXgW1KMOg= cloud.google.com/go/storage v1.61.3/go.mod h1:JtqK8BBB7TWv0HVGHubtUdzYYrakOQIsMLffZ2Z/HWk= -cloud.google.com/go/storagetransfer v1.13.1/go.mod h1:S858w5l383ffkdqAqrAA+BC7KlhCqeNieK3sFf5Bj4Y= -cloud.google.com/go/talent v1.8.4/go.mod h1:3yukBXUTVFNyKcJpUExW/k5gqEy8qW6OCNj7WdN0MWo= -cloud.google.com/go/texttospeech v1.16.0/go.mod h1:AeSkoH3ziPvapsuyI07TWY4oGxluAjntX+pF4PJ2jy0= -cloud.google.com/go/tpu v1.8.4/go.mod h1:ul0cyWSHr6jHGZYElZe6HvQn35VY93RAlwpDiSBRnPA= cloud.google.com/go/trace v1.11.7 h1:kDNDX8JkaAG3R2nq1lIdkb7FCSi1rCmsEtKVsty7p+U= cloud.google.com/go/trace v1.11.7/go.mod h1:TNn9d5V3fQVf6s4SCveVMIBS2LJUqo73GACmq/Tky0s= -cloud.google.com/go/translate v1.12.7/go.mod h1:wwJp14NZyWvcrFANhIXutXj0pOBkYciBHwSlUOykcjI= -cloud.google.com/go/video v1.27.1/go.mod h1:xzfAC77B4vtnbi/TT3UUxEjCa/+Ehy5EA8w470ytOig= -cloud.google.com/go/videointelligence v1.12.7/go.mod h1:XAk5hCMY+GihxJ55jNoMdwdXSNZnCl3wGs2+94gK7MA= -cloud.google.com/go/vision/v2 v2.9.6/go.mod h1:lJC+vP15D5znJvHQYjEoTKnpToX1L93BUlvBmzM0gyg= -cloud.google.com/go/vmmigration v1.10.0/go.mod h1:LDztCWEb+RwS1bPg4Xzt0fcJS9kVrFxa3ejhH7OW9vg= -cloud.google.com/go/vmwareengine v1.3.6/go.mod h1:ps0rb+Skgpt9ppHYC0o5DqtJ5ld2FyS8sAqtbHH8t9s= -cloud.google.com/go/vpcaccess v1.8.7/go.mod h1:9RYw5bVvk4Z51Rc8vwXT63yjEiMD/l7XyEaDyrNHgmk= -cloud.google.com/go/webrisk v1.11.2/go.mod h1:yH44GeXz5iz4HFsIlGeoVvnjwnmfbni7Lwj1SelV4f0= -cloud.google.com/go/websecurityscanner v1.7.7/go.mod h1:ng/PzARaus3Bj4Os4LpUnyYHsbtJky1HbBDmz148v1o= -cloud.google.com/go/workflows v1.14.3/go.mod h1:CC9+YdVI2Kvp0L58WajHpEfKJxhrtRh3uQ0SYWcmAk4= -crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= cyphar.com/go-pathrs v0.2.1 h1:9nx1vOgwVvX1mNBWDu93+vaceedpbsDqo+XuBGL40b8= cyphar.com/go-pathrs v0.2.1/go.mod h1:y8f1EMG7r+hCuFf/rXsKqMJrJAUoADZGNh5/vZPKcGc= dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= @@ -191,10 +78,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -gioui.org v0.2.0/go.mod h1:1H72sKEk/fNFV+l0JNeM2Dt3co3Y4uaQcD+I+/GQ0e4= -gioui.org/cpu v0.0.0-20220412190645-f1e9e8c3b1f7/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ= -gioui.org/shader v1.0.6/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM= -gioui.org/x v0.2.0/go.mod h1:rCGN2nZ8ZHqrtseJoQxCMZpt2xrZUrdZ2WuMRLBJmYs= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= git.sr.ht/~sbinet/cmpimg v0.1.0 h1:E0zPRk2muWuCqSKSVZIWsgtU9pjsw3eKHi8VmQeScxo= git.sr.ht/~sbinet/cmpimg v0.1.0/go.mod h1:FU12psLbF4TfNXkKH2ZZQ29crIqoiqTZmeQ7dkp/pxE= @@ -204,29 +87,11 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8af github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20250520111509-a70c2aa677fa h1:x6kFzdPgBoLbyoNkA/jny0ENpoEz4wqY8lPTQL2DPkg= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20250520111509-a70c2aa677fa/go.mod h1:gCLVsLfv1egrcZu+GoJATN5ts75F2s62ih/457eWzOw= -github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization v1.0.0/go.mod h1:lPneRe3TwsoDRKY4O6YDLXHhEWrD+TIRa8XrV/3/fqw= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.1.1/go.mod h1:WqyxV5S0VtXD2+2d6oPqOvyhGubCvzLCKSAKgQ004Uk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2 v2.4.0/go.mod h1:U5gpsREQZE6SLk1t/cFfc1eMhYAlYpEzvaYXuDfefy8= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= -github.com/Azure/go-autorest/autorest/adal v0.9.24/go.mod h1:7T1+g0PYFmACYW5LlG2fcoPiPlFHjClyRGL7dRlP5c8= -github.com/Azure/go-autorest/autorest/azure/auth v0.5.13/go.mod h1:5BAVfWLWXihP47vYrPuBKKf4cS0bXI+KM9Qx6ETDJYo= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.6/go.mod h1:piCfgPho7BiIDdEQ1+g4VmKyD5y+p/XtSNqE6Hc4QD0= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/Azure/go-ntlmssp v0.1.1 h1:l+FM/EEMb0U9QZE7mKNEDw5Mu3mFiaa2GKOoTSsNDPw= github.com/Azure/go-ntlmssp v0.1.1/go.mod h1:NYqdhxd/8aAct/s4qSYZEerdPuH1liG2/X9DiVTbhpk= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= @@ -239,7 +104,6 @@ github.com/DataDog/zstd v1.5.7 h1:ybO8RBeh29qrxIhCA9E8gKY6xfONU9T6G6aP9DTKfLE= github.com/DataDog/zstd v1.5.7/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DmitriyVTitov/size v1.5.0 h1:/PzqxYrOyOUX1BXj6J9OuVRVGe+66VL4D9FlUaW515g= github.com/DmitriyVTitov/size v1.5.0/go.mod h1:le6rNI4CoLQV1b9gzp1+3d7hMAD/uu2QcJ+aYbNgiU0= -github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible/go.mod h1:BB1eHdMLYEFuFdBlRMb0N7YGVdM5s6Pt0njxgvfbGGs= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 h1:rIkQfkCOVKc1OiRCNcSDD8ml5RJlZbH/Xsq7lbpynwc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0/go.mod h1:RD2SsorTmYhF6HkTmDw7KmPYQk8OBYwTkuasChwv7R4= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 h1:UnDZ/zFfG1JhH/DqxIZYU/1CUAlTUScoXD/LcM2Ykk8= @@ -248,60 +112,44 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.55.0/go.mod h1:vB2GH9GAYYJTO3mEn8oYwzEdhlayZIdQz6zdzgUIRvA= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0 h1:0s6TxfCu2KHkkZPnBfsQ2y5qia0jl3MMrmBhu3nCOYk= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0/go.mod h1:Mf6O40IAyB9zR/1J8nGDDPirZQQPbYJni8Yisy7NTMc= -github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= -github.com/Microsoft/cosesign1go v1.4.0/go.mod h1:1La/HcGw19rRLhPW0S6u55K6LKfti+GQSgGCtrfhVe8= -github.com/Microsoft/didx509go v0.0.3/go.mod h1:wWt+iQsLzn3011+VfESzznLIp/Owhuj7rLF7yLglYbk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Microsoft/hcsshim v0.14.0-rc.1 h1:qAPXKwGOkVn8LlqgBN8GS0bxZ83hOJpcjxzmlQKxKsQ= github.com/Microsoft/hcsshim v0.14.0-rc.1/go.mod h1:hTKFGbnDtQb1wHiOWv4v0eN+7boSWAHyK/tNAaYZL0c= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/PaesslerAG/gval v1.0.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I= -github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= github.com/ProtonMail/go-crypto v1.4.0 h1:Zq/pbM3F5DFgJiMouxEdSVY44MVoQNEKp5d5QxIQceQ= github.com/ProtonMail/go-crypto v1.4.0/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo= github.com/STARRY-S/zip v0.2.3 h1:luE4dMvRPDOWQdeDdUxUoZkzUIpTccdKdhHHsQJ1fm4= github.com/STARRY-S/zip v0.2.3/go.mod h1:lqJ9JdeRipyOQJrYSOtpNAiaesFO6zVDsE8GIGFaoSk= github.com/SergJa/jsonhash v0.0.0-20210531165746-fc45f346aa74 h1:zZX7V5abnOB0VTEFnwYxwbuot0GCZUjQZQpjHKnG1Kk= github.com/SergJa/jsonhash v0.0.0-20210531165746-fc45f346aa74/go.mod h1:GE9lvSMBrKhFDkoh660mCThn1v7/jfb1r0Z+DpUX4zQ= -github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= -github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE= github.com/acobaugh/osrelease v0.1.0/go.mod h1:4bFEs0MtgHNHBrmHCt67gNisnabCRAlzdVasCEGHTWY= github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78= github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agnivade/levenshtein v1.2.0/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= -github.com/alecthomas/kong v0.5.0/go.mod h1:uzxf/HUh0tj43x1AyJROl3JT7SgsZ5m+icOv1csRhc0= -github.com/alecthomas/participle/v2 v2.1.0/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI= github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.68/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/anchore/archiver/v3 v3.5.3-0.20241210171143-5b1d8d1c7c51 h1:yhk+P8lF3ZiROjmaVRao9WGTRo4b/wYjoKEiAHWrKwc= github.com/anchore/archiver/v3 v3.5.3-0.20241210171143-5b1d8d1c7c51/go.mod h1:nwuGSd7aZp0rtYt79YggCGafz1RYsclE7pi3fhLwvuw= -github.com/anchore/bubbly v0.0.0-20231115134915-def0aba654a9/go.mod h1:3ZsFB9tzW3vl4gEiUeuSOMDnwroWxIxJelOOHUp8dSw= github.com/anchore/clio v0.0.0-20250715152405-a0fa658e5084 h1:7DUAXEdAxoANPlDgxYiaSRKnWnTygvdrrWhnmvEjNLg= github.com/anchore/clio v0.0.0-20250715152405-a0fa658e5084/go.mod h1:42dWox8z4//b898OIELsQnSdYq9q1aCXkwp5fKF+BEU= github.com/anchore/fangs v0.0.0-20250716230140-94c22408c232 h1:aVC6r9h5wGNh8BYTW3CXxOdPoZzY/bBRWne1NvSTlO8= @@ -327,7 +175,6 @@ github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04 h1:VzprUTpc0v github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04/go.mod h1:6dK64g27Qi1qGQZ67gFmBFvEHScy0/C8qhQhNe5B5pQ= github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4 h1:rmZG77uXgE+o2gozGEBoUMpX27lsku+xrMwlmBZJtbg= github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4/go.mod h1:Bkc+JYWjMCF8OyZ340IMSIi2Ebf3uwByOk6ho4wne1E= -github.com/anchore/grype v0.99.1/go.mod h1:cTGGq+9Z2O9gGbe2EYiiLyqtmmRAdAZKbBA3i9ZXAao= github.com/anchore/packageurl-go v0.1.1-0.20250220190351-d62adb6e1115 h1:ZyRCmiEjnoGJZ1+Ah0ZZ/mKKqNhGcUZBl0s7PTTDzvY= github.com/anchore/packageurl-go v0.1.1-0.20250220190351-d62adb6e1115/go.mod h1:KoYIv7tdP5+CC9VGkeZV4/vGCKsY55VvoG+5dadg4YI= github.com/anchore/stereoscope v0.1.9 h1:Nhvk8g6PRx9ubaJU4asAhD3fGcY5HKXZCDGkxI2e0sI= @@ -335,7 +182,6 @@ github.com/anchore/stereoscope v0.1.9/go.mod h1:YkrCtDgz7A+w6Ggd0yxU9q58CerqQFwY github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= -github.com/andybalholm/stroke v0.0.0-20221221101821-bd29b49d73f0/go.mod h1:ccdDYaY5+gO+cbnQdFxEXqfy0RkoV25H3jLXUDNM3wg= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= @@ -389,19 +235,12 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 h1:qYQ4pzQ2Oz6WpQ8T3HvGHnZydA72 github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6/go.mod h1:O3h0IK87yXci+kg6flUKzJnWeziQUKciKrLjcatSNcY= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22 h1:rWyie/PxDRIdhNf4DzRk0lvjVOqFJuNnO8WwaIRVxzQ= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22/go.mod h1:zd/JsJ4P7oGfUhXn1VyLqaRZwPmZwg44Jf2dS84Dm3Y= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.56.2/go.mod h1:dLREOeW66eVaaGIOi2ZlLHDgkR3nuJ02rd00j0YSlBE= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.195.0/go.mod h1:00zqVNJFK6UASrTnuvjJHJuaqUdkVz5tW8Ip+VhzuNg= -github.com/aws/aws-sdk-go-v2/service/ecr v1.45.1/go.mod h1:xZzWl9AXYa6zsLLH41HBFW8KRKJRIzlGmvSM0mVMIX4= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.33.2/go.mod h1:JUBHdhvKbbKmhaHjLsKJAWnQL80T6nURmhB/LEprV+4= github.com/aws/aws-sdk-go-v2/service/ecs v1.71.0 h1:MzP/ElwTpINq+hS80ZQz4epKVnUTlz8Sz+P/AFORCKM= github.com/aws/aws-sdk-go-v2/service/ecs v1.71.0/go.mod h1:pMlGFDpHoLTJOIZHGdJOAWmi+xeIlQXuFTuQxs1epYE= -github.com/aws/aws-sdk-go-v2/service/eks v1.48.5/go.mod h1:9dn8p15siUL80NCTPVNd+YvEpVTmWO+rboGx6qOMBa0= -github.com/aws/aws-sdk-go-v2/service/iam v1.53.6/go.mod h1:RJNVc52A0K41fCDJOnsCLeWJf8mwa0q30fM3CfE9U18= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 h1:5EniKhLZe4xzL7a+fU3C2tfUN4nWIqlLesfrjkuPFTY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7/go.mod h1:x0nZssQ3qZSnIcePWLvcoFisRXJzcTVvYpAAdYX8+GI= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13 h1:JRaIgADQS/U6uXDqlPiefP32yXTda7Kqfx+LgspooZM= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13/go.mod h1:CEuVn5WqOMilYl+tbccq8+N2ieCy0gVn3OtRb0vBNNM= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.20/go.mod h1:ihZMtPTKoX/ugQRHbui6zNdSgVYN1KY2Dgwb2d3hXlc= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 h1:c31//R3xgIJMSC8S6hEVq+38DcvUlgFY0FM6mSI5oto= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21/go.mod h1:r6+pf23ouCB718FUxaqzZdbpYFyDtehyZcmP5KL9FkA= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.21 h1:ZlvrNcHSFFWURB8avufQq9gFsheUgjVD9536obIknfM= @@ -410,8 +249,6 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.97.3 h1:HwxWTbTrIHm5qY+CAEur0s/figc3q github.com/aws/aws-sdk-go-v2/service/s3 v1.97.3/go.mod h1:uoA43SdFwacedBfSgfFSjjCvYe8aYBS7EnU5GZ/YKMM= github.com/aws/aws-sdk-go-v2/service/signin v1.0.8 h1:0GFOLzEbOyZABS3PhYfBIx2rNBACYcKty+XGkTgw1ow= github.com/aws/aws-sdk-go-v2/service/signin v1.0.8/go.mod h1:LXypKvk85AROkKhOG6/YEcHFPoX+prKTowKnVdcaIxE= -github.com/aws/aws-sdk-go-v2/service/sns v1.39.13/go.mod h1:RwF6Xnba8PlINxJUQq1IAWeon6IglvqsnhNqV8QsQjk= -github.com/aws/aws-sdk-go-v2/service/sqs v1.42.24/go.mod h1:Ql9ziDutk8ERAN9HMaYANCW3lop451ppebkxEJMLCTM= github.com/aws/aws-sdk-go-v2/service/sso v1.30.13 h1:kiIDLZ005EcKomYYITtfsjn7dtOwHDOFy7IbPXKek2o= github.com/aws/aws-sdk-go-v2/service/sso v1.30.13/go.mod h1:2h/xGEowcW/g38g06g3KpRWDlT+OTfxxI0o1KqayAB8= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.17 h1:jzKAXIlhZhJbnYwHbvUQZEB8KfgAEuG0dc08Bkda7NU= @@ -420,13 +257,10 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.41.9 h1:Cng+OOwCHmFljXIxpEVXAGMnBia8 github.com/aws/aws-sdk-go-v2/service/sts v1.41.9/go.mod h1:LrlIndBDdjA/EeXeyNBle+gyCwTlizzW5ycgWnvIxkk= github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= -github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.10.1/go.mod h1:EVJOSYOVeoD3VFFZ/dWCAzWJp5wZr9lTOCjW8ejAmO0= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/becheran/wildmatch-go v1.0.0 h1:mE3dGGkTmpKtT4Z+88t8RStG40yN9T+kFEGj2PZFSzA= github.com/becheran/wildmatch-go v1.0.0/go.mod h1:gbMvj0NtVdJ15Mg/mH9uxk2R1QCistMyU7d9KFzroX4= -github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -436,14 +270,12 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitnami/go-version v0.0.0-20250505154626-452e8c5ee607 h1:lBg3tHGquFySSblLi9zNi2iGNmVLRHBzVal2fqphCM8= github.com/bitnami/go-version v0.0.0-20250505154626-452e8c5ee607/go.mod h1:9iglf1GG4oNRJ39bZ5AZrjgAFD2RwQbXw6Qf7Cs47wo= -github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4= github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/bmatcuk/doublestar/v2 v2.0.4/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQmTZRptLie8RgRw= github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs= github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bodgit/plumbing v1.3.0 h1:pf9Itz1JOQgn7vEOE7v7nlEfBykYqvUYioC61TwWCFU= @@ -452,14 +284,12 @@ github.com/bodgit/sevenzip v1.6.1 h1:kikg2pUMYC9ljU7W9SaqHXhym5HyKm8/M/jd31fYan4 github.com/bodgit/sevenzip v1.6.1/go.mod h1:GVoYQbEVbOGT8n2pfqCIMRUaRjQ8F9oSqoBEqZh5fQ8= github.com/bodgit/windows v1.0.1 h1:tF7K6KOluPYygXa3Z2594zxlkbKPAOvqr97etrGNIz4= github.com/bodgit/windows v1.0.1/go.mod h1:a6JLwrB4KrTR5hBpp8FI9/9W9jJfeQ2h4XDXU74ZCdM= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/briandowns/spinner v1.23.2 h1:Zc6ecUnI+YzLmJniCfDNaMbW0Wid1d5+qcTq4L2FW8w= github.com/briandowns/spinner v1.23.2/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY= github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -475,26 +305,20 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs= github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg= github.com/charmbracelet/bubbletea v1.3.6 h1:VkHIxPJQeDt0aFJIsVxw8BQdh/F/L2KKZGsK6et5taU= github.com/charmbracelet/bubbletea v1.3.6/go.mod h1:oQD9VCRQFF8KplacJLo28/jofOI2ToOfGYeFgBBxHOc= github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40= github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0= -github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= github.com/charmbracelet/x/ansi v0.9.3 h1:BXt5DHS/MKF+LjuK4huWrC6NCvHtexww7dMayh6GXd0= github.com/charmbracelet/x/ansi v0.9.3/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE= github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k= github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= -github.com/charmbracelet/x/exp/golden v0.0.0-20240806155701-69247e0abc2a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= -github.com/checkpoint-restore/checkpointctl v1.3.0/go.mod h1:dqZH4wDvbjnsqFGK2LdUDk21yFQ1dCAtzgRMlG44KDM= -github.com/checkpoint-restore/go-criu/v7 v7.2.0/go.mod h1:u0LCWLg0w4yqqu14aXhiB4YD3a1qd8EcCEg7vda5dwo= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs= github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= @@ -506,24 +330,11 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cilium/cilium v1.17.16 h1:Q7P7zQ2Y9RVmc4oTklyJya3Xgc4aUEa448rb/snKvlI= github.com/cilium/cilium v1.17.16/go.mod h1:Eo7JFpb7zvlezx4tdT8T6G0FVzE7IClv+DFzovHbi/o= -github.com/cilium/coverbee v0.3.3-0.20240723084546-664438750fce/go.mod h1:6RGqSqaXtkBGjm7na2bKFi52BeeGUuiT3178zeje4Ik= -github.com/cilium/deepequal-gen v0.0.0-20241016021505-f57df2fe2e62/go.mod h1:9EU8oWNwEP6f98xJz/YjWw7yOLHK7p90MKmaPu1wBcE= -github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a/go.mod h1:/7LC2GOgyXJ7maupZlaVIumYQiGPIgllSf6mA9sg6RU= github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/cilium/ebpf v0.8.1/go.mod h1:f5zLIM0FSNuAkSyLAN7X+Hy6yznlF1mNiWUMfxMtrgk= github.com/cilium/ebpf v0.22.0 h1:v2ktp0roffpMOj2MMf3idtCQZOsAoC4BJbAJN+ke2bY= github.com/cilium/ebpf v0.22.0/go.mod h1:CDzZbe2hC5JjlDC+CY3KFCzlYwN4gbxppYM+Z10bQt4= -github.com/cilium/endpointslice v0.29.4-0.20240409195643-982ad68ab7ba/go.mod h1:9MPoeojWVEBLFnioKXTvRoqGWTs9Dt252r1ACFsi8K8= -github.com/cilium/endpointslice-controller v0.0.0-20240409203012-75cb5d61db1b/go.mod h1:izWO5C3waDVkh/nt++nNyozXyJAPL6tfFpJSMtzVnwQ= -github.com/cilium/fake v0.6.1/go.mod h1:V9lCbbcsnSf3vB6sdOP7Q0bsUUJ/jyHPZxnFAw5nPUc= -github.com/cilium/hive v0.0.0-20250522145610-0734675df148/go.mod h1:pI2GJ1n3SLKIQVFrKF7W6A6gb6BQkZ+3Hp4PAEo5SuI= -github.com/cilium/linters v0.1.0/go.mod h1:mpr0RBmILRLQu2F7ek+gjBxxuacUB/IBmjDRC3RaFkI= -github.com/cilium/lumberjack/v2 v2.4.1/go.mod h1:yfbtPGmg4i//5oEqzaMxDqSWqgfZFmMoV70Mc2k6v0A= -github.com/cilium/proxy v0.0.0-20250526114940-b80199397e8a/go.mod h1:Bs5kHQ+FYHLrAkEaTQpbwblJIv6NfU2Tsuo+wCkN+9s= -github.com/cilium/statedb v0.4.5/go.mod h1:DlxX9OQi/nM8oumUuz8VjxXUtVRiEfbfo8Ri1YWNCGI= -github.com/cilium/stream v0.0.0-20241203114243-53c3e5d79744/go.mod h1:/e83AwqvNKpyg4n3C41qmnmj1x2G9DwzI+jb7GkF4lI= -github.com/cilium/workerpool v1.2.0/go.mod h1:GOYJhwlnIjR+jWSDNBb5kw47G1H/XA9X4WOBpgr4pQU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -545,17 +356,12 @@ github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs/v2 v2.0.0/go.mod h1:swkD/7j9HApWpzl8OHfrHNxppPd9l44DFZdF94BUj9k= -github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/cgroups/v3 v3.1.2 h1:OSosXMtkhI6Qove637tg1XgK4q+DhR0mX8Wi8EhrHa4= github.com/containerd/cgroups/v3 v3.1.2/go.mod h1:PKZ2AcWmSBsY/tJUVhtS/rluX0b1uq1GmPO1ElCmbOw= -github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/containerd v1.7.33 h1:iAkYGC/ifR/V+0eR4iXWHNGYUF0DF2PmGV5iz4Irj5M= github.com/containerd/containerd v1.7.33/go.mod h1:gSbSCVjPCdkfJCjyrzz7aRC+xFlqVbatNpfHfVCYGUM= github.com/containerd/containerd/api v1.10.0 h1:5n0oHYVBwN4VhoX9fFykCV9dF1/BvAXeg2F8W6UYq1o= github.com/containerd/containerd/api v1.10.0/go.mod h1:NBm1OAk8ZL+LG8R0ceObGxT5hbUYj7CzTmR3xh0DlMM= -github.com/containerd/containerd/v2 v2.1.2/go.mod h1:8C5QV9djwsYDNhxfTCFjWtTBZrqjditQ4/ghHSYjnHM= github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4= github.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= @@ -564,73 +370,47 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= -github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM= -github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U= -github.com/containerd/imgcrypt v1.1.8/go.mod h1:x6QvFIkMyO2qGIY2zXc88ivEzcbgvLdWjoZyGqDap5U= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/nri v0.11.0 h1:26mcQwNG58AZn0YkOrlJQ0yxQVmyZooflnVWJTqQrqQ= github.com/containerd/nri v0.11.0/go.mod h1:bjGTLdUA58WgghKHg8azFMGXr05n1wDHrt3NSVBHiGI= github.com/containerd/platforms v1.0.0-rc.2 h1:0SPgaNZPVWGEi4grZdV8VRYQn78y+nm6acgLGv/QzE4= github.com/containerd/platforms v1.0.0-rc.2/go.mod h1:J71L7B+aiM5SdIEqmd9wp6THLVRzJGXfNuWCZCllLA4= -github.com/containerd/plugin v1.0.0/go.mod h1:hQfJe5nmWfImiqT1q8Si3jLv3ynMUIBB47bQ+KexvO8= -github.com/containerd/protobuild v0.3.0/go.mod h1:5mNMFKKAwCIAkFBPiOdtRx2KiQlyEJeMXnL5R1DsWu8= github.com/containerd/stargz-snapshotter/estargz v0.18.2 h1:yXkZFYIzz3eoLwlTUZKz2iQ4MrckBxJjkmD16ynUTrw= github.com/containerd/stargz-snapshotter/estargz v0.18.2/go.mod h1:XyVU5tcJ3PRpkA9XS2T5us6Eg35yM0214Y+wvrZTBrY= github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ= github.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40= github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= -github.com/containerd/zfs v1.1.0/go.mod h1:oZF9wBnrnQjpWLaPKEinrx3TQ9a+W/RJO7Zb41d8YLE= -github.com/containernetworking/cni v1.3.0/go.mod h1:Bs8glZjjFfGPHMw6hQu82RUgEPNGEaBb9KS5KtNMnJ4= -github.com/containernetworking/plugins v1.7.1/go.mod h1:xuMdjuio+a1oVQsHKjr/mgzuZ24leAsqUYRnzGoXHy0= github.com/containers/common v0.64.2 h1:1xepE7QwQggUXxmyQ1Dbh6Cn0yd7ktk14sN3McSWf5I= github.com/containers/common v0.64.2/go.mod h1:o29GfYy4tefUuShm8mOn2AiL5Mpzdio+viHI7n24KJ4= -github.com/containers/image/v5 v5.36.2/go.mod h1:b4GMKH2z/5t6/09utbse2ZiLK/c72GuGLFdp7K69eA4= -github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= -github.com/containers/ocicrypt v1.2.1/go.mod h1:aD0AAqfMp0MtwqWgHM1bUwe1anx0VazI108CRrSKINQ= -github.com/containers/storage v1.59.1/go.mod h1:KoAYHnAjP3/cTsRS+mmWZGkufSY2GACiKQ4V3ZLQnR0= -github.com/coreos/go-oidc v2.3.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-oidc/v3 v3.17.0 h1:hWBGaQfbi0iVviX4ibC7bk8OKT5qNr4klBaCHVNvehc= github.com/coreos/go-oidc/v3 v3.17.0/go.mod h1:wqPbKFrVnE90vty060SB40FCJ8fTHTxSwyXJqZH+sI8= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo= github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/crewjam/rfc5424 v0.1.0 h1:MSeXJm22oKovLzWj44AHwaItjIMUMugYGkEzfa831H8= github.com/crewjam/rfc5424 v0.1.0/go.mod h1:RCi9M3xHVOeerf6ULZzqv2xOGRO/zYaVUeRyPnBW3gQ= -github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE= github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc= -github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs= -github.com/dave/jennifer v1.7.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/deitch/magic v0.0.0-20240306090643-c67ab88f10cb h1:4W/2rQ3wzEimF5s+J6OY3ODiQtJZ5W1sForSgogVXkY= github.com/deitch/magic v0.0.0-20240306090643-c67ab88f10cb/go.mod h1:B3tI9iGHi4imdLi4Asdha1Sc6feLMTfPLXh9IUYmysk= github.com/dghubble/trie v0.1.0 h1:kJnjBLFFElBwS60N4tkPvnLhnpcDxbBjIulgI8CpNGM= github.com/dghubble/trie v0.1.0/go.mod h1:sOmnzfBNH7H92ow2292dDFWNsVQuh/izuD7otCYb1ak= -github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/didip/tollbooth/v7 v7.0.2/go.mod h1:RtRYfEmFGX70+ike5kSndSvLtQ3+F2EAmTI4Un/VXNc= -github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/disiqueira/gotree/v3 v3.0.2/go.mod h1:ZuyjE4+mUQZlbpkI24AmruZKhg3VHEgPLDY8Qk+uUu8= github.com/diskfs/go-diskfs v1.7.0 h1:vonWmt5CMowXwUc79jWyGrf2DIMeoOjkLlMnQYGVOs8= github.com/diskfs/go-diskfs v1.7.0/go.mod h1:LhQyXqOugWFRahYUSw47NyZJPezFzB9UELwhpszLP/k= github.com/distribution/distribution v2.8.2+incompatible h1:k9+4DKdOG+quPFZXT/mUsiQrGu9vYCp+dXpuPkuqhk8= @@ -651,19 +431,14 @@ github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pM github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 h1:EHZfspsnLAz8Hzccd67D5abwLiqoqym2jz/jOS39mCk= github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libnetwork v0.8.0-dev.2.0.20210525090646-64b7a4574d14/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvyukov/go-fuzz v0.0.0-20210103155950-6a8e9d1f2415/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= -github.com/eapache/channels v1.1.0/go.mod h1:jMm2qB5Ubtg9zLd+inMZd2/NUvXgzmWXsDaLyQIGfH0= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/elliotchance/phpserialize v1.4.0 h1:cAp/9+KSnEbUC8oYCE32n2n84BeW8HOY3HMDI8hG2OY= @@ -685,7 +460,6 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= github.com/envoyproxy/go-control-plane v0.14.0/go.mod h1:NcS5X47pLl/hfqxU70yPwL9ZMkUlwlKxtAohpi2wBEU= -github.com/envoyproxy/go-control-plane/contrib v1.32.4/go.mod h1:gkGYoY7plfQg7FPBDhyKtP1cDA9frFR/3YsCx8taRvI= github.com/envoyproxy/go-control-plane/envoy v1.37.0 h1:u3riX6BoYRfF4Dr7dwSOroNfdSbEPe9Yyl09/B6wBrQ= github.com/envoyproxy/go-control-plane/envoy v1.37.0/go.mod h1:DReE9MMrmecPy+YvQOAOHNYMALuowAnbjjEMkkWOi6A= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= @@ -696,16 +470,11 @@ github.com/envoyproxy/protoc-gen-validate v1.3.3 h1:MVQghNeW+LZcmXe7SY1V36Z+WFMD github.com/envoyproxy/protoc-gen-validate v1.3.3/go.mod h1:TsndJ/ngyIdQRhMcVVGDDHINPLWB7C82oDArY51KfB0= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= -github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= -github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= -github.com/expr-lang/expr v1.17.7/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/facebookincubator/flog v0.0.0-20190930132826-d2511d0ce33c/go.mod h1:QGzNH9ujQ2ZUr/CjDGZGWeDAVStrWNjHeEcjJL96Nuk= github.com/facebookincubator/nvdtools v0.1.5 h1:jbmDT1nd6+k+rlvKhnkgMokrCAzHoASWE5LtHbX2qFQ= github.com/facebookincubator/nvdtools v0.1.5/go.mod h1:Kh55SAWnjckS96TBSrXI99KrEKH4iB0OJby3N8GRJO4= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -721,7 +490,6 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/florianl/go-tc v0.4.7 h1:Ysai5TIx4PgOzqI/1cse/pquOFCEkWofKtc/EPumfrg= github.com/florianl/go-tc v0.4.7/go.mod h1:Fdz6eHitQZwylSvpAW3y9R9cUrnS/zinuAdjJpD7XqY= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= @@ -741,9 +509,6 @@ github.com/gammazero/deque v1.0.0/go.mod h1:iflpYvtGfM3U8S8j+sZEKIak3SAKYpA5/SQe github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/github/go-spdx/v2 v2.4.0 h1:+4IwVwJJbm3rzvrQ6P1nI9BDMcy3la4RchRy5uehV/M= github.com/github/go-spdx/v2 v2.4.0/go.mod h1:/5rwgS0txhGtRdUZwc02bTglzg6HK3FfuEbECKlK2Sg= -github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= -github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk= -github.com/gkampitakis/go-snaps v0.5.14/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc= github.com/glebarez/go-sqlite v1.20.3 h1:89BkqGOXR9oRmG58ZrzgoY/Fhy5x0M+/WV48U5zVrZ4= github.com/glebarez/go-sqlite v1.20.3/go.mod h1:u3N6D/wftiAzIOJtZl6BmedqxmmkDfH3q+ihjqxC9u0= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -760,7 +525,6 @@ github.com/go-fonts/latin-modern v0.3.2 h1:M+Sq24Dp0ZRPf3TctPnG1MZxRblqyWC/cRUL9 github.com/go-fonts/latin-modern v0.3.2/go.mod h1:9odJt4NbRrbdj4UAMuLVd4zEukf6aAEKnDaQga0whqQ= github.com/go-fonts/liberation v0.3.2 h1:XuwG0vGHFBPRRI8Qwbi5tIvR3cku9LUfZGq/Ar16wlQ= github.com/go-fonts/liberation v0.3.2/go.mod h1:N0QsDLVUQPy3UYg9XAc3Uh3UDMp2Z7M1o4+X98dXkmI= -github.com/go-fonts/stix v0.2.2/go.mod h1:SUxggC9dxd/Q+rb5PkJuvfvTbOPtNc2Qaua00fIp9iU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmmBPA= @@ -772,21 +536,16 @@ github.com/go-git/go-git/v5 v5.19.2/go.mod h1:QqCBE1EFN5ddFmrliLQ3/ntRCUjZU3EJuw github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gota/gota v0.12.0/go.mod h1:UT+NsWpZC/FhaOyWb9Hui0jXg0Iq8e/YugZHTbyW/34= -github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-jose/go-jose/v3 v3.0.5/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea h1:DfZQkvEbdmOe+JK2TMtBM+0I9GSdzE2y/L1/AmD8xKc= github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea/go.mod h1:Y7Vld91/HRbTBm7JwoI7HejdDB0u+e9AUBO9MB7yuZk= github.com/go-ldap/ldap/v3 v3.4.10 h1:ot/iwPOhfpNVgB1o+AVXljizWZ9JTp7YF5oeyONmcJU= github.com/go-ldap/ldap/v3 v3.4.10/go.mod h1:JXh4Uxgi40P6E9rdsYqpUtbW46D9UTjJ9QSwGRznplY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -816,27 +575,21 @@ github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3Bum github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ= github.com/go-pdf/fpdf v0.9.0 h1:PPvSaUuo1iMi9KkaAn90NuKi+P4gwMedWPHhj8YlJQw= github.com/go-pdf/fpdf v0.9.0/go.mod h1:oO8N111TkmKb9D7VvWGLvLJlaZUQVPM+6V42pp3iV4Y= -github.com/go-pkgz/expirable-cache/v3 v3.0.0/go.mod h1:2OQiDyEGQalYecLWmXprm3maPXeVb5/6/X7yRPYTzec= github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6 h1:teYtXy9B7y5lHTp8V9KPxpYRAVA7dozigQcMiBust1s= github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6/go.mod h1:p4lGIVX+8Wa6ZPNDvqcxq36XpUDLh42FLetFU7odllI= github.com/go-restruct/restruct v1.2.0-alpha h1:2Lp474S/9660+SJjpVxoKuWX09JsXHSrdV7Nv3/gkvc= github.com/go-restruct/restruct v1.2.0-alpha/go.mod h1:KqrpKpn4M8OLznErihXTGLlsXFGeLxHUrLRRI/1YjGk= -github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= -github.com/go-text/typesetting v0.0.0-20230803102845-24e03d8b5372/go.mod h1:evDBbvNR/KaVFZ2ZlDSOWWXIUKq0wCOEtzLxRM8SG3k= github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -845,7 +598,6 @@ github.com/godbus/dbus/v5 v5.2.0/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FP github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -853,11 +605,9 @@ github.com/gohugoio/hashstructure v0.6.0 h1:7wMB/2CfXoThFYhdWRGv3u3rUM761Cq29CxU github.com/gohugoio/hashstructure v0.6.0/go.mod h1:lapVLk9XidheHG1IQ4ZSbyYrXcaILU1ZEP/+vno5rBQ= github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -902,10 +652,8 @@ github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.29.0 h1:fEG+Ja3YRwNOqnQxTyJwoByAUAvTuxUGiro/jhrm4F4= github.com/google/cel-go v0.29.0/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= -github.com/google/go-cmdtest v0.4.0/go.mod h1:apVn/GCasLZUVpAJ6oWAuyP7Ne7CEsQbTnc0plM3m+o= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -926,16 +674,10 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/go-containerregistry v0.21.2 h1:vYaMU4nU55JJGFC9JR/s8NZcTjbE9DBBbvusTW9NeS0= github.com/google/go-containerregistry v0.21.2/go.mod h1:ctO5aCaewH4AK1AumSF5DPW+0+R+d2FmylMJdp5G7p0= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-intervals v0.0.2/go.mod h1:MkaR3LNRfeKLPmqgJYs4E66z5InYjmCjbbr4TQlcT6Y= -github.com/google/go-licenses v1.6.1-0.20230903011517-706b9c60edd4/go.mod h1:BUoZvAC+k4aLzq3+719tLz4jZum9m7lfwuXKtq8n5VM= -github.com/google/go-pkcs11 v0.3.0/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gops v0.3.28/go.mod h1:6f6+Nl8LcHrzJwi8+p0ii+vmBFSlB4f8cOOkTJ7sk4c= github.com/google/licensecheck v0.3.1 h1:QoxgoDkaeC4nFrtGN1jV7IPmDCHFNIVh54e5hSt6sPs= github.com/google/licensecheck v0.3.1/go.mod h1:ORkR35t/JjW+emNKtfJDII0zlciG9JgbT7SmsohlHmY= -github.com/google/licenseclassifier/v2 v2.0.0/go.mod h1:cOjbdH0kyC9R22sdQbYsFkto4NGCAc+ZSwbeThazEtM= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -962,10 +704,8 @@ github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0Z github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ= github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -989,7 +729,6 @@ github.com/gopacket/gopacket v1.5.0/go.mod h1:i3NaGaqfoWKAr1+g7qxEdWsmfT+MXuWkAe github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/goradd/maps v1.3.0 h1:toF7ALsgbjQBmmmRSACTAEO+9g2rApW8dU1WirFQyrE= github.com/goradd/maps v1.3.0/go.mod h1:O3i5k17BAjHa9h5dzGWWfRJizF03umiBDZsNSqFdbVA= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= @@ -1001,10 +740,6 @@ github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0/go.mod h1:qOchhhIlmRcqk/O9uCo/puJlyo07YINaIqdZfZG3Jkc= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= @@ -1024,10 +759,8 @@ github.com/hashicorp/go-getter v1.8.6 h1:9sQboWULaydVphxc4S64oAI4YqpuCk7nPmvbk13 github.com/hashicorp/go-getter v1.8.6/go.mod h1:nVH12eOV2P58dIiL3rsU6Fh3wLeJEKBOJzhMmzlSWoo= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= @@ -1035,9 +768,7 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -1052,7 +783,6 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl v1.0.1-vault-7/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= github.com/hashicorp/hcl/v2 v2.24.0 h1:2QJdZ454DSsYGoaE6QheQZjtKZSUs9Nh2izTWiwQxvE= github.com/hashicorp/hcl/v2 v2.24.0/go.mod h1:oGoO1FIQYfn/AgyOhlg9qLC6/nOJPX3qGbkZpYAcqfM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -1060,14 +790,10 @@ github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/terraform-plugin-log v0.10.0/go.mod h1:/9RR5Cv2aAbrqcTSdNmY1NRHP4E3ekrXRGjqORpXyB0= -github.com/hmarr/codeowners v1.2.1/go.mod h1:KPlR1p/B4owPjwfNIBueWlOP4CmqlQFX9b6nANG6j40= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -1075,7 +801,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= -github.com/ianlancetaylor/demangle v0.0.0-20250417193237-f615e6bd150b/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/iceber/iouring-go v0.0.0-20230403020409-002cfd2e2a90 h1:xrtfZokN++5kencK33hn2Kx3Uj8tGnjMEhdt6FMvHD0= github.com/iceber/iouring-go v0.0.0-20230403020409-002cfd2e2a90/go.mod h1:LEzdaZarZ5aqROlLIwJ4P7h3+4o71008fSy6wpaEB+s= github.com/in-toto/attestation v1.1.2 h1:MBFn6lsMq6dptQZJBhalXTcWMb/aJy3V+GX3VYj/V1E= @@ -1085,9 +810,6 @@ github.com/in-toto/in-toto-golang v0.11.0/go.mod h1:u3PjTnwFKjp5a1YCcw8SJg0G+tMe github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/intel/goresctrl v0.5.0/go.mod h1:mIe63ggylWYr0cU/l8n11FAkesqfvuP3oktIsxvu0T0= -github.com/invopop/jsonschema v0.7.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0= -github.com/ishidawataru/sctp v0.0.0-20230406120618-7ff4192f6ff2/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -1102,27 +824,21 @@ github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh6 github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/jedib0t/go-pretty/v6 v6.6.8/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/jeremywohl/flatten v1.0.1/go.mod h1:4AmD/VxjWcI5SRB0n6szE2A6s2fsNHDLO0nAlMHgfLQ= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60= github.com/joncrlsn/dque v0.0.0-20241024143830-7723fd131a64 h1:fmH2K7R8pZJ0wVvJyGFmDnECuAE3NLjfAoJkN9mtfc8= github.com/joncrlsn/dque v0.0.0-20241024143830-7723fd131a64/go.mod h1:dNKs71rs2VJGBAmttu7fouEsRQlRjxy0p1Sx+T5wbpY= -github.com/josephspurrier/goversioninfo v1.5.0/go.mod h1:6MoTvFZ6GKJkzcdLnU5T/RGYUbHQbKpYeNP0AgQLd2o= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/josharian/native v0.0.0-20200817173448-b6b71def0850/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= github.com/jsimonetti/rtnetlink v0.0.0-20201009170750-9c6f07d100c1/go.mod h1:hqoO/u39cqLeBLebZ8fWdE96O7FxrAsRYhnVOdgHxok= @@ -1143,13 +859,10 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s= github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953 h1:WdAeg/imY2JFPc/9CST4bZ80nNJbiBFCAdSZCSgrS5Y= github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953/go.mod h1:6o+UrvuZWc4UTyBhQf0LGjW9Ld7qJxLz/OqvSOWWlEc= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= github.com/kinbiko/jsonassert v1.2.0 h1:+/JthIVXdIrThrOtSN9ry0mNtWKXMWuvxR0nU7gQ+tI= github.com/kinbiko/jsonassert v1.2.0/go.mod h1:pCc3uudOt+lVAbkji9O0uw8MSVt4s+1ZJ0y8Ux2F1Og= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -1162,9 +875,6 @@ github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzh github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f/go.mod h1:q59u9px8b7UTj0nIjEjvmTWekazka6xIt6Uogz5Dm+8= -github.com/knqyf263/go-deb-version v0.0.0-20241115132648-6f4aee6ccd23/go.mod h1:lUaIXCWzf7BRKTY5iEcrYy1TfgbYLYVIS/B2vPkJzOc= -github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -1187,10 +897,6 @@ github.com/kubescape/inspektor-gadget v0.0.0-20260826074832-06b0d12baca0 h1:kJzq github.com/kubescape/inspektor-gadget v0.0.0-20260826074832-06b0d12baca0/go.mod h1:cwCFczq1LJ6Frpur0Vr5Ncic77a9ihki07Xpwzy+ItI= github.com/kubescape/k8s-interface v0.0.214 h1:j7KP0/5VvYOoQdBGV2+gRM3qnR8PWLAGF8RM/k/DmJ0= github.com/kubescape/k8s-interface v0.0.214/go.mod h1:WNYUG93aZ5kDmuaRKFLtVhp18Yc6EfaHdD1gLYtVTN4= -github.com/kubescape/kubescape/v3 v3.0.4/go.mod h1:upPCVTCRT3+LuZ1bawGtjreRmr/Xa+LT0fHtPzlylRU= -github.com/kubescape/opa-utils v0.0.283/go.mod h1:N/UnbZHpoiHQH7O50yadhIXZvVl0IVtTGBmePPrSQSg= -github.com/kubescape/rbac-utils v0.0.21-0.20230806101615-07e36f555520/go.mod h1:wuxMUSDzGUyWd25IJfBzEJ/Udmw2Vy7npj+MV3u3GrU= -github.com/kubescape/regolibrary v1.0.317-0.20240320124840-1d84ac7186ea/go.mod h1:RK9dHjllKFnISDmVExQlI1B1z93TlQsAu/Kq9c0mt2U= github.com/kubescape/storage v0.0.303 h1:0nXI6E07lbWsg7iEH04vR4kwiekj//uCQl/La+8j4aM= github.com/kubescape/storage v0.0.303/go.mod h1:d/1hqWPda2clsjx2wmQgysnB5dThIo3rDKP7RWx+v+M= github.com/kubescape/syft v1.32.0-ks.2 h1:xdUksUmKEyyVKsTfJDYW8Z5HawVJtelsUolPOsWtDx0= @@ -1200,28 +906,16 @@ github.com/kubescape/workerpool v0.0.0-20250526074519-0e4a4e7f44cf/go.mod h1:Il5 github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= -github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= -github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= -github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= -github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= -github.com/lestrrat-go/jwx v1.2.29/go.mod h1:hU8k2l6WF0ncx20uQdOmik/Gjg6E3/wIRtXSNFeZuB8= -github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/letsencrypt/boulder v0.20251110.0/go.mod h1:ogKCJQwll82m7OVHWyTuf8eeFCjuzdRQlgnZcCl0V+8= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lthibault/jitterbug/v2 v2.2.2/go.mod h1:evaHKX+60nFbFnEvGNPybQMJ5vXay9auziApDGo47Sw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/lyft/protoc-gen-star/v2 v2.0.4/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/mackerelio/go-osstat v0.2.5 h1:+MqTbZUhoIt4m8qzkVoXUJg1EuifwlAJSk4Yl2GXh+o= github.com/mackerelio/go-osstat v0.2.5/go.mod h1:atxwWF+POUZcdtR1wnsUcQxTytoHG4uhl2AKKzrOajY= -github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -1229,9 +923,6 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= -github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= -github.com/masahiro331/go-mvn-version v0.0.0-20250131095131-f4974fa13b8a/go.mod h1:jZ3F25l7DbD7l7DcA8aj7eo1EZ84nbzcQHBB4lCSrI8= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -1251,15 +942,9 @@ github.com/mattn/go-localereader v0.0.2-0.20220822084749-2491eb6c1c75 h1:P8UmIzZ github.com/mattn/go-localereader v0.0.2-0.20220822084749-2491eb6c1c75/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mdlayher/arp v0.0.0-20220512170110-6706a2966875/go.mod h1:kfOoFJuHWp76v1RgZCb9/gVUc7XdY877S2uVYbNliGc= -github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118/go.mod h1:ZFUnHIVchZ9lJoWoEGUg8Q3M4U8aNNWA3CVSUTkW4og= github.com/mdlayher/ethtool v0.0.0-20210210192532-2b88debcdd43/go.mod h1:+t7E0lkKfbBsebllff1xdTmyJt8lH37niI6kwFk9OTo= github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= -github.com/mdlayher/genetlink v1.3.2/go.mod h1:tcC3pkCrPUGIKKsCsp0B3AdaaKuHtaxoJRz3cc+528o= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= @@ -1273,12 +958,10 @@ github.com/mdlayher/netlink v1.4.1/go.mod h1:e4/KuJ+s8UhfUpO9z00/fDZZmhSrs+oxyqA github.com/mdlayher/netlink v1.6.0/go.mod h1:0o3PlBmGst1xve7wQ7j/hwpNaFaH4qCRyWCdcZk8/vA= github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g= github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= -github.com/mdlayher/packet v1.1.2/go.mod h1:GEu1+n9sG5VtiRE4SydOmX5GTwyyYlteZiFU+x0kew4= github.com/mdlayher/socket v0.0.0-20210307095302-262dc9984e00/go.mod h1:GAFlyu4/XV68LkQKYzKhIo/WW7j3Zi0YRAz/BOoanUc= github.com/mdlayher/socket v0.1.1/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs= github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos= github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ= -github.com/mdlayher/vsock v1.2.1/go.mod h1:NRfCibel++DgeMD8z/hP+PPTjlNJsdPOmxcnENvE+SE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mholt/archives v0.1.5 h1:Fh2hl1j7VEhc6DZs2DLMgiBNChUux154a1G+2esNvzQ= @@ -1287,21 +970,16 @@ github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00v github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= -github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mikelolasagasti/xz v1.0.1 h1:Q2F2jX0RYJUG3+WsM+FJknv+6eVjsjXNDV0KJXZzkD0= github.com/mikelolasagasti/xz v1.0.1/go.mod h1:muAirjiOUxPRXwm9HdDtB3uoRPrGnL85XHtokL9Hcgc= github.com/minio/minlz v1.0.1 h1:OUZUzXcib8diiX+JYxyRLIdomyZYzHct6EShOKtQY2A= github.com/minio/minlz v1.0.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= -github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= -github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -1329,7 +1007,6 @@ github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7z github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= github.com/moby/sys/signal v0.7.1 h1:PrQxdvxcGijdo6UXXo/lU/TvHUWyPhj7UOpSo8tuvk0= github.com/moby/sys/signal v0.7.1/go.mod h1:Se1VGehYokAkrSQwL4tDzHvETwUZlnY7S5XtQ50mQp8= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= @@ -1346,22 +1023,17 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= -github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= @@ -1387,8 +1059,6 @@ github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9l github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/nwaples/rardecode/v2 v2.2.0 h1:4ufPGHiNe1rYJxYfehALLjup4Ls3ck42CWwjKiOqu0A= github.com/nwaples/rardecode/v2 v2.2.0/go.mod h1:7uz379lSxPe6j9nvzxUZ+n7mnJNgjsRNb6IbvGVHRmw= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM= @@ -1397,11 +1067,9 @@ github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI= github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g= github.com/olekukonko/tablewriter v1.0.9 h1:XGwRsYLC2bY7bNd93Dk51bcPZksWZmLYuaTHR0FqfL8= github.com/olekukonko/tablewriter v1.0.9/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo= -github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0/go.mod h1:F/7q8/HZz+TXjlsoZQQKVYvXTZaFH4QRa3y+j1p7MS0= github.com/olvrng/ujson v1.1.0 h1:8xVUzVlqwdMVWh5d1UHBtLQ1D50nxoPuPEq9Wozs8oA= github.com/olvrng/ujson v1.1.0/go.mod h1:Mz4G3RODTUfbkKyvi0lgmPx/7vd3Saksk+1jgk8s9xo= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns= github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= @@ -1410,13 +1078,10 @@ github.com/opcoder0/capabilities v0.0.0-20221222060822-17fd73bffd2a h1:sbMMqulR2 github.com/opcoder0/capabilities v0.0.0-20221222060822-17fd73bffd2a/go.mod h1:77JxdABQ4m37PtO4WMtRBrI+DDphomu/8tGeijYXspk= github.com/opcoder0/fanotify v0.4.2 h1:Bp7h8scp/LNoWmC16Z1kf7GfxehhQLcDPxqJ31+SThs= github.com/opcoder0/fanotify v0.4.2/go.mod h1:S0LITNqjkZwifQ+0qB1fT1S/SmDmnFH+h0SLBzoKW2Q= -github.com/open-policy-agent/opa v0.70.0/go.mod h1:Y/nm5NY0BX0BqjBriKUiV81sCl8XOjjvqQG7dXrggtI= -github.com/opencontainers/cgroups v0.0.4/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= -github.com/opencontainers/runc v1.3.0/go.mod h1:9wbWt42gV+KRxKRVVugNP6D5+PQciRbenB4fLVsqGPs= github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww= github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116 h1:tAKu3NkKWZYpqBSOJKwTxT1wIGueiF7gcmcNgr5pNTY= @@ -1427,7 +1092,6 @@ github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:Ff github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= -github.com/osrg/gobgp/v3 v3.35.0/go.mod h1:l2nPaHaLmIoKbFxMUzKon/h6c9BTzCp5zJI9Dhnrx5c= github.com/packetcap/go-pcap v0.0.0-20250723190045-d00b185f30b7 h1:MfXxQU9tEe3zmyLVVwE8gJwQVtsG2aqzBkFNz0N6eAo= github.com/packetcap/go-pcap v0.0.0-20250723190045-d00b185f30b7/go.mod h1:1jryUz9E2ndKwZBNHzVhLMzS3WHO0fOKydYi9XWWu9w= github.com/panjf2000/ants/v2 v2.11.3 h1:AfI0ngBoXJmYOpDh9m516vjqoUu2sLrIVgppI9TZVpg= @@ -1446,14 +1110,12 @@ github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43 h1:ah1dvbqPMN5+ocrg/ZSgZ6k8bOk+kcZQ7fnyx6UvOm4= github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/picatz/xcel v0.0.0-20260226001349-6958ffac5706 h1:xfPEUCHSHcjpu4WxgtC1lwBkP4Xa7R/pl8sXVF103Yg= github.com/picatz/xcel v0.0.0-20260226001349-6958ffac5706/go.mod h1:bFTXcuU+280rICoGMpVTk/06XNfgvfeplhjWWoLKPys= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pjbgf/sha1cd v0.6.0 h1:3WJ8Wz8gvDz29quX1OcEmkAlUg9diU4GxJHqs0/XiwU= github.com/pjbgf/sha1cd v0.6.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -1461,7 +1123,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pkg/sftp v1.13.9/go.mod h1:OBN7bVXdstkFFN/gdnHPUb5TE8eb8G1Rp9wCItqjkkA= github.com/pkg/xattr v0.4.12 h1:rRTkSyFNTRElv6pkA3zpjHpQ90p/OdHQC1GmGh1aTjM= github.com/pkg/xattr v0.4.12/go.mod h1:di8WF84zAKk8jzR1UBTEWh9AUlIZZ7M/JNt8e9B6ktU= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= @@ -1471,9 +1132,6 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= -github.com/proglottis/gpgme v0.1.4/go.mod h1:5LoXMgpE4bttgwwdv9bLs/vwqv3qV7F4glEEZ7mRKrM= -github.com/prometheus-community/pro-bing v0.5.0/go.mod h1:1joR9oXdMEAcAJJvhs+8vNDvTg5thfAZcRFhcUozG2g= github.com/prometheus/alertmanager v0.27.0 h1:V6nTa2J5V4s8TG4C4HtrBP/WNSebCCTYGGv4qecA/+I= github.com/prometheus/alertmanager v0.27.0/go.mod h1:8Ia/R3urPmbzJ8OsdvmZvIprDwvwmYCmUbwBL+jlPOE= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1493,9 +1151,6 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= -github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI= -github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= -github.com/prometheus/exporter-toolkit v0.11.0/go.mod h1:BVnENhnNecpwoTLiABx7mrPB/OLRIgN74qlQbV+FK1Q= github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEoIwkU+A6qos= github.com/prometheus/otlptranslator v1.0.0/go.mod h1:vRYWnXvI6aWGpsdY/mOT/cbeVRBlPWtBNDb7kGR3uKM= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1504,11 +1159,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= -github.com/prometheus/prom2json v1.3.2/go.mod h1:TQ9o1OxW0eyhl4BBpVpGGsavyJfTDETna4/d0Kib+V0= github.com/puzpuzpuz/xsync/v2 v2.4.1 h1:aGdE1C/HaR/QC6YAFdtZXi60Df8/qBIrs8PKrzkItcM= github.com/puzpuzpuz/xsync/v2 v2.4.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU= -github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -1519,13 +1171,10 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rust-secure-code/go-rustaudit v0.0.0-20250226111315-e20ec32e963c h1:8gOLsYwaY2JwlTMT4brS5/9XJdrdIbmk2obvQ748CC0= github.com/rust-secure-code/go-rustaudit v0.0.0-20250226111315-e20ec32e963c/go.mod h1:kwM/7r/rVluTE8qJbHAffduuqmSv4knVQT2IajGvSiA= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/s3rj1k/go-fanotify/fanotify v0.0.0-20240229202106-bca3154da60a h1:4VFls9SuqkqeioVevnaeTXrYKQ7JiEsxqKHfxp+/ovA= @@ -1533,14 +1182,12 @@ github.com/s3rj1k/go-fanotify/fanotify v0.0.0-20240229202106-bca3154da60a/go.mod github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA= github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= github.com/sanity-io/litter v1.5.8 h1:uM/2lKrWdGbRXDrIq08Lh9XtVYoeGtcQxk9rtQ7+rYg= github.com/sanity-io/litter v1.5.8/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= -github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sassoftware/go-rpmutils v0.4.0 h1:ojND82NYBxgwrV+mX1CWsd5QJvvEZTKddtCdFLPWhpg= @@ -1576,7 +1223,6 @@ github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9A github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= @@ -1585,9 +1231,7 @@ github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5J github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= -github.com/sigstore/fulcio v1.6.6/go.mod h1:BhQ22lwaebDgIxVBEYOOqLRcN5+xOV+C9bh/GUXRhOk= github.com/sigstore/protobuf-specs v0.5.0 h1:F8YTI65xOHw70NrvPwJ5PhAzsvTnuJMGLkA4FIkofAY= github.com/sigstore/protobuf-specs v0.5.0/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc= github.com/sigstore/sigstore v1.10.4 h1:ytOmxMgLdcUed3w1SbbZOgcxqwMG61lh1TmZLN+WeZE= @@ -1599,8 +1243,6 @@ github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/smallstep/pkcs7 v0.1.1/go.mod h1:dL6j5AIz9GHjVEBTXtW+QliALcgM19RtXaTeyxI+AfA= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sorairolake/lzip-go v0.3.8 h1:j5Q2313INdTA80ureWYRhX+1K78mUXfMoPZCw/ivWik= github.com/sorairolake/lzip-go v0.3.8/go.mod h1:JcBqGMV0frlxwrsE9sMWXDjqn3EeVf0/54YPsw66qkU= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= @@ -1608,7 +1250,6 @@ github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrel github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM= github.com/spdx/gordf v0.0.0-20250128162952-000978ccd6fb h1:7G2Czq97VORM5xNRrD8tSQdhoXPRs8s+Otlc7st9TS0= github.com/spdx/gordf v0.0.0-20250128162952-000978ccd6fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM= @@ -1634,9 +1275,6 @@ github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= -github.com/spiffe/spire-api-sdk v1.11.1/go.mod h1:4uuhFlN6KBWjACRP3xXwrOTNnvaLp1zJs8Lribtr4fI= -github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6/go.mod h1:39R/xuhNgVhi+K0/zst4TLrJrVmbm6LVgl4A0+ZFS5M= -github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -1665,24 +1303,11 @@ github.com/sylabs/sif/v2 v2.24.0 h1:1wB5uMDUQYjk8AckTySaDcP9YnpMb1LyDRr1Jt9A10w= github.com/sylabs/sif/v2 v2.24.0/go.mod h1:DbXWqWZ1hdLSU+K9ipdds5AmZeHWsyxCOj/oQakBa88= github.com/sylabs/squashfs v1.0.6 h1:PvJcDzxr+vIm2kH56mEMbaOzvGu79gK7P7IX+R7BDZI= github.com/sylabs/squashfs v1.0.6/go.mod h1:DlDeUawVXLWAsSRa085Eo0ZenGzAB32JdAUFaB0LZfE= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/tchap/go-patricia/v2 v2.3.3/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/terminalstatic/go-xsd-validate v0.1.6 h1:TenYeQ3eY631qNi1/cTmLH/s2slHPRKTTHT+XSHkepo= github.com/terminalstatic/go-xsd-validate v0.1.6/go.mod h1:18lsvYFofBflqCrvo1umpABZ99+GneNTw2kEEc8UPJw= -github.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU= github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw= github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY= -github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= -github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/tink-crypto/tink-go/v2 v2.5.0/go.mod h1:2WbBA6pfNsAfBwDCggboaHeB2X29wkU8XHtGwh2YIk8= -github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs= -github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= -github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= @@ -1693,13 +1318,10 @@ github.com/uptrace/opentelemetry-go-extra/otelzap v0.3.2 h1:cj/Z6FKTTYBnstI0Lni9 github.com/uptrace/opentelemetry-go-extra/otelzap v0.3.2/go.mod h1:LDaXk90gKEC2nC7JH3Lpnhfu+2V7o/TsqomJJmqA39o= github.com/uptrace/uptrace-go v1.43.0 h1:5QuCdyFJdWUEXx6Fr6sYfezdgO6n6lnkOvUTLlyQO7U= github.com/uptrace/uptrace-go v1.43.0/go.mod h1:ehDTIdtBSolg4Z0CCvg1C8yR6VX1YFDqBcg2KmsXWn0= -github.com/urfave/cli v1.22.16/go.mod h1:EeJR6BKodywf4zciqrdw6hpCPk68JO9z5LazXZMn5Po= -github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= github.com/vbatts/go-mtree v0.5.4 h1:OMAb8jaCyiFA7zXj0Zc/oARcxBDBoeu2LizjB8BVJl0= github.com/vbatts/go-mtree v0.5.4/go.mod h1:5GqJbVhm9BBiCc4K5uc/c42FPgXulHaQs4sFUEfIWMo= github.com/vbatts/tar-split v0.12.2 h1:w/Y6tjxpeiFMR47yzZPlPj/FcPLpXbTUi/9H7d3CPa4= github.com/vbatts/tar-split v0.12.2/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= -github.com/vbauerster/mpb/v8 v8.10.2/go.mod h1:+Ja4P92E3/CorSZgfDtK46D7AVbDqmBQRTmyTqPElo0= github.com/veraison/go-cose v1.3.0 h1:2/H5w8kdSpQJyVtIhx8gmwPJ2uSz1PkyWFx0idbd7rk= github.com/veraison/go-cose v1.3.0/go.mod h1:df09OV91aHoQWLmy1KsDdYiagtXgyAwAl8vFeFn1gMc= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= @@ -1710,8 +1332,6 @@ github.com/vishvananda/netlink v1.3.1 h1:3AEMt62VKqz90r0tmNhog0r/PpWKmrEShJU0wJW github.com/vishvananda/netlink v1.3.1/go.mod h1:ARtKouGSTGchR8aMwmkzC0qiNPrrWO5JS/XMVl45+b4= github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY= github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 h1:jIVmlAFIqV3d+DOxazTR9v+zgj8+VYuQBzPgBZvWBHA= github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651/go.mod h1:b26F2tHLqaoRQf8DywqzVaV1MQ9yvjb0OMcNl7Nxu20= github.com/wagoodman/go-progress v0.0.0-20260303201901-10176f79b2c0 h1:EHsPe0Q0ANoLOZff1dBLAyeWLTA4sbPTpGI+2zb0FnM= @@ -1722,35 +1342,22 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= -github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= -github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -github.com/yashtewari/glob-intersection v0.2.0/go.mod h1:LK7pIC3piUjovexikBbJ26Yml7g8xa5bsjfx2v1fwok= github.com/yl2chen/cidranger v1.0.2 h1:lbOWZVCG1tCRX4u24kuM1Tb4nHqWkDxwLdoS+SevawU= github.com/yl2chen/cidranger v1.0.2/go.mod h1:9U1yz7WPYDwf0vpNWFaeRh0bjwz5RVgRy/9UEQfHl0g= -github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= -github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns= -github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18= -github.com/ysmood/got v0.40.0/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg= -github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg= -github.com/ysmood/leakless v0.9.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1761,21 +1368,11 @@ github.com/zclconf/go-cty v1.16.3 h1:osr++gw2T61A8KVYHoQiFbFd1Lh3JOCXc/jFLJXKTxk github.com/zclconf/go-cty v1.16.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= -github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= -github.com/zyedidia/generic v1.2.2-0.20230320175451-4410d2372cb1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis= -go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.6.5/go.mod h1:ob0/oWA/UQQlT1BmaEkWQzI0sJ1M0Et0mMpaABxguOQ= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.6.5/go.mod h1:8Wx3eGRPiy0qOFMZT/hfvdos+DjEaPxdIDiCDUv/FQk= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.etcd.io/etcd/client/v3 v3.6.5/go.mod h1:ZqwG/7TAFZ0BJ0jXRPoJjKQJtbFo/9NIY8uoFFKcCyo= -go.etcd.io/etcd/pkg/v3 v3.6.5/go.mod h1:uqrXrzmMIJDEy5j00bCqhVLzR5jEJIwDp5wTlLwPGOU= -go.etcd.io/etcd/server/v3 v3.6.5/go.mod h1:PLuhyVXz8WWRhzXDsl3A3zv/+aK9e4A9lpQkqawIaH0= -go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo= go.mongodb.org/mongo-driver v1.17.7 h1:a9w+U3Vt67eYzcfq3k/OAv284/uUUkL0uP75VE5rCOU= go.mongodb.org/mongo-driver v1.17.7/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -1792,7 +1389,6 @@ go.opentelemetry.io/contrib/bridges/otelslog v0.18.0 h1:hhPGP3zvvy1xWT9RTy970wln go.opentelemetry.io/contrib/bridges/otelslog v0.18.0/go.mod h1:twJF7inoMza6kxMcF8JOdL3mPmtOZu7GEr34CUNE6Dg= go.opentelemetry.io/contrib/detectors/gcp v1.43.0 h1:62yY3dT7/ShwOxzA0RsKRgshBmfElKI4d/Myu2OxDFU= go.opentelemetry.io/contrib/detectors/gcp v1.43.0/go.mod h1:RyaZMFY7yi1kAs45S6mbFGz8O8rqB0dTY14uzvG4LCs= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.67.0/go.mod h1:xOd0/OgHjAtW47zPn48sC7n/pUxunDQfDc9qG3ZtSn0= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= @@ -1807,7 +1403,6 @@ go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0 h1:Dn8rkudDz go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0/go.mod h1:gMk9F0xDgyN9M/3Ed5Y1wKcx/9mlU91NXY2SNq7RQuU= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.19.0 h1:HIBTQ3VO5aupLKjC90JgMqpezVXwFuq6Ryjn0/izoag= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.19.0/go.mod h1:ji9vId85hMxqfvICA0Jt8JqEdrXaAkcpkI9HPXya0ro= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.41.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0 h1:8UQVDcZxOJLtX6gxtDt3vY2WTgvZqMQRzjsqiIHQdkc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0/go.mod h1:2lmweYCiHYpEjQ/lSJBYhj9jP1zvCvQW4BqL9dnT7FQ= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.43.0 h1:w1K+pCJoPpQifuVpsKamUdn9U0zM3xUziVOqsGksUrY= @@ -1844,12 +1439,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= -go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -1899,8 +1490,6 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= -golang.org/x/exp/shiny v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358/go.mod h1:4Mzdyp/6jzw9auFDJ3OMF5qksa7UvPnzKqTVGcb04ms= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.41.0 h1:8wS72eGJMJaBxK6okTzd4WaXumUlTVlb753MlsSvTCo= @@ -2142,7 +1731,6 @@ golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/telemetry v0.0.0-20260625142307-59b4966ccb57/go.mod h1:3AWMyWHS+caVoiEXpiq6+tzKA40J4vQT3MYr80ZtQpc= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -2238,17 +1826,12 @@ golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58 golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= -golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= -golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA= -golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6/go.mod h1:3rxYc4HtVcSG9gVaTs2GEBdehh+sYPOwKtyUWEOTb80= -gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE= @@ -2299,7 +1882,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -2371,7 +1953,6 @@ google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 h1:VQZ/yAbAtjkHgH8 google.golang.org/genproto v0.0.0-20260128011058-8636f8732409/go.mod h1:rxKD3IEILWEu3P44seeNOAwZN4SaoKaQ/2eTg4mM6EM= google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 h1:yQugLulqltosq0B/f8l4w9VryjV+N/5gcW0jQ3N8Qec= google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478/go.mod h1:C6ADNqOxbgdUUeRTU+LCHDPB9ttAMCTff6auwCVa4uc= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20260226221140-a57be14db171/go.mod h1:9amqk/8LQWEC4RjyUxMx1DebyQ7hZB9gvl67bHmgZ2E= google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 h1:RmoJA1ujG+/lRGNfUnOMfhCy5EipVMyvUE+KNbPbTlw= google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -2407,8 +1988,6 @@ google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= -google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6/go.mod h1:6ytKWczdvnpnO+m+JiG9NjEDzR1FJfsnmJdG7B8QVZ8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2431,20 +2010,14 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo= gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= -gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mcuadros/go-syslog.v2 v2.3.0 h1:kcsiS+WsTKyIEPABJBJtoG0KkOS6yzvJ+/eZlhD79kk= gopkg.in/mcuadros/go-syslog.v2 v2.3.0/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/telebot.v3 v3.2.1/go.mod h1:GJKwwWqp9nSkIVN51eRKU78aB5f5OnQuWdwiIZfPbko= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2471,7 +2044,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc= istio.io/pkg v0.0.0-20231221211216-7635388a563e h1:ZlLVbKDlCzfP0MPbWc6VRcY23d9NdjLxwpPQpDrh3Gc= istio.io/pkg v0.0.0-20231221211216-7635388a563e/go.mod h1:fvmqEdHhZjYYwf6dSiIwvwc7db54kMWVTfsb91KmhzY= k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY= @@ -2486,27 +2058,20 @@ k8s.io/cli-runtime v0.35.0 h1:PEJtYS/Zr4p20PfZSLCbY6YvaoLrfByd6THQzPworUE= k8s.io/cli-runtime v0.35.0/go.mod h1:VBRvHzosVAoVdP3XwUQn1Oqkvaa8facnokNkD7jOTMY= k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE= k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o= -k8s.io/code-generator v0.35.0/go.mod h1:iS1gvVf3c/T71N5DOGYO+Gt3PdJ6B9LYSvIyQ4FHzgc= k8s.io/component-base v0.35.0 h1:+yBrOhzri2S1BVqyVSvcM3PtPyx5GUxCK2tinZz1G94= k8s.io/component-base v0.35.0/go.mod h1:85SCX4UCa6SCFt6p3IKAPej7jSnF3L8EbfSyMZayJR0= -k8s.io/component-helpers v0.34.1/go.mod h1:4VgnUH7UA/shuBur+OWoQC0xfb69sy/93ss0ybZqm3c= k8s.io/cri-api v0.35.0 h1:fxLSKyJHqbyCSUsg1rW4DRpmjSEM/elZ1GXzYTSLoDQ= k8s.io/cri-api v0.35.0/go.mod h1:Cnt29u/tYl1Se1cBRL30uSZ/oJ5TaIp4sZm1xDLvcMc= -k8s.io/endpointslice v0.32.13/go.mod h1:HRXxLyYXerC2cJCATXberX+bMYjonh6hMaq9HbLkAGg= -k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b/go.mod h1:CgujABENc3KuTrcsdpGmrrASjtQsWCT7R99mEV4U/fM= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.35.0/go.mod h1:VT+4ekZAdrZDMgShK37vvlyHUVhwI9t/9tvh0AyCWmQ= k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE= k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= k8s.io/kubectl v0.34.1 h1:1qP1oqT5Xc93K+H8J7ecpBjaz511gan89KO9Vbsh/OI= k8s.io/kubectl v0.34.1/go.mod h1:JRYlhJpGPyk3dEmJ+BuBiOB9/dAvnrALJEiY/C5qa6A= k8s.io/kubelet v0.35.0 h1:8cgJHCBCKLYuuQ7/Pxb/qWbJfX1LXIw7790ce9xHq7c= k8s.io/kubelet v0.35.0/go.mod h1:ciRzAXn7C4z5iB7FhG1L2CGPPXLTVCABDlbXt/Zz8YA= -k8s.io/metrics v0.34.1/go.mod h1:Drf5kPfk2NJrlpcNdSiAAHn/7Y9KqxpRNagByM7Ei80= k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM= k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= -lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis= modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= modernc.org/ccgo/v4 v4.30.1 h1:4r4U1J6Fhj98NKfSjnPUN7Ze2c6MnAdL0hWw6+LrJpc= @@ -2538,29 +2103,20 @@ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= oras.land/oras-go/v2 v2.6.2 h1:N04RXngAp1LJKTG6ifz3xHPipasEkWr+hFmInja5YKo= oras.land/oras-go/v2 v2.6.2/go.mod h1:PlTtg4JTDJkDe8yVHpM2wz7/YDc00GVas+i4jAW2TZ4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/goversion v1.2.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM= -sigs.k8s.io/controller-tools v0.16.5/go.mod h1:8vztuRVzs8IuuJqKqbXCSlXcw+lkAv/M2sTpg55qjMY= -sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kustomize/api v0.20.1 h1:iWP1Ydh3/lmldBnH/S5RXgT98vWYMaTUL1ADcr+Sv7I= sigs.k8s.io/kustomize/api v0.20.1/go.mod h1:t6hUFxO+Ph0VxIk1sKp1WS0dOjbPCtLJ4p8aADLwqjM= -sigs.k8s.io/kustomize/kustomize/v5 v5.7.1/go.mod h1:+5/SrBcJ4agx1SJknGuR/c9thwRSKLxnKoI5BzXFaLU= sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A78= sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po= -sigs.k8s.io/mcs-api v0.1.1-0.20250116162235-62ede9a032dc/go.mod h1:Uicqc5FnWP4dco2y7+AEg2mzNN20mVX1TDB3aDfmvhc= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/release-utils v0.11.1/go.mod h1:ybR2V/uQAOGxYfzYtBenSYeXWkBGNP2qnEiX77ACtpc= -sigs.k8s.io/security-profiles-operator v0.9.1/go.mod h1:p2ErLS2eMxazGk3VU17CvZxXth95m7tsTk/bOUexS4k= -sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco= sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= @@ -2568,7 +2124,5 @@ sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= -tags.cncf.io/container-device-interface v1.0.1/go.mod h1:JojJIOeW3hNbcnOH2q0NrWNha/JuHoDZcmYxAZwb2i0= -tags.cncf.io/container-device-interface/specs-go v0.8.0/go.mod h1:BhJIkjjPh4qpys+qm4DAYtUyryaTDg9zris+AczXyws= zombiezen.com/go/sqlite v1.4.0 h1:N1s3RIljwtp4541Y8rM880qgGIgq3fTD2yks1xftnKU= zombiezen.com/go/sqlite v1.4.0/go.mod h1:0w9F1DN9IZj9AcLS9YDKMboubCACkwYCGkzoy3eG5ik= diff --git a/pkg/cloudmetadata/metadata.go b/pkg/cloudmetadata/metadata.go index 3d31c01a4a..33a8dd45d3 100644 --- a/pkg/cloudmetadata/metadata.go +++ b/pkg/cloudmetadata/metadata.go @@ -83,11 +83,11 @@ func parseAzureResourceGroup(providerID string) string { } start := idx + len(marker) rest := providerID[start:] - end := strings.Index(rest, "/") - if end == -1 { + before, _, ok := strings.Cut(rest, "/") + if !ok { return rest } - return rest[:end] + return before } // GetCloudMetadataWithIMDS retrieves cloud metadata for a given node using IMDS diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9b2b9ea210..f22ed4bb24 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -720,12 +720,12 @@ func TestLoadConfig_BypassSkipsSlotsExponentValidation(t *testing.T) { func TestConfig_IsMetricsEnabled(t *testing.T) { tests := []struct { - name string - enableMetricsExporter bool - otelMetricsExporter string - otelOtlpEndpoint string + name string + enableMetricsExporter bool + otelMetricsExporter string + otelOtlpEndpoint string otelOtlpMetricsEndpoint string - want bool + want bool }{ { name: "default disabled", diff --git a/pkg/containerprofilemanager/v1/container_data_test.go b/pkg/containerprofilemanager/v1/container_data_test.go index 0fa7703969..57d0f52776 100644 --- a/pkg/containerprofilemanager/v1/container_data_test.go +++ b/pkg/containerprofilemanager/v1/container_data_test.go @@ -58,39 +58,39 @@ func (c *servicePortTestClient) GetDynamicClient() dynamic.Interface { return nil } -func newServiceWorkload(name string, selector map[string]interface{}, ports ...map[string]interface{}) k8sinterface.IWorkload { - portEntries := make([]interface{}, 0, len(ports)) +func newServiceWorkload(name string, selector map[string]any, ports ...map[string]any) k8sinterface.IWorkload { + portEntries := make([]any, 0, len(ports)) for _, port := range ports { portEntries = append(portEntries, port) } - return workloadinterface.NewWorkloadObj(map[string]interface{}{ + return workloadinterface.NewWorkloadObj(map[string]any{ "apiVersion": "v1", "kind": "Service", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": name, "namespace": "default", }, - "spec": map[string]interface{}{ + "spec": map[string]any{ "selector": selector, "ports": portEntries, }, }) } -func newEndpointsWorkload(name string, ports ...map[string]interface{}) k8sinterface.IWorkload { - portEntries := make([]interface{}, 0, len(ports)) +func newEndpointsWorkload(name string, ports ...map[string]any) k8sinterface.IWorkload { + portEntries := make([]any, 0, len(ports)) for _, port := range ports { portEntries = append(portEntries, port) } - return workloadinterface.NewWorkloadObj(map[string]interface{}{ + return workloadinterface.NewWorkloadObj(map[string]any{ "apiVersion": "v1", "kind": "Endpoints", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": name, "namespace": "default", }, - "subsets": []interface{}{ - map[string]interface{}{ + "subsets": []any{ + map[string]any{ "ports": portEntries, }, }, @@ -99,12 +99,10 @@ func newEndpointsWorkload(name string, ports ...map[string]interface{}) k8sinter func newEndpointSlice(name, serviceName string, ports ...discoveryv1.EndpointPort) *discoveryv1.EndpointSlice { return &discoveryv1.EndpointSlice{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: "default", - Labels: map[string]string{ - discoveryv1.LabelServiceName: serviceName, - }, + Name: name, + Namespace: "default", + Labels: map[string]string{ + discoveryv1.LabelServiceName: serviceName, }, Ports: ports, } @@ -134,7 +132,7 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }{ { name: "numeric remap", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "port": 80, "targetPort": 8080, "protocol": "TCP", }), event: serviceNetworkEvent(80, "tcp"), @@ -142,7 +140,7 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "unchanged when port equals targetPort", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "port": 8080, "targetPort": 8080, "protocol": "TCP", }), event: serviceNetworkEvent(8080, "tcp"), @@ -150,7 +148,7 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "omitted targetPort defaults to service port", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "port": 80, "protocol": "TCP", }), event: serviceNetworkEvent(80, "tcp"), @@ -158,7 +156,7 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "udp remap", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "port": 53, "targetPort": 5353, "protocol": "UDP", }), event: serviceNetworkEvent(53, "udp"), @@ -166,16 +164,16 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "multi-port service selects matching service port", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, - map[string]interface{}{"port": 80, "targetPort": 8080, "protocol": "TCP"}, - map[string]interface{}{"port": 443, "targetPort": 8443, "protocol": "TCP"}, + service: newServiceWorkload("api", map[string]any{"app": "api"}, + map[string]any{"port": 80, "targetPort": 8080, "protocol": "TCP"}, + map[string]any{"port": 443, "targetPort": 8443, "protocol": "TCP"}, ), event: serviceNetworkEvent(443, "tcp"), wantPorts: []int32{8443}, }, { name: "protocol mismatch keeps observed port", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "port": 80, "targetPort": 8080, "protocol": "TCP", }), event: serviceNetworkEvent(80, "udp"), @@ -183,7 +181,7 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "unknown observed port falls back", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "port": 80, "targetPort": 8080, "protocol": "TCP", }), event: serviceNetworkEvent(9999, "tcp"), @@ -191,12 +189,12 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "malformed service falls back safely", - service: workloadinterface.NewWorkloadObj(map[string]interface{}{ + service: workloadinterface.NewWorkloadObj(map[string]any{ "apiVersion": "v1", "kind": "Service", - "metadata": map[string]interface{}{"name": "api", "namespace": "default"}, - "spec": map[string]interface{}{ - "selector": map[string]interface{}{"app": "api"}, + "metadata": map[string]any{"name": "api", "namespace": "default"}, + "spec": map[string]any{ + "selector": map[string]any{"app": "api"}, "ports": "invalid", }, }), @@ -205,13 +203,13 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "named targetPort resolves via endpointslice on service port name", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "name": "web", "port": 80, "targetPort": "http", "protocol": "TCP", }), endpointSlice: []*discoveryv1.EndpointSlice{ newEndpointSlice("api-a", "api", discoveryv1.EndpointPort{ - Name: ptr.To("web"), - Port: ptr.To(int32(8080)), + Name: new("web"), + Port: new(int32(8080)), Protocol: ptr.To(corev1.ProtocolTCP), }), }, @@ -220,18 +218,18 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "heterogeneous named targetPort collects all endpoint ports", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "name": "web", "port": 80, "targetPort": "http", "protocol": "TCP", }), endpointSlice: []*discoveryv1.EndpointSlice{ newEndpointSlice("api-a", "api", discoveryv1.EndpointPort{ - Name: ptr.To("web"), - Port: ptr.To(int32(8080)), + Name: new("web"), + Port: new(int32(8080)), Protocol: ptr.To(corev1.ProtocolTCP), }), newEndpointSlice("api-b", "api", discoveryv1.EndpointPort{ - Name: ptr.To("web"), - Port: ptr.To(int32(9090)), + Name: new("web"), + Port: new(int32(9090)), Protocol: ptr.To(corev1.ProtocolTCP), }), }, @@ -240,7 +238,7 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "nil endpoints after empty endpointslice lookup keeps observed port", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "name": "web", "port": 80, "targetPort": "http", "protocol": "TCP", }), event: serviceNetworkEvent(80, "tcp"), @@ -248,10 +246,10 @@ func TestCreateNetworkNeighbor_ServiceTargetPortMatrix(t *testing.T) { }, { name: "endpoints fallback when no endpointslice", - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "name": "web", "port": 80, "targetPort": "http", "protocol": "TCP", }), - endpoints: newEndpointsWorkload("api", map[string]interface{}{ + endpoints: newEndpointsWorkload("api", map[string]any{ "name": "web", "port": 8080, "protocol": "TCP", }), event: serviceNetworkEvent(80, "tcp"), @@ -318,7 +316,7 @@ func TestCreateNetworkNeighbor_NonServiceDestinationsUnchanged(t *testing.T) { } func TestGenerateNetworkPolicy_ServiceTargetPortRoundTrip(t *testing.T) { - service := newServiceWorkload("api", map[string]interface{}{"app.kubernetes.io/name": "api"}, map[string]interface{}{ + service := newServiceWorkload("api", map[string]any{"app.kubernetes.io/name": "api"}, map[string]any{ "port": 80, "targetPort": 8080, "protocol": "TCP", }) client := &servicePortTestClient{ @@ -341,16 +339,14 @@ func TestGenerateNetworkPolicy_ServiceTargetPortRoundTrip(t *testing.T) { } cp := &softwarecomposition.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "deployment-client", - Namespace: "default", - Labels: map[string]string{ - helpersv1.RelatedKindMetadataKey: "Deployment", - helpersv1.RelatedNameMetadataKey: "client", - }, - Annotations: map[string]string{ - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "deployment-client", + Namespace: "default", + Labels: map[string]string{ + helpersv1.RelatedKindMetadataKey: "Deployment", + helpersv1.RelatedNameMetadataKey: "client", + }, + Annotations: map[string]string{ + helpersv1.StatusMetadataKey: helpersv1.Completed, }, Spec: softwarecomposition.ContainerProfileSpec{ LabelSelector: metav1.LabelSelector{ diff --git a/pkg/containerprofilemanager/v1/event_reporting.go b/pkg/containerprofilemanager/v1/event_reporting.go index d123950c51..7c746071e9 100644 --- a/pkg/containerprofilemanager/v1/event_reporting.go +++ b/pkg/containerprofilemanager/v1/event_reporting.go @@ -51,7 +51,7 @@ var maxServiceSelectorEstimate = func() int { maxLabelKey := strings.Repeat("k", 253) maxLabelValue := strings.Repeat("v", 63) labels := make(map[string]string, maxBudgetedServiceLabels) - for i := 0; i < maxBudgetedServiceLabels; i++ { + for i := range maxBudgetedServiceLabels { // Trailing rune only exists to keep the map keys distinct; length is still ~maxLabelKey. labels[maxLabelKey+string(rune('a'+i))] = maxLabelValue } diff --git a/pkg/containerprofilemanager/v1/event_reporting_test.go b/pkg/containerprofilemanager/v1/event_reporting_test.go index 9623e85153..8fea03d4f7 100644 --- a/pkg/containerprofilemanager/v1/event_reporting_test.go +++ b/pkg/containerprofilemanager/v1/event_reporting_test.go @@ -17,7 +17,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" - "k8s.io/utils/ptr" ) // fakeDNSResolver resolves every address to a fixed domain, so tests can exercise @@ -263,14 +262,14 @@ func TestCreateNetworkNeighbor_EmptyContainerIDWithWatchedContainerData(t *testi func TestReportNetworkEventServicePortMultiplicity(t *testing.T) { cpm, entry := newTestManager(t, "container1") client := &servicePortTestClient{ - service: newServiceWorkload("api", map[string]interface{}{"app": "api"}, map[string]interface{}{ + service: newServiceWorkload("api", map[string]any{"app": "api"}, map[string]any{ "name": "web", "port": 80, "targetPort": "http", "protocol": "TCP", }), } var objects []runtime.Object for i, port := range []int32{8080, 9090, 10000} { objects = append(objects, newEndpointSlice(string(rune('a'+i)), "api", discoveryv1.EndpointPort{ - Name: ptr.To("web"), Port: ptr.To(port), + Name: new("web"), Port: new(port), })) } client.kubeClient = fake.NewClientset(objects...) diff --git a/pkg/containerprofilemanager/v1/monitoring.go b/pkg/containerprofilemanager/v1/monitoring.go index e90757f235..93714cdbb5 100644 --- a/pkg/containerprofilemanager/v1/monitoring.go +++ b/pkg/containerprofilemanager/v1/monitoring.go @@ -176,25 +176,23 @@ func (cpm *ContainerProfileManager) saveContainerProfile(watchedContainer *objec watchedContainer.CurrentReportTimestamp = time.Now() containerProfile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: slug, - Namespace: container.K8s.Namespace, - Annotations: map[string]string{ - helpersv1.InstanceIDMetadataKey: watchedContainer.InstanceID.GetStringFormatted(), - helpersv1.WlidMetadataKey: watchedContainer.Wlid, - helpersv1.CompletionMetadataKey: string(watchedContainer.GetCompletionStatus()), - helpersv1.StatusMetadataKey: string(watchedContainer.GetStatus()), - helpersv1.ContainerTypeMetadataKey: watchedContainer.ContainerType.String(), - helpersv1.ReportSeriesIdMetadataKey: watchedContainer.SeriesID, - helpersv1.PreviousReportTimestampMetadataKey: watchedContainer.PreviousReportTimestamp.String(), - helpersv1.ReportTimestampMetadataKey: watchedContainer.CurrentReportTimestamp.String(), - helpersv1.OtelSpanIDMetadataKey: cpm.lifecycleTracker.LearningSpanID(watchedContainer.ContainerID), - // Full W3C traceparent so kubescape/storage can create a properly - // parented child span for the aggregation step. - helpersv1.OtelTraceparentMetadataKey: cpm.lifecycleTracker.LearningTraceparent(watchedContainer.ContainerID), - }, - Labels: objectcache.GetLabels(cpm.cloudMetadata, watchedContainer, false), + Name: slug, + Namespace: container.K8s.Namespace, + Annotations: map[string]string{ + helpersv1.InstanceIDMetadataKey: watchedContainer.InstanceID.GetStringFormatted(), + helpersv1.WlidMetadataKey: watchedContainer.Wlid, + helpersv1.CompletionMetadataKey: string(watchedContainer.GetCompletionStatus()), + helpersv1.StatusMetadataKey: string(watchedContainer.GetStatus()), + helpersv1.ContainerTypeMetadataKey: watchedContainer.ContainerType.String(), + helpersv1.ReportSeriesIdMetadataKey: watchedContainer.SeriesID, + helpersv1.PreviousReportTimestampMetadataKey: watchedContainer.PreviousReportTimestamp.String(), + helpersv1.ReportTimestampMetadataKey: watchedContainer.CurrentReportTimestamp.String(), + helpersv1.OtelSpanIDMetadataKey: cpm.lifecycleTracker.LearningSpanID(watchedContainer.ContainerID), + // Full W3C traceparent so kubescape/storage can create a properly + // parented child span for the aggregation step. + helpersv1.OtelTraceparentMetadataKey: cpm.lifecycleTracker.LearningTraceparent(watchedContainer.ContainerID), }, + Labels: objectcache.GetLabels(cpm.cloudMetadata, watchedContainer, false), Spec: v1beta1.ContainerProfileSpec{ Architectures: []string{runtime.GOARCH}, ImageID: containerInfo.ImageID, diff --git a/pkg/containerprofilemanager/v1/network_helpers.go b/pkg/containerprofilemanager/v1/network_helpers.go index b516a05796..450cf4be84 100644 --- a/pkg/containerprofilemanager/v1/network_helpers.go +++ b/pkg/containerprofilemanager/v1/network_helpers.go @@ -58,8 +58,8 @@ func (ne *NetworkEvent) GetDestinationPodLabels() map[string]string { return podLabels } - podLabelsSlice := strings.Split(ne.Destination.PodLabels, ",") - for _, podLabel := range podLabelsSlice { + podLabelsSlice := strings.SplitSeq(ne.Destination.PodLabels, ",") + for podLabel := range podLabelsSlice { podLabelSlice := strings.Split(podLabel, "=") if len(podLabelSlice) == 2 { podLabels[podLabelSlice[0]] = podLabelSlice[1] diff --git a/pkg/containerprofilemanager/v1/network_helpers_service_ports.go b/pkg/containerprofilemanager/v1/network_helpers_service_ports.go index 957aa37eb3..d5bceeb43a 100644 --- a/pkg/containerprofilemanager/v1/network_helpers_service_ports.go +++ b/pkg/containerprofilemanager/v1/network_helpers_service_ports.go @@ -2,7 +2,7 @@ package containerprofilemanager import ( "context" - "sort" + "slices" "strconv" "strings" @@ -17,7 +17,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" ) func buildNetworkPorts(protocol string, ports []uint16) []v1beta1.NetworkPort { @@ -25,7 +24,7 @@ func buildNetworkPorts(protocol string, ports []uint16) []v1beta1.NetworkPort { for _, port := range ports { networkPorts = append(networkPorts, v1beta1.NetworkPort{ Protocol: v1beta1.Protocol(protocol), - Port: ptr.To(int32(port)), + Port: new(int32(port)), Name: generatePortIdentifier(protocol, int32(port)), }) } @@ -245,7 +244,7 @@ func dedupeSortPorts(ports []uint16) []uint16 { unique = append(unique, port) } - sort.Slice(unique, func(i, j int) bool { return unique[i] < unique[j] }) + slices.Sort(unique) return unique } diff --git a/pkg/containerprofilemanager/v1/queue/containerprofile_queue.go b/pkg/containerprofilemanager/v1/queue/containerprofile_queue.go index 3dc9c61833..a260ca74db 100644 --- a/pkg/containerprofilemanager/v1/queue/containerprofile_queue.go +++ b/pkg/containerprofilemanager/v1/queue/containerprofile_queue.go @@ -125,7 +125,7 @@ const ( var ErrQueueNotRunning = errors.New("queue is not running") // QueuedContainerProfileBuilder creates a new QueuedContainerProfile instance for dque -func QueuedContainerProfileBuilder() interface{} { +func QueuedContainerProfileBuilder() any { return &QueuedContainerProfile{} } @@ -219,8 +219,7 @@ func NewQueueData(ctx context.Context, creator storage.ProfileCreator, config Qu // Create or open the queue queue, err := dque.NewOrOpen(config.QueueName, config.QueueDir, config.ItemsPerSegment, QueuedContainerProfileBuilder) if err != nil { - var corruptedError dque.ErrCorruptedSegment - if errors.As(err, &corruptedError) { + if _, ok := errors.AsType[dque.ErrCorruptedSegment](err); ok { logger.L().Info("queue corrupted, deleting and recreating", helpers.Error(err)) // Delete the specific queue's data directory. @@ -520,7 +519,7 @@ func (qd *QueueData) processAllItems() { // Process each item in the queue processLoop: - for i := 0; i < queueSize; i++ { + for range queueSize { // Try to get an item from the queue iface, err := qd.queue.Dequeue() if err != nil { @@ -791,14 +790,14 @@ func (qd *QueueData) GetQueueSize() int { } // GetQueueStats returns basic statistics about the queue -func (qd *QueueData) GetQueueStats() map[string]interface{} { +func (qd *QueueData) GetQueueStats() map[string]any { // running is written under qd.mu by Close, so it must be read under it too. qd.mu.Lock() running := qd.running size := qd.GetQueueSize() qd.mu.Unlock() - return map[string]interface{}{ + return map[string]any{ "size": size, "maxQueueSize": qd.maxQueueSize, "maxSplitDepth": qd.maxSplitDepth, diff --git a/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors.go b/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors.go index 0008b971cd..3b4103bf74 100644 --- a/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors.go +++ b/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors.go @@ -80,8 +80,7 @@ func matchesSentinel(err, sentinel error) bool { return true } - var statusErr *apierrors.StatusError - if errors.As(err, &statusErr) { + if statusErr, ok := errors.AsType[*apierrors.StatusError](err); ok { return strings.Contains(statusErr.ErrStatus.Message, sentinel.Error()) } diff --git a/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors_test.go b/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors_test.go index b6aec5cc90..e479098693 100644 --- a/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors_test.go +++ b/pkg/containerprofilemanager/v1/queue/containerprofile_queue_errors_test.go @@ -300,14 +300,12 @@ func testProfile() *v1beta1.ContainerProfile { rt := time.Now() return &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cattle-cluster-agent-0123456789abcdef0123456789abcdef", - Namespace: "cattle-system", - Annotations: map[string]string{ - helpersv1.ReportSeriesIdMetadataKey: "test-series-id", - helpersv1.PreviousReportTimestampMetadataKey: prev.String(), - helpersv1.ReportTimestampMetadataKey: rt.String(), - }, + Name: "cattle-cluster-agent-0123456789abcdef0123456789abcdef", + Namespace: "cattle-system", + Annotations: map[string]string{ + helpersv1.ReportSeriesIdMetadataKey: "test-series-id", + helpersv1.PreviousReportTimestampMetadataKey: prev.String(), + helpersv1.ReportTimestampMetadataKey: rt.String(), }, } } @@ -780,12 +778,12 @@ func TestEnforceMaxSize_BacklogBoundsRepairCost(t *testing.T) { require.NoError(t, err) t.Cleanup(func() { _ = qd.Close() }) - for i := 0; i < maxQueueSize; i++ { + for i := range maxQueueSize { require.NoError(t, qd.Enqueue(testProfile(), fmt.Sprintf("container-%d", i))) } require.Equal(t, maxQueueSize, qd.GetQueueSize()) - for i := 0; i < maxQueueSize*3; i++ { + for i := range maxQueueSize * 3 { require.NoError(t, qd.Enqueue(testProfile(), fmt.Sprintf("container-burst-%d", i))) require.LessOrEqual(t, qd.stitchBacklog.Load(), qd.maxStitchBacklog, "stitch backlog must never exceed its bound") } diff --git a/pkg/containerprofilemanager/v1/queue/containerprofile_queue_test.go b/pkg/containerprofilemanager/v1/queue/containerprofile_queue_test.go index 62d7357abb..dd8283e516 100644 --- a/pkg/containerprofilemanager/v1/queue/containerprofile_queue_test.go +++ b/pkg/containerprofilemanager/v1/queue/containerprofile_queue_test.go @@ -9,7 +9,6 @@ import ( "time" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // MockProfileCreator implements ProfileCreator for testing. @@ -92,10 +91,8 @@ func TestQueueBasicOperations(t *testing.T) { // Test enqueue profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-profile", - Namespace: "default", - }, + Name: "test-profile", + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") @@ -149,12 +146,10 @@ func TestQueueLRUEviction(t *testing.T) { defer queueData.Close() // Add more items than max size - for i := 0; i < 5; i++ { + for i := range 5 { profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("test-profile-%d", i), - Namespace: "default", - }, + Name: fmt.Sprintf("test-profile-%d", i), + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") if err != nil { @@ -175,7 +170,7 @@ func TestQueueLRUEviction(t *testing.T) { // the stitch is still sitting unprocessed at the head. The survivors are therefore the // repair stitch followed by the two newest real profiles. dequeued := make([]*QueuedContainerProfile, 0, 3) - for i := 0; i < 3; i++ { + for i := range 3 { item, err := queueData.queue.Dequeue() if err != nil { t.Fatalf("Failed to dequeue item %d: %v", i, err) @@ -226,10 +221,8 @@ func TestQueueRetryMechanism(t *testing.T) { defer queueData.Close() profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "retry-test-profile", - Namespace: "default", - }, + Name: "retry-test-profile", + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") @@ -282,10 +275,8 @@ func TestQueuePersistence(t *testing.T) { } profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "persistence-test-profile", - Namespace: "default", - }, + Name: "persistence-test-profile", + Namespace: "default", } err = queueData1.Enqueue(profile, "test-container-id") @@ -354,12 +345,10 @@ func TestQueueStats(t *testing.T) { defer queueData.Close() // Add some items - for i := 0; i < 3; i++ { + for i := range 3 { profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("stats-test-profile-%d", i), - Namespace: "default", - }, + Name: fmt.Sprintf("stats-test-profile-%d", i), + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") if err != nil { @@ -411,12 +400,10 @@ func TestQueueEmptyOperation(t *testing.T) { defer queueData.Close() // Add some items - for i := 0; i < 5; i++ { + for i := range 5 { profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("empty-test-profile-%d", i), - Namespace: "default", - }, + Name: fmt.Sprintf("empty-test-profile-%d", i), + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") if err != nil { @@ -469,16 +456,14 @@ func TestQueueConcurrentOperations(t *testing.T) { itemsPerGoroutine := 5 done := make(chan bool, numGoroutines) - for g := 0; g < numGoroutines; g++ { + for g := range numGoroutines { go func(goroutineID int) { defer func() { done <- true }() - for i := 0; i < itemsPerGoroutine; i++ { + for i := range itemsPerGoroutine { profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("concurrent-profile-%d-%d", goroutineID, i), - Namespace: "default", - }, + Name: fmt.Sprintf("concurrent-profile-%d-%d", goroutineID, i), + Namespace: "default", } err := queueData.Enqueue(profile, "test-container-id") @@ -490,7 +475,7 @@ func TestQueueConcurrentOperations(t *testing.T) { } // Wait for all goroutines to complete - for i := 0; i < numGoroutines; i++ { + for range numGoroutines { <-done } @@ -533,10 +518,8 @@ func TestQueueStopAndRestart(t *testing.T) { // Add an item profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "stop-restart-profile", - Namespace: "default", - }, + Name: "stop-restart-profile", + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") @@ -614,10 +597,8 @@ func TestQueueWithDifferentConfigurations(t *testing.T) { // Test basic functionality profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("config-test-profile-%s", tc.name), - Namespace: "default", - }, + Name: fmt.Sprintf("config-test-profile-%s", tc.name), + Namespace: "default", } err = queueData.Enqueue(profile, "test-container-id") @@ -662,10 +643,8 @@ func BenchmarkQueueEnqueue(b *testing.B) { defer queueData.Close() profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "benchmark-profile", - Namespace: "default", - }, + Name: "benchmark-profile", + Namespace: "default", } b.ResetTimer() @@ -702,10 +681,8 @@ func BenchmarkQueueProcessing(b *testing.B) { // Pre-populate queue for i := 0; i < b.N; i++ { profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("benchmark-profile-%d", i), - Namespace: "default", - }, + Name: fmt.Sprintf("benchmark-profile-%d", i), + Namespace: "default", } queueData.Enqueue(profile, "test-container-id") } @@ -744,10 +721,8 @@ func TestQueueCorruptedSegmentHandling(t *testing.T) { // Add a profile to the queue profile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "corrupted-test-profile", - Namespace: "default", - }, + Name: "corrupted-test-profile", + Namespace: "default", } err = queueData1.Enqueue(profile, "test-container-id") @@ -800,10 +775,8 @@ func TestQueueCorruptedSegmentHandling(t *testing.T) { // Test that the queue still works normally after recovery newProfile := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "recovery-test-profile", - Namespace: "default", - }, + Name: "recovery-test-profile", + Namespace: "default", } err = queueData2.Enqueue(newProfile, "test-container-id") diff --git a/pkg/containerprofilemanager/v1/queue/containerprofile_split_test.go b/pkg/containerprofilemanager/v1/queue/containerprofile_split_test.go index a5f9cf1280..7e5df3e04c 100644 --- a/pkg/containerprofilemanager/v1/queue/containerprofile_split_test.go +++ b/pkg/containerprofilemanager/v1/queue/containerprofile_split_test.go @@ -120,11 +120,9 @@ func richProfile() *v1beta1.ContainerProfile { {CallID: "cs-a"}, {CallID: "cs-b"}, }, - LabelSelector: metav1.LabelSelector{ - MatchLabels: map[string]string{"k": "v"}, - MatchExpressions: []metav1.LabelSelectorRequirement{ - {Key: "k", Operator: metav1.LabelSelectorOpExists}, - }, + MatchLabels: map[string]string{"k": "v"}, + MatchExpressions: []metav1.LabelSelectorRequirement{ + {Key: "k", Operator: metav1.LabelSelectorOpExists}, }, Ingress: []v1beta1.NetworkNeighbor{{Identifier: "in-a"}, {Identifier: "in-b"}}, Egress: []v1beta1.NetworkNeighbor{{Identifier: "eg-a"}, {Identifier: "eg-b"}}, diff --git a/pkg/containerwatcher/container_watcher_interface.go b/pkg/containerwatcher/container_watcher_interface.go index b75a0ffee3..2a4116687e 100644 --- a/pkg/containerwatcher/container_watcher_interface.go +++ b/pkg/containerwatcher/container_watcher_interface.go @@ -39,8 +39,7 @@ type CustomTracerInitializer interface { ) (TracerInterface, error) } -type GenericEventReceiver interface { // TODO: either EventReceiver or EnrichedEventReceiver -} +type GenericEventReceiver any type EventReceiver interface { ReportEvent(eventType utils.EventType, event utils.K8sEvent) diff --git a/pkg/containerwatcher/v2/container_watcher.go b/pkg/containerwatcher/v2/container_watcher.go index ea2757bcb6..4185efb9e9 100644 --- a/pkg/containerwatcher/v2/container_watcher.go +++ b/pkg/containerwatcher/v2/container_watcher.go @@ -169,7 +169,7 @@ func CreateContainerWatcher( eventEnricher := NewEventEnricher(processTreeManager) // Create worker pool for processing individual events - workerPool, err := ants.NewPoolWithFunc(cfg.WorkerPoolSize, func(i interface{}) { + workerPool, err := ants.NewPoolWithFunc(cfg.WorkerPoolSize, func(i any) { enrichedEvent := i.(*events.EnrichedEvent) eventHandlerFactory.ProcessEvent(enrichedEvent) enrichedEvent.Event.Release() // at this time we should not need the event anymore diff --git a/pkg/containerwatcher/v2/container_watcher_private_test.go b/pkg/containerwatcher/v2/container_watcher_private_test.go index 524142220b..0b58500513 100644 --- a/pkg/containerwatcher/v2/container_watcher_private_test.go +++ b/pkg/containerwatcher/v2/container_watcher_private_test.go @@ -8,8 +8,6 @@ import ( "github.com/kubescape/node-agent/pkg/objectcache" "github.com/kubescape/node-agent/pkg/rulebindingmanager" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - mapset "github.com/deckarep/golang-set/v2" containercollection "github.com/inspektor-gadget/inspektor-gadget/pkg/container-collection" "github.com/inspektor-gadget/inspektor-gadget/pkg/types" @@ -19,10 +17,8 @@ import ( func TestAddRunningContainers(t *testing.T) { pod := corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod1", - Namespace: "namespace1", - }, + Name: "pod1", + Namespace: "namespace1", Spec: corev1.PodSpec{ Containers: []corev1.Container{ { diff --git a/pkg/containerwatcher/v2/event_handler_factory.go b/pkg/containerwatcher/v2/event_handler_factory.go index 7396472b83..f4a78a8e26 100644 --- a/pkg/containerwatcher/v2/event_handler_factory.go +++ b/pkg/containerwatcher/v2/event_handler_factory.go @@ -25,11 +25,7 @@ import ( ) // Manager represents a component that can receive events -type Manager interface { - // TODO: Find a better way to handle this - // containerwatcher.EventReceiver - // containerwatcher.EnrichedEventReceiver -} +type Manager any // ManagerAdapter adapts different manager interfaces to the common Manager interface type ManagerAdapter struct { diff --git a/pkg/containerwatcher/v2/ordered_event_queue_test.go b/pkg/containerwatcher/v2/ordered_event_queue_test.go index 8d7457b23e..e74b7cdcdf 100644 --- a/pkg/containerwatcher/v2/ordered_event_queue_test.go +++ b/pkg/containerwatcher/v2/ordered_event_queue_test.go @@ -100,7 +100,7 @@ func TestOrderedEventQueue_FullQueueAlert(t *testing.T) { queue := NewOrderedEventQueue(10*time.Millisecond, 3) // Add events up to the limit - for i := 0; i < 3; i++ { + for i := range 3 { event := &utils.StructEvent{ID: fmt.Sprintf("event_%d", i), Timestamp: int64(i)} queue.AddEventDirect(utils.ExecveEventType, event, fmt.Sprintf("container_%d", i), uint32(i+100)) } @@ -208,7 +208,7 @@ func TestOrderedEventQueue_LargeNumberOfEvents(t *testing.T) { // Add events with random-ish timestamps expectedOrder := make([]int, numEvents) - for i := 0; i < numEvents; i++ { + for i := range numEvents { // Use reverse order timestamps so we can verify sorting works timestamp := baseTime + int64((numEvents-i)*1000) event := &utils.StructEvent{ID: fmt.Sprintf("event_%d", i), Timestamp: timestamp} @@ -219,7 +219,7 @@ func TestOrderedEventQueue_LargeNumberOfEvents(t *testing.T) { assert.Equal(t, numEvents, queue.Size()) // Pop all events and verify they come out in timestamp order - for i := 0; i < numEvents; i++ { + for i := range numEvents { event, ok := queue.PopEvent() require.True(t, ok, "Should be able to pop event %d", i) diff --git a/pkg/containerwatcher/v2/tracers/dns_retry_test.go b/pkg/containerwatcher/v2/tracers/dns_retry_test.go index 4cf5b4e5f4..5a9560ba31 100644 --- a/pkg/containerwatcher/v2/tracers/dns_retry_test.go +++ b/pkg/containerwatcher/v2/tracers/dns_retry_test.go @@ -18,23 +18,23 @@ import ( // DNSTracer.Start's bounded retry (armosec/private-node-agent#511: // gadget startup failures in this class are transient/timing-dependent). type fakeRuntime struct { - calls int32 + calls atomic.Int32 failCount int32 // number of leading calls that return an error } -func (f *fakeRuntime) Init(*params.Params) error { return nil } -func (f *fakeRuntime) Close() error { return nil } -func (f *fakeRuntime) GlobalParamDescs() params.ParamDescs { return nil } -func (f *fakeRuntime) ParamDescs() params.ParamDescs { return nil } -func (f *fakeRuntime) SetDefaultValue(params.ValueHint, string) {} -func (f *fakeRuntime) GetDefaultValue(params.ValueHint) (string, bool) { return "", false } -func (f *fakeRuntime) IsClient() bool { return false } +func (f *fakeRuntime) Init(*params.Params) error { return nil } +func (f *fakeRuntime) Close() error { return nil } +func (f *fakeRuntime) GlobalParamDescs() params.ParamDescs { return nil } +func (f *fakeRuntime) ParamDescs() params.ParamDescs { return nil } +func (f *fakeRuntime) SetDefaultValue(params.ValueHint, string) {} +func (f *fakeRuntime) GetDefaultValue(params.ValueHint) (string, bool) { return "", false } +func (f *fakeRuntime) IsClient() bool { return false } func (f *fakeRuntime) GetGadgetInfo(runtime.GadgetContext, *params.Params, api.ParamValues) (*api.GadgetInfo, error) { return nil, nil } func (f *fakeRuntime) RunGadget(_ runtime.GadgetContext, _ *params.Params, _ api.ParamValues) error { - n := atomic.AddInt32(&f.calls, 1) + n := f.calls.Add(1) if n <= f.failCount { return errors.New("simulated transient CO-RE/BTF race") } @@ -48,7 +48,7 @@ func TestDNSTracerStartRetriesOnTransientFailure(t *testing.T) { require.NoError(t, dt.Start(context.Background())) require.Eventually(t, func() bool { - return atomic.LoadInt32(&fr.calls) == int32(dnsStartMaxRetries) + return fr.calls.Load() == int32(dnsStartMaxRetries) }, 15*time.Second, 20*time.Millisecond, "expected the tracer to retry until the final attempt succeeds") require.NoError(t, dt.Stop()) @@ -61,13 +61,13 @@ func TestDNSTracerStartGivesUpAfterMaxRetries(t *testing.T) { require.NoError(t, dt.Start(context.Background())) require.Eventually(t, func() bool { - return atomic.LoadInt32(&fr.calls) == int32(dnsStartMaxRetries) + return fr.calls.Load() == int32(dnsStartMaxRetries) }, 15*time.Second, 20*time.Millisecond, "expected the tracer to stop after dnsStartMaxRetries attempts") // Give any (incorrect) further retry a chance to happen, then confirm // the bound was actually respected. time.Sleep(500 * time.Millisecond) - require.Equal(t, int32(dnsStartMaxRetries), atomic.LoadInt32(&fr.calls)) + require.Equal(t, int32(dnsStartMaxRetries), fr.calls.Load()) require.NoError(t, dt.Stop()) } @@ -79,7 +79,7 @@ func TestDNSTracerStopStopsRetryingMidBackoff(t *testing.T) { require.NoError(t, dt.Start(context.Background())) require.Eventually(t, func() bool { - return atomic.LoadInt32(&fr.calls) >= 1 + return fr.calls.Load() >= 1 }, 5*time.Second, 10*time.Millisecond, "expected at least one attempt") // Stop while an attempt is in flight or the loop is waiting between @@ -90,9 +90,9 @@ func TestDNSTracerStopStopsRetryingMidBackoff(t *testing.T) { // RetryNotify started yet another attempt anyway. require.NoError(t, dt.Stop()) - callsAtStop := atomic.LoadInt32(&fr.calls) + callsAtStop := fr.calls.Load() time.Sleep(1 * time.Second) - require.Equal(t, callsAtStop, atomic.LoadInt32(&fr.calls), + require.Equal(t, callsAtStop, fr.calls.Load(), "expected no further RunGadget calls after Stop") } @@ -104,14 +104,14 @@ func TestDNSTracerStartStopsRetryingWhenContextCanceled(t *testing.T) { require.NoError(t, dt.Start(ctx)) require.Eventually(t, func() bool { - return atomic.LoadInt32(&fr.calls) >= 1 + return fr.calls.Load() >= 1 }, 5*time.Second, 10*time.Millisecond, "expected at least one attempt") cancel() - callsAtCancel := atomic.LoadInt32(&fr.calls) + callsAtCancel := fr.calls.Load() time.Sleep(1 * time.Second) - require.LessOrEqual(t, atomic.LoadInt32(&fr.calls), callsAtCancel+1, + require.LessOrEqual(t, fr.calls.Load(), callsAtCancel+1, "expected retries to stop shortly after the context is canceled") require.NoError(t, dt.Stop()) diff --git a/pkg/containerwatcher/v2/tracers/httpparse.go b/pkg/containerwatcher/v2/tracers/httpparse.go index 20c257d733..43fa2600dd 100644 --- a/pkg/containerwatcher/v2/tracers/httpparse.go +++ b/pkg/containerwatcher/v2/tracers/httpparse.go @@ -58,7 +58,7 @@ func ExtractConsistentHeaders(headers http.Header) map[string][]string { result := make(map[string][]string) for _, header := range ConsistentHeaders { if value, ok := headers[header]; ok { - switch typedValue := interface{}(value).(type) { + switch typedValue := any(value).(type) { case []string: result[header] = typedValue case string: @@ -171,7 +171,7 @@ func ParseHttpResponse(data []byte, req *http.Request) (*http.Response, error) { } func FromCString(in []byte) []byte { - for i := 0; i < len(in); i++ { + for i := range in { if in[i] == 0 { return in[:i] } diff --git a/pkg/containerwatcher/v2/tracers/httpparse_test.go b/pkg/containerwatcher/v2/tracers/httpparse_test.go index 69f9e5fc13..632849a563 100644 --- a/pkg/containerwatcher/v2/tracers/httpparse_test.go +++ b/pkg/containerwatcher/v2/tracers/httpparse_test.go @@ -280,7 +280,7 @@ func TestGetValidBuf(t *testing.T) { t.Run("buf_len < len(buf) truncates correctly", func(t *testing.T) { // Normal case: buf_len indicates valid data is shorter than buffer. buf := makeBPFBuffer(httpData) - event := &mockHttpRawEvent{StructEvent: utils.StructEvent{Buf: buf}, bufLen: uint16(len(httpData))} + event := &mockHttpRawEvent{Buf: buf, bufLen: uint16(len(httpData))} result := GetValidBuf(event) assert.Equal(t, len(httpData), len(result), "should truncate to buf_len") assert.Equal(t, httpData, string(result)) @@ -289,7 +289,7 @@ func TestGetValidBuf(t *testing.T) { t.Run("buf_len=0 returns full buffer (backward compatibility)", func(t *testing.T) { // When buf_len is 0 (error case), we fall back to returning the full buffer. buf := makeBPFBuffer(httpData) - event := &mockHttpRawEvent{StructEvent: utils.StructEvent{Buf: buf}, bufLen: 0} + event := &mockHttpRawEvent{Buf: buf, bufLen: 0} result := GetValidBuf(event) assert.Equal(t, len(buf), len(result), "buf_len=0 should return full buffer") }) @@ -297,20 +297,20 @@ func TestGetValidBuf(t *testing.T) { t.Run("buf_len > len(buf) returns full buffer (safety)", func(t *testing.T) { // If buf_len exceeds buffer size, return full buffer as safety measure. buf := []byte(httpData) - event := &mockHttpRawEvent{StructEvent: utils.StructEvent{Buf: buf}, bufLen: uint16(len(buf) + 100)} + event := &mockHttpRawEvent{Buf: buf, bufLen: uint16(len(buf) + 100)} result := GetValidBuf(event) assert.Equal(t, len(buf), len(result), "buf_len > len(buf) should return full buffer") }) t.Run("empty buffer", func(t *testing.T) { - event := &mockHttpRawEvent{StructEvent: utils.StructEvent{Buf: []byte{}}, bufLen: 0} + event := &mockHttpRawEvent{Buf: []byte{}, bufLen: 0} result := GetValidBuf(event) assert.Empty(t, result) }) t.Run("buf_len equals buffer length", func(t *testing.T) { buf := []byte(httpData) - event := &mockHttpRawEvent{StructEvent: utils.StructEvent{Buf: buf}, bufLen: uint16(len(buf))} + event := &mockHttpRawEvent{Buf: buf, bufLen: uint16(len(buf))} result := GetValidBuf(event) assert.Equal(t, len(buf), len(result)) assert.Equal(t, httpData, string(result)) diff --git a/pkg/containerwatcher/v2/tracers/syscall_test.go b/pkg/containerwatcher/v2/tracers/syscall_test.go index 051ea18308..7fe6c3358d 100644 --- a/pkg/containerwatcher/v2/tracers/syscall_test.go +++ b/pkg/containerwatcher/v2/tracers/syscall_test.go @@ -66,7 +66,7 @@ func newSyscallEvent(t *testing.T, containerID string) *utils.DatasourceEvent { // Find a syscall number this build can resolve, so decodeSyscalls returns a // non-empty list (callback returns early otherwise, before either signal fires). knownNumber := -1 - for i := 0; i < 512; i++ { + for i := range 512 { if _, exist := syscalls.GetSyscallNameByNumber(i); exist { knownNumber = i break diff --git a/pkg/cooldownqueue/cooldownqueue_test.go b/pkg/cooldownqueue/cooldownqueue_test.go index 4c824f103d..36887fec33 100644 --- a/pkg/cooldownqueue/cooldownqueue_test.go +++ b/pkg/cooldownqueue/cooldownqueue_test.go @@ -13,9 +13,9 @@ import ( ) var ( - configmap = unstructured.Unstructured{Object: map[string]interface{}{"kind": "ConfigMap", "metadata": map[string]interface{}{"uid": "748ad4a8-e5ff-44da-ba94-309992c97820"}}} - deployment = unstructured.Unstructured{Object: map[string]interface{}{"kind": "Deployment", "metadata": map[string]interface{}{"uid": "6b1a0c50-277f-4aa1-a4f9-9fc278ce4fe2"}}} - pod = unstructured.Unstructured{Object: map[string]interface{}{"kind": "Pod", "metadata": map[string]interface{}{"uid": "aa5e3e8f-2da5-4c38-93c0-210d3280d10f"}}} + configmap = unstructured.Unstructured{Object: map[string]any{"kind": "ConfigMap", "metadata": map[string]any{"uid": "748ad4a8-e5ff-44da-ba94-309992c97820"}}} + deployment = unstructured.Unstructured{Object: map[string]any{"kind": "Deployment", "metadata": map[string]any{"uid": "6b1a0c50-277f-4aa1-a4f9-9fc278ce4fe2"}}} + pod = unstructured.Unstructured{Object: map[string]any{"kind": "Pod", "metadata": map[string]any{"uid": "aa5e3e8f-2da5-4c38-93c0-210d3280d10f"}}} deploymentAdded = watch.Event{Type: watch.Added, Object: &deployment} podAdded = watch.Event{Type: watch.Added, Object: &pod} podModified = watch.Event{Type: watch.Modified, Object: &pod} @@ -68,7 +68,7 @@ func TestCooldownQueue_StopDuringEviction(t *testing.T) { const shortCooldown = 10 * time.Millisecond const shortInterval = 5 * time.Millisecond - for i := 0; i < 50; i++ { + for range 50 { q := NewCooldownQueue[watch.Event](shortCooldown, shortInterval) // Enqueue an event so there is something to evict. @@ -77,13 +77,11 @@ func TestCooldownQueue_StopDuringEviction(t *testing.T) { // Drain the result channel in a separate goroutine so the callback is // not blocked on an unread receiver when we call Stop(). var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { //nolint:revive // intentionally drain all events without processing them to unblock the relay goroutine for range q.ResultChan() { } - }() + }) // Sleep briefly so the TTL evicter goroutine is likely firing // concurrently with the Stop() call below. diff --git a/pkg/dedupcache/dedup_cache.go b/pkg/dedupcache/dedup_cache.go index 10b8d5a191..76f9963721 100644 --- a/pkg/dedupcache/dedup_cache.go +++ b/pkg/dedupcache/dedup_cache.go @@ -53,7 +53,7 @@ func (c *DedupCache) CheckAndSet(key uint64, ttlBuckets uint16, currentBucket ui stored := c.slots[idx].Load() storedKey, storedExpiry := unpack(stored) - if storedKey == (key & 0xFFFFFFFFFFFF0000) && int16(storedExpiry-currentBucket) > 0 { + if storedKey == (key&0xFFFFFFFFFFFF0000) && int16(storedExpiry-currentBucket) > 0 { return true // duplicate } diff --git a/pkg/dedupcache/dedup_cache_test.go b/pkg/dedupcache/dedup_cache_test.go index b8a1e7c890..0339980397 100644 --- a/pkg/dedupcache/dedup_cache_test.go +++ b/pkg/dedupcache/dedup_cache_test.go @@ -129,10 +129,10 @@ func TestCheckAndSet_ConcurrentHammer(t *testing.T) { var wg sync.WaitGroup wg.Add(goroutines) - for g := 0; g < goroutines; g++ { + for g := range goroutines { go func(id int) { defer wg.Done() - for i := 0; i < opsPerGoroutine; i++ { + for i := range opsPerGoroutine { key := uint64(id*opsPerGoroutine+i) << 16 c.CheckAndSet(key, 156, uint16(1000)) } diff --git a/pkg/dedupcache/keys_test.go b/pkg/dedupcache/keys_test.go index 63205da0db..e03e5e75bc 100644 --- a/pkg/dedupcache/keys_test.go +++ b/pkg/dedupcache/keys_test.go @@ -18,7 +18,7 @@ func TestComputeOpenKey_DifferentInputs(t *testing.T) { k5 := ComputeOpenKey(123456, 42, "/etc/passwd", 0x04) keys := []uint64{k1, k2, k3, k4, k5} - for i := 0; i < len(keys); i++ { + for i := range keys { for j := i + 1; j < len(keys); j++ { if keys[i] == keys[j] { t.Fatalf("collision between key[%d]=%x and key[%d]=%x", i, keys[i], j, keys[j]) diff --git a/pkg/dnsmanager/dns_manager.go b/pkg/dnsmanager/dns_manager.go index d6801c1bd6..6f0293c567 100644 --- a/pkg/dnsmanager/dns_manager.go +++ b/pkg/dnsmanager/dns_manager.go @@ -57,30 +57,15 @@ func CreateDNSManager(size int) *DNSManager { size = defaultDNSCacheSize } - perContainerSize := defaultPerContainerCacheSize - if size < perContainerSize { - perContainerSize = size - } + perContainerSize := min(size, defaultPerContainerCacheSize) maxContainers := size / perContainerSize if maxContainers < minTrackedContainers { - maxContainers = minTrackedContainers - if maxContainers > size { - maxContainers = size - } - if maxContainers < 1 { - maxContainers = 1 - } - perContainerSize = size / maxContainers - if perContainerSize < 1 { - perContainerSize = 1 - } + maxContainers = max(min(minTrackedContainers, size), 1) + perContainerSize = max(size/maxContainers, 1) } - hostCacheSize := perContainerSize - if hostCacheSize < 1 { - hostCacheSize = 1 - } + hostCacheSize := max(perContainerSize, 1) hostCache, err := lru.New[string, string](hostCacheSize) if err != nil { diff --git a/pkg/dnsmanager/dns_manager_interface.go b/pkg/dnsmanager/dns_manager_interface.go index 9249189c36..1e273f7d14 100644 --- a/pkg/dnsmanager/dns_manager_interface.go +++ b/pkg/dnsmanager/dns_manager_interface.go @@ -15,4 +15,3 @@ type DNSResolver interface { ResolveIPAddress(containerID string, ipAddr string) (string, bool) ResolveContainerProcessToCloudServices(containerID string, pid uint32) mapset.Set[string] } - diff --git a/pkg/dnsmanager/dns_manager_test.go b/pkg/dnsmanager/dns_manager_test.go index 5ca8472e8d..6eb0364ade 100644 --- a/pkg/dnsmanager/dns_manager_test.go +++ b/pkg/dnsmanager/dns_manager_test.go @@ -342,7 +342,7 @@ func TestCacheFallbackBehavior(t *testing.T) { // Test cache hit behavior hitCount := 0 - for i := 0; i < 5; i++ { + for range 5 { if cached, found := dm.lookupCache.Get(event.DNSName); found { entry := cached.(cacheEntry) if len(entry.addresses) > 0 { @@ -384,11 +384,11 @@ func TestConcurrentAccess(t *testing.T) { } // Launch multiple goroutines to concurrently access the cache - for i := 0; i < numGoroutines; i++ { + for range numGoroutines { go func() { defer wg.Done() - for j := 0; j < numOperations; j++ { + for range numOperations { // Randomly choose between writing and reading if rand.Float32() < 0.5 { // Write operation @@ -636,7 +636,7 @@ func TestCloudServiceCacheLimit(t *testing.T) { }) // Add more than maxServiceCacheSize cloud services - for i := 0; i < maxServiceCacheSize+10; i++ { + for i := range maxServiceCacheSize + 10 { dm.ReportEvent(&utils.StructEvent{ EventType: utils.DnsEventType, ContainerID: containerID, diff --git a/pkg/exporters/alert_bulk_manager.go b/pkg/exporters/alert_bulk_manager.go index 2d2821e37f..9737aedf22 100644 --- a/pkg/exporters/alert_bulk_manager.go +++ b/pkg/exporters/alert_bulk_manager.go @@ -437,10 +437,7 @@ func (abm *AlertBulkManager) processSendQueueItem(item *bulkQueueItem) { item.lastAttemptAt = time.Now() // Calculate delay: min(baseDelay * 2^(retryCount-1), maxDelay) - delay := time.Duration(float64(abm.retryBaseDelay) * math.Pow(2, float64(item.retryCount-1))) - if delay > abm.retryMaxDelay { - delay = abm.retryMaxDelay - } + delay := min(time.Duration(float64(abm.retryBaseDelay)*math.Pow(2, float64(item.retryCount-1))), abm.retryMaxDelay) logger.L().Warning("Bulk send failed, will retry", helpers.String("containerID", item.containerID), diff --git a/pkg/exporters/alert_bulk_manager_test.go b/pkg/exporters/alert_bulk_manager_test.go index 4b8a4925df..03867a2a10 100644 --- a/pkg/exporters/alert_bulk_manager_test.go +++ b/pkg/exporters/alert_bulk_manager_test.go @@ -11,17 +11,13 @@ import ( func createTestAlert(containerID string, alertName string) armotypes.RuntimeAlert { return armotypes.RuntimeAlert{ - Message: alertName, - RuntimeAlertK8sDetails: armotypes.RuntimeAlertK8sDetails{ - ContainerID: containerID, - ContainerName: "test-container", - PodName: "test-pod", - Namespace: "test-ns", - }, - BaseRuntimeAlert: armotypes.BaseRuntimeAlert{ - AlertName: alertName, - Timestamp: time.Now(), - }, + Message: alertName, + ContainerID: containerID, + ContainerName: "test-container", + PodName: "test-pod", + Namespace: "test-ns", + AlertName: alertName, + Timestamp: time.Now(), } } @@ -228,7 +224,7 @@ func TestContainerBulk_ShouldFlushSize(t *testing.T) { } // Add 4 alerts - should not flush - for i := 0; i < 4; i++ { + for i := range 4 { alert := createTestAlert("container-123", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) bulk.addAlert(alert, processTree, nil) @@ -271,7 +267,7 @@ func TestContainerBulk_Flush(t *testing.T) { } // Add alerts - for i := 0; i < 3; i++ { + for i := range 3 { alert := createTestAlert("container-123", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) bulk.addAlert(alert, processTree, []string{"service-" + string(rune(i))}) @@ -332,7 +328,7 @@ func TestAlertBulkManager_FlushOnSizeLimit(t *testing.T) { containerID := "container-123" // Add 5 alerts - should trigger immediate flush - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert(containerID, "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -399,14 +395,14 @@ func TestAlertBulkManager_MultipleContainers(t *testing.T) { defer manager.Stop() // Add alerts for container 1 - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert("container-1", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) } // Add alerts for container 2 - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert("container-2", "test-alert") processTree := createTestProcessTree(uint32(200 + i)) manager.AddAlert(alert, processTree, nil) @@ -442,7 +438,7 @@ func TestAlertBulkManager_FlushContainer(t *testing.T) { containerID := "container-123" // Add alerts - for i := 0; i < 3; i++ { + for i := range 3 { alert := createTestAlert(containerID, "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -480,9 +476,9 @@ func TestAlertBulkManager_FlushAll(t *testing.T) { defer manager.Stop() // Add alerts for multiple containers - for c := 0; c < 3; c++ { + for c := range 3 { containerID := "container-" + string(rune('1'+c)) - for i := 0; i < 2; i++ { + for i := range 2 { alert := createTestAlert(containerID, "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -550,28 +546,24 @@ func TestAlertBulkManager_RaceConditionProtection(t *testing.T) { var wg sync.WaitGroup // Goroutine 1: Add alerts rapidly to trigger size-based flush - wg.Add(1) - go func() { - defer wg.Done() - for i := 0; i < 5; i++ { + wg.Go(func() { + for i := range 5 { alert := createTestAlert(containerID, "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) time.Sleep(10 * time.Millisecond) } - }() + }) // Goroutine 2: Add alerts to a different bulk - wg.Add(1) - go func() { - defer wg.Done() - for i := 0; i < 3; i++ { + wg.Go(func() { + for i := range 3 { alert := createTestAlert("container-2", "test-alert") processTree := createTestProcessTree(uint32(200 + i)) manager.AddAlert(alert, processTree, nil) time.Sleep(10 * time.Millisecond) } - }() + }) // Wait for goroutines to complete wg.Wait() @@ -611,7 +603,7 @@ func TestSendQueue_SuccessfulSendThroughQueue(t *testing.T) { defer manager.Stop() // Add alerts to trigger flush - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert("container-1", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -648,7 +640,7 @@ func TestSendQueue_RetryOnFailure(t *testing.T) { defer manager.Stop() // Add alerts to trigger flush - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert("container-1", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -680,7 +672,7 @@ func TestSendQueue_MaxRetriesExceeded(t *testing.T) { defer manager.Stop() // Add alerts to trigger flush - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert("container-1", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -715,8 +707,8 @@ func TestSendQueue_QueueFullHandling(t *testing.T) { }() // Try to enqueue more items than queue can hold - for i := 0; i < 10; i++ { - for j := 0; j < 5; j++ { + for i := range 10 { + for j := range 5 { alert := createTestAlert("container-"+string(rune('1'+i)), "test-alert") processTree := createTestProcessTree(uint32(100 + j)) manager.AddAlert(alert, processTree, nil) @@ -747,8 +739,8 @@ func TestSendQueue_GracefulShutdownWithDrain(t *testing.T) { manager.Start() // Enqueue several bulks - for i := 0; i < 3; i++ { - for j := 0; j < 5; j++ { + for i := range 3 { + for j := range 5 { alert := createTestAlert("container-"+string(rune('1'+i)), "test-alert") processTree := createTestProcessTree(uint32(100 + j)) manager.AddAlert(alert, processTree, nil) @@ -788,11 +780,11 @@ func TestSendQueue_ConcurrentEnqueueing(t *testing.T) { numGoroutines := 10 alertsPerGoroutine := 5 - for i := 0; i < numGoroutines; i++ { + for i := range numGoroutines { wg.Add(1) go func(id int) { defer wg.Done() - for j := 0; j < alertsPerGoroutine; j++ { + for j := range alertsPerGoroutine { alert := createTestAlert("container-"+string(rune('A'+id)), "test-alert") processTree := createTestProcessTree(uint32(100 + j)) manager.AddAlert(alert, processTree, nil) @@ -833,7 +825,7 @@ func TestSendQueue_ExponentialBackoff(t *testing.T) { defer manager.Stop() // Add alerts to trigger flush - for i := 0; i < 5; i++ { + for i := range 5 { alert := createTestAlert("container-1", "test-alert") processTree := createTestProcessTree(uint32(100 + i)) manager.AddAlert(alert, processTree, nil) @@ -890,7 +882,7 @@ func TestSendQueue_FIFOOrderingWithRetry(t *testing.T) { // Enqueue three bulks in order: container-1, container-2, container-3 for i := 1; i <= 3; i++ { - for j := 0; j < 5; j++ { + for j := range 5 { alert := createTestAlert("container-"+string(rune('0'+i)), "test-alert") processTree := createTestProcessTree(uint32(100*i + j)) manager.AddAlert(alert, processTree, nil) diff --git a/pkg/exporters/alert_limit_test.go b/pkg/exporters/alert_limit_test.go index 9dccc4dc2b..497d0045ed 100644 --- a/pkg/exporters/alert_limit_test.go +++ b/pkg/exporters/alert_limit_test.go @@ -27,7 +27,7 @@ func TestAlertLimitKeepsLimitingAfterTheFirstDrop(t *testing.T) { assert.False(t, admitted, "the second alert is past the limit") assert.True(t, notify, "and it triggers the one notice") - for i := 0; i < 5; i++ { + for i := range 5 { admitted, notify = e.admitAlert() assert.False(t, admitted, "alert %d must stay dropped inside the window", i+3) assert.False(t, notify, "the notice is sent once per window") @@ -60,7 +60,7 @@ func TestAlertLimitZeroMeansNoLimit(t *testing.T) { config: HTTPExporterConfig{MaxAlertsPerMinute: 0}, alertMetrics: &alertMetrics{}, } - for i := 0; i < 10; i++ { + for i := range 10 { admitted, notify := e.admitAlert() assert.True(t, admitted, "alert %d must be admitted when there is no limit", i) assert.False(t, notify) @@ -78,11 +78,9 @@ func TestAlertLimitUnderConcurrentSenders(t *testing.T) { var admitted, notified atomic.Int64 var wg sync.WaitGroup - for i := 0; i < 20; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for j := 0; j < 20; j++ { + for range 20 { + wg.Go(func() { + for range 20 { ok, notify := e.admitAlert() if ok { admitted.Add(1) @@ -91,7 +89,7 @@ func TestAlertLimitUnderConcurrentSenders(t *testing.T) { notified.Add(1) } } - }() + }) } wg.Wait() diff --git a/pkg/exporters/alert_manager.go b/pkg/exporters/alert_manager.go index e028ae6036..80e9a4b203 100644 --- a/pkg/exporters/alert_manager.go +++ b/pkg/exporters/alert_manager.go @@ -100,32 +100,30 @@ func (ame *AlertManagerExporter) SendRuleAlert(failedRule types.RuleFailure) { "description": failedRule.GetRuleAlert().RuleDescription, "fix": failedRule.GetBaseRuntimeAlert().FixSuggestions, }, - Alert: models.Alert{ - GeneratorURL: strfmt.URI(sourceUrl), - Labels: map[string]string{ - "alertname": "KubescapeRuleViolated", - "rule_name": failedRule.GetBaseRuntimeAlert().AlertName, - "rule_id": failedRule.GetRuleId(), - "container_id": failedRule.GetRuntimeAlertK8sDetails().ContainerID, - "container_name": failedRule.GetRuntimeAlertK8sDetails().ContainerName, - "namespace": failedRule.GetRuntimeAlertK8sDetails().Namespace, - "pod_name": failedRule.GetRuntimeAlertK8sDetails().PodName, - "pod_uid": failedRule.GetRuntimeAlertK8sDetails().PodUID, - "workload_uid": failedRule.GetRuntimeAlertK8sDetails().WorkloadUID, - "host": ame.Host, - "node_name": ame.NodeName, - "severity": strconv.Itoa(failedRule.GetBaseRuntimeAlert().Severity), - "pid": fmt.Sprintf("%d", process.PID), - "ppid": fmt.Sprintf("%d", process.PPID), - "pcomm": process.Pcomm, - "comm": process.Comm, - "uid": fmt.Sprintf("%d", process.Uid), - "gid": fmt.Sprintf("%d", process.Gid), - "trace": trace, - "fail_on_profile": fmt.Sprintf("%t", failOnProfile), - "profile_status": completedStatus, - "processtree_depth": fmt.Sprintf("%d", utils.CalculateProcessTreeDepth(&processTree)), - }, + GeneratorURL: strfmt.URI(sourceUrl), + Labels: map[string]string{ + "alertname": "KubescapeRuleViolated", + "rule_name": failedRule.GetBaseRuntimeAlert().AlertName, + "rule_id": failedRule.GetRuleId(), + "container_id": failedRule.GetRuntimeAlertK8sDetails().ContainerID, + "container_name": failedRule.GetRuntimeAlertK8sDetails().ContainerName, + "namespace": failedRule.GetRuntimeAlertK8sDetails().Namespace, + "pod_name": failedRule.GetRuntimeAlertK8sDetails().PodName, + "pod_uid": failedRule.GetRuntimeAlertK8sDetails().PodUID, + "workload_uid": failedRule.GetRuntimeAlertK8sDetails().WorkloadUID, + "host": ame.Host, + "node_name": ame.NodeName, + "severity": strconv.Itoa(failedRule.GetBaseRuntimeAlert().Severity), + "pid": fmt.Sprintf("%d", process.PID), + "ppid": fmt.Sprintf("%d", process.PPID), + "pcomm": process.Pcomm, + "comm": process.Comm, + "uid": fmt.Sprintf("%d", process.Uid), + "gid": fmt.Sprintf("%d", process.Gid), + "trace": trace, + "fail_on_profile": fmt.Sprintf("%t", failOnProfile), + "profile_status": completedStatus, + "processtree_depth": fmt.Sprintf("%d", utils.CalculateProcessTreeDepth(&processTree)), }, } @@ -154,27 +152,25 @@ func (ame *AlertManagerExporter) SendMalwareAlert(malwareResult malwaremanager.M "description": malwareResult.GetMalwareRuntimeAlert().MalwareDescription, "fix": "Remove the malware from the container", }, - Alert: models.Alert{ - GeneratorURL: strfmt.URI("https://armosec.github.io/kubecop/alertviewer/"), - Labels: map[string]string{ - "alertname": "KubescapeMalwareDetected", - "malware_name": malwareResult.GetBasicRuntimeAlert().AlertName, - "container_id": malwareResult.GetTriggerEvent().GetContainerID(), - "container_name": malwareResult.GetTriggerEvent().GetContainer(), - "namespace": malwareResult.GetTriggerEvent().GetNamespace(), - "pod_name": malwareResult.GetTriggerEvent().GetPod(), - "pod_uid": malwareResult.GetRuntimeAlertK8sDetails().PodUID, - "workload_uid": malwareResult.GetRuntimeAlertK8sDetails().WorkloadUID, - "size": malwareResult.GetBasicRuntimeAlert().Size, - "md5hash": malwareResult.GetBasicRuntimeAlert().MD5Hash, - "sha256hash": malwareResult.GetBasicRuntimeAlert().SHA256Hash, - "sha1hash": malwareResult.GetBasicRuntimeAlert().SHA1Hash, - "container_image": malwareResult.GetTriggerEvent().GetContainerImage(), - "container_image_digest": malwareResult.GetTriggerEvent().GetContainerImageDigest(), - "severity": "critical", - "host": ame.Host, - "node_name": ame.NodeName, - }, + GeneratorURL: strfmt.URI("https://armosec.github.io/kubecop/alertviewer/"), + Labels: map[string]string{ + "alertname": "KubescapeMalwareDetected", + "malware_name": malwareResult.GetBasicRuntimeAlert().AlertName, + "container_id": malwareResult.GetTriggerEvent().GetContainerID(), + "container_name": malwareResult.GetTriggerEvent().GetContainer(), + "namespace": malwareResult.GetTriggerEvent().GetNamespace(), + "pod_name": malwareResult.GetTriggerEvent().GetPod(), + "pod_uid": malwareResult.GetRuntimeAlertK8sDetails().PodUID, + "workload_uid": malwareResult.GetRuntimeAlertK8sDetails().WorkloadUID, + "size": malwareResult.GetBasicRuntimeAlert().Size, + "md5hash": malwareResult.GetBasicRuntimeAlert().MD5Hash, + "sha256hash": malwareResult.GetBasicRuntimeAlert().SHA256Hash, + "sha1hash": malwareResult.GetBasicRuntimeAlert().SHA1Hash, + "container_image": malwareResult.GetTriggerEvent().GetContainerImage(), + "container_image_digest": malwareResult.GetTriggerEvent().GetContainerImageDigest(), + "severity": "critical", + "host": ame.Host, + "node_name": ame.NodeName, }, } diff --git a/pkg/exporters/alert_manager_test.go b/pkg/exporters/alert_manager_test.go index b1802cec3e..15b351f27e 100644 --- a/pkg/exporters/alert_manager_test.go +++ b/pkg/exporters/alert_manager_test.go @@ -53,13 +53,13 @@ func TestSendAlert(t *testing.T) { bytesData := <-receivedData // Assert the request body is correct - var alerts []map[string]interface{} + var alerts []map[string]any if err := json.Unmarshal(bytesData, &alerts); err != nil { t.Fatalf("Failed to unmarshal request body: %v", err) } assert.Equal(t, 1, len(alerts)) alert := alerts[0] - alertLabels := alert["labels"].(map[string]interface{}) + alertLabels := alert["labels"].(map[string]any) assert.Equal(t, "KubescapeRuleViolated", alertLabels["alertname"]) assert.Equal(t, "testrule", alertLabels["rule_name"]) assert.Equal(t, "testcontainerid", alertLabels["container_id"]) @@ -68,8 +68,8 @@ func TestSendAlert(t *testing.T) { assert.Equal(t, "testpodname", alertLabels["pod_name"]) assert.Equal(t, "", alertLabels["node_name"]) assert.Equal(t, "0", alertLabels["severity"]) - assert.Equal(t, "Rule 'testrule' in 'testpodname' namespace 'testnamespace' failed", alert["annotations"].(map[string]interface{})["summary"]) - assert.Equal(t, "Application profile is missing", alert["annotations"].(map[string]interface{})["message"]) + assert.Equal(t, "Rule 'testrule' in 'testpodname' namespace 'testnamespace' failed", alert["annotations"].(map[string]any)["summary"]) + assert.Equal(t, "Application profile is missing", alert["annotations"].(map[string]any)["message"]) assert.Equal(t, strings.HasPrefix(fmt.Sprint(alert["generatorURL"]), "https://armosec.github.io/kubecop/alertviewer/"), true) } @@ -114,13 +114,13 @@ func TestSendMalwareAlert(t *testing.T) { bytesData := <-receivedData // Assert the request body is correct - var alerts []map[string]interface{} + var alerts []map[string]any if err := json.Unmarshal(bytesData, &alerts); err != nil { t.Fatalf("Failed to unmarshal request body: %v", err) } assert.Equal(t, 1, len(alerts)) alert := alerts[0] - alertLabels := alert["labels"].(map[string]interface{}) + alertLabels := alert["labels"].(map[string]any) assert.Equal(t, "KubescapeMalwareDetected", alertLabels["alertname"]) assert.Equal(t, "testmalwarecontainerid", alertLabels["container_id"]) assert.Equal(t, "testmalwarecontainername", alertLabels["container_name"]) diff --git a/pkg/exporters/http_exporter.go b/pkg/exporters/http_exporter.go index be655bd84e..dfd2e8f932 100644 --- a/pkg/exporters/http_exporter.go +++ b/pkg/exporters/http_exporter.go @@ -410,7 +410,7 @@ func (e *HTTPExporter) getCloudMetadata(cloudServices []string) armotypes.CloudM return metadata } -func (e *HTTPExporter) sendHTTPRequest(ctx context.Context, payload interface{}) error { +func (e *HTTPExporter) sendHTTPRequest(ctx context.Context, payload any) error { body, err := json.Marshal(payload) if err != nil { return fmt.Errorf("failed to marshal payload: %w", err) @@ -524,15 +524,11 @@ func (e *HTTPExporter) sendAlertLimitReached(ctx context.Context) error { HostName: e.host, AlertType: armotypes.AlertTypeRule, AlertSourcePlatform: e.alertSourcePlatform, - BaseRuntimeAlert: armotypes.BaseRuntimeAlert{ - AlertName: string(AlertTypeLimitReached), - // Severity: ruleengine.RulePrioritySystemIssue, - FixSuggestions: "Check logs for more information", - }, - RuntimeAlertK8sDetails: armotypes.RuntimeAlertK8sDetails{ - NodeName: e.nodeName, - ClusterName: e.clusterName, - }, + AlertName: string(AlertTypeLimitReached), + // Severity: ruleengine.RulePrioritySystemIssue, + FixSuggestions: "Check logs for more information", + NodeName: e.nodeName, + ClusterName: e.clusterName, } e.alertMetrics.Lock() diff --git a/pkg/fimmanager/fim_manager.go b/pkg/fimmanager/fim_manager.go index af94245237..abc35ec09b 100644 --- a/pkg/fimmanager/fim_manager.go +++ b/pkg/fimmanager/fim_manager.go @@ -123,8 +123,8 @@ func (fm *FIMManager) IsRunning() bool { } // GetStatus returns the current status of the FIM manager -func (fm *FIMManager) GetStatus() map[string]interface{} { - status := map[string]interface{}{ +func (fm *FIMManager) GetStatus() map[string]any { + status := map[string]any{ "enabled": fm.cfg.EnableFIM, "running": fm.running, "directories": len(fm.cfg.FIM.Directories), diff --git a/pkg/hostfimsensor/v1/filetree/comparator.go b/pkg/hostfimsensor/v1/filetree/comparator.go index 2952e04bc7..1e7c0a9555 100644 --- a/pkg/hostfimsensor/v1/filetree/comparator.go +++ b/pkg/hostfimsensor/v1/filetree/comparator.go @@ -476,9 +476,9 @@ func (tc *TreeComparator) stripHostPath(filePath, hostPath string) string { } // Check if the file path starts with the host path - if strings.HasPrefix(normalizedFilePath, normalizedHostPath) { + if after, ok := strings.CutPrefix(normalizedFilePath, normalizedHostPath); ok { // Remove the host path prefix but keep any leading slash - stripped := strings.TrimPrefix(normalizedFilePath, normalizedHostPath) + stripped := after if !strings.HasPrefix(stripped, "/") { stripped = "/" + stripped } diff --git a/pkg/hostfimsensor/v1/filetree/filetree.go b/pkg/hostfimsensor/v1/filetree/filetree.go index 031c47e86f..313e10cca6 100644 --- a/pkg/hostfimsensor/v1/filetree/filetree.go +++ b/pkg/hostfimsensor/v1/filetree/filetree.go @@ -1,6 +1,7 @@ package filetree import ( + "maps" "os" "path/filepath" "strings" @@ -95,9 +96,7 @@ func (n *FileNode) GetChildren() map[string]*FileNode { defer n.mu.RUnlock() children := make(map[string]*FileNode) - for name, child := range n.Children { - children[name] = child - } + maps.Copy(children, n.Children) return children } diff --git a/pkg/hostfimsensor/v1/fimsensor_fanotify.go b/pkg/hostfimsensor/v1/fimsensor_fanotify.go index 4844a2da89..566494a8f1 100644 --- a/pkg/hostfimsensor/v1/fimsensor_fanotify.go +++ b/pkg/hostfimsensor/v1/fimsensor_fanotify.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package hostfimsensor @@ -155,8 +154,8 @@ func (h *HostFimSensorFanotify) getFanotifyEventTypes(config HostFimPathConfig) // stripHostPath removes the host path prefix from a file path func (h *HostFimSensorFanotify) stripHostPath(fullPath string) string { // Remove the host path prefix to get the actual host path - if strings.HasPrefix(fullPath, h.hostPath) { - relativePath := strings.TrimPrefix(fullPath, h.hostPath) + if after, ok := strings.CutPrefix(fullPath, h.hostPath); ok { + relativePath := after // Ensure the path starts with "/" for absolute paths if !strings.HasPrefix(relativePath, "/") { relativePath = "/" + relativePath diff --git a/pkg/hostfimsensor/v1/fimsensor_fanotify_test.go b/pkg/hostfimsensor/v1/fimsensor_fanotify_test.go index 601a380fb4..760b808f59 100644 --- a/pkg/hostfimsensor/v1/fimsensor_fanotify_test.go +++ b/pkg/hostfimsensor/v1/fimsensor_fanotify_test.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package hostfimsensor diff --git a/pkg/hostfimsensor/v1/fimsensor_periodic_test.go b/pkg/hostfimsensor/v1/fimsensor_periodic_test.go index 30ed98443a..4c2c946c15 100644 --- a/pkg/hostfimsensor/v1/fimsensor_periodic_test.go +++ b/pkg/hostfimsensor/v1/fimsensor_periodic_test.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package hostfimsensor diff --git a/pkg/hostfimsensor/v1/fimsensor_test.go b/pkg/hostfimsensor/v1/fimsensor_test.go index de684642be..803dfe26ba 100644 --- a/pkg/hostfimsensor/v1/fimsensor_test.go +++ b/pkg/hostfimsensor/v1/fimsensor_test.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package hostfimsensor @@ -85,7 +84,7 @@ func TestHostFimSensor_CreateFileTriggersExporter(t *testing.T) { f.Close() found := false - for i := 0; i < 20; i++ { + for range 20 { time.Sleep(100 * time.Millisecond) mockExp.mu.Lock() for _, evt := range mockExp.fimEvents { @@ -163,7 +162,7 @@ func TestHostFimSensor_CreateNestedFileTriggersExporter(t *testing.T) { // Wait for the event to be picked up (fsnotify is async) found := false - for i := 0; i < 20; i++ { + for range 20 { time.Sleep(100 * time.Millisecond) mockExp.mu.Lock() for _, evt := range mockExp.fimEvents { @@ -232,7 +231,7 @@ func TestHostFimSensor_Batching(t *testing.T) { defer sensor.Stop() // Create 3 files to trigger batch sending - for i := 0; i < 3; i++ { + for i := range 3 { testFile := filepath.Join(tmpDir, fmt.Sprintf("testfile%d.txt", i)) f, err := os.Create(testFile) if err != nil { @@ -346,7 +345,7 @@ func TestHostFimSensor_Batching(t *testing.T) { defer sensor.Stop() // Create 4 files rapidly to test parallel batch sending - for i := 0; i < 4; i++ { + for i := range 4 { testFile := filepath.Join(tmpDir, fmt.Sprintf("parallel_test%d.txt", i)) f, err := os.Create(testFile) if err != nil { diff --git a/pkg/hostsensormanager/crd_client.go b/pkg/hostsensormanager/crd_client.go index e65e223f12..137a400493 100644 --- a/pkg/hostsensormanager/crd_client.go +++ b/pkg/hostsensormanager/crd_client.go @@ -42,7 +42,7 @@ func NewCRDClient(nodeName string) (*CRDClient, error) { } // CreateOrUpdateHostData creates or updates a host data CRD -func (c *CRDClient) CreateOrUpdateHostData(ctx context.Context, resource string, kind string, spec interface{}) error { +func (c *CRDClient) CreateOrUpdateHostData(ctx context.Context, resource string, kind string, spec any) error { gvr := schema.GroupVersionResource{ Group: HostDataGroup, Version: HostDataVersion, @@ -51,14 +51,14 @@ func (c *CRDClient) CreateOrUpdateHostData(ctx context.Context, resource string, // Create the unstructured object unstructuredObj := &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": fmt.Sprintf("%s/%s", HostDataGroup, HostDataVersion), "kind": kind, - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": c.nodeName, }, "spec": spec, - "status": map[string]interface{}{ + "status": map[string]any{ "lastSensed": metav1.Now().UTC().Format(time.RFC3339), }, }, @@ -112,7 +112,7 @@ func (c *CRDClient) UpdateStatus(ctx context.Context, resource string, errorMsg Resource: resource, } - patchData, err := json.Marshal(map[string]interface{}{ + patchData, err := json.Marshal(map[string]any{ "status": Status{ LastSensed: metav1.Now(), Error: errorMsg, @@ -131,7 +131,7 @@ func (c *CRDClient) UpdateStatus(ctx context.Context, resource string, errorMsg } // toUnstructured converts a typed object to unstructured -func toUnstructured(obj interface{}) (*unstructured.Unstructured, error) { +func toUnstructured(obj any) (*unstructured.Unstructured, error) { data, err := json.Marshal(obj) if err != nil { return nil, err diff --git a/pkg/hostsensormanager/sensor_cloudprovider.go b/pkg/hostsensormanager/sensor_cloudprovider.go index 829ebdbd46..e45e09fb74 100644 --- a/pkg/hostsensormanager/sensor_cloudprovider.go +++ b/pkg/hostsensormanager/sensor_cloudprovider.go @@ -30,7 +30,7 @@ func (s *CloudProviderInfoSensor) GetPluralKind() string { } // Sense collects the cloud provider info data from the host -func (s *CloudProviderInfoSensor) Sense() (interface{}, error) { +func (s *CloudProviderInfoSensor) Sense() (any, error) { ret := CloudProviderInfoSpec{ ProviderMetaDataAPIAccess: s.hasMetaDataAPIAccess(), NodeName: s.nodeName, diff --git a/pkg/hostsensormanager/sensor_cni.go b/pkg/hostsensormanager/sensor_cni.go index 8fe8a2b7bf..b34a4a38f6 100644 --- a/pkg/hostsensormanager/sensor_cni.go +++ b/pkg/hostsensormanager/sensor_cni.go @@ -30,7 +30,7 @@ func (s *CNIInfoSensor) GetPluralKind() string { } // Sense collects the CNI info data from the host -func (s *CNIInfoSensor) Sense() (interface{}, error) { +func (s *CNIInfoSensor) Sense() (any, error) { ctx := context.Background() ret := CNIInfoSpec{ NodeName: s.nodeName, diff --git a/pkg/hostsensormanager/sensor_controlplane.go b/pkg/hostsensormanager/sensor_controlplane.go index 2a5b87c6b6..8c108cfd9e 100644 --- a/pkg/hostsensormanager/sensor_controlplane.go +++ b/pkg/hostsensormanager/sensor_controlplane.go @@ -45,7 +45,7 @@ func (s *ControlPlaneInfoSensor) GetPluralKind() string { } // Sense collects the control plane info data from the host -func (s *ControlPlaneInfoSensor) Sense() (interface{}, error) { +func (s *ControlPlaneInfoSensor) Sense() (any, error) { ctx := context.Background() ret := ControlPlaneInfoSpec{ NodeName: s.nodeName, @@ -54,10 +54,8 @@ func (s *ControlPlaneInfoSensor) Sense() (interface{}, error) { // API Server if proc, err := LocateProcessByExecSuffix(apiServerExe); err == nil { ret.APIServerInfo = &ApiServerInfo{ - ProcessInfo: ProcessInfo{ - CmdLine: proc.RawCmd(), - SpecsFile: makeHostFileInfoVerbose(ctx, apiServerSpecsPath, false), - }, + CmdLine: proc.RawCmd(), + SpecsFile: makeHostFileInfoVerbose(ctx, apiServerSpecsPath, false), AuditPolicyFile: makeContaineredFileInfoVerbose(ctx, proc, auditPolicyFileArg, false), } } diff --git a/pkg/hostsensormanager/sensor_kernelvars.go b/pkg/hostsensormanager/sensor_kernelvars.go index 3619ab6286..688d0c8236 100644 --- a/pkg/hostsensormanager/sensor_kernelvars.go +++ b/pkg/hostsensormanager/sensor_kernelvars.go @@ -39,7 +39,7 @@ func (s *LinuxKernelVariablesSensor) GetPluralKind() string { } // Sense collects the kernel variables data from the host -func (s *LinuxKernelVariablesSensor) Sense() (interface{}, error) { +func (s *LinuxKernelVariablesSensor) Sense() (any, error) { hProcSysKernelDir := hostPath(procSysKernelDir) procDir, err := os.Open(hProcSysKernelDir) if err != nil { diff --git a/pkg/hostsensormanager/sensor_kernelversion.go b/pkg/hostsensormanager/sensor_kernelversion.go index 04130578ac..795bfaab80 100644 --- a/pkg/hostsensormanager/sensor_kernelversion.go +++ b/pkg/hostsensormanager/sensor_kernelversion.go @@ -34,7 +34,7 @@ func (s *KernelVersionSensor) GetPluralKind() string { } // Sense collects the kernel version data from the host -func (s *KernelVersionSensor) Sense() (interface{}, error) { +func (s *KernelVersionSensor) Sense() (any, error) { content, err := readFileOnHostFileSystem(path.Join(procDirName, kernelVersionFileName)) if err != nil { return nil, fmt.Errorf("failed to read kernel version file: %w", err) diff --git a/pkg/hostsensormanager/sensor_kubelet.go b/pkg/hostsensormanager/sensor_kubelet.go index dafb165773..ede78d9711 100644 --- a/pkg/hostsensormanager/sensor_kubelet.go +++ b/pkg/hostsensormanager/sensor_kubelet.go @@ -76,7 +76,7 @@ func (s *KubeletInfoSensor) GetPluralKind() string { } // Sense collects the kubelet info data from the host -func (s *KubeletInfoSensor) Sense() (interface{}, error) { +func (s *KubeletInfoSensor) Sense() (any, error) { ctx := context.Background() ret := KubeletInfoSpec{ NodeName: s.nodeName, diff --git a/pkg/hostsensormanager/sensor_kubeproxy.go b/pkg/hostsensormanager/sensor_kubeproxy.go index bd4ba2784b..9cec54455e 100644 --- a/pkg/hostsensormanager/sensor_kubeproxy.go +++ b/pkg/hostsensormanager/sensor_kubeproxy.go @@ -35,7 +35,7 @@ func (s *KubeProxyInfoSensor) GetPluralKind() string { } // Sense collects the kube-proxy info data from the host -func (s *KubeProxyInfoSensor) Sense() (interface{}, error) { +func (s *KubeProxyInfoSensor) Sense() (any, error) { ctx := context.Background() ret := KubeProxyInfoSpec{ NodeName: s.nodeName, diff --git a/pkg/hostsensormanager/sensor_network.go b/pkg/hostsensormanager/sensor_network.go index bbb367f746..88f74a6fac 100644 --- a/pkg/hostsensormanager/sensor_network.go +++ b/pkg/hostsensormanager/sensor_network.go @@ -43,7 +43,7 @@ func (s *OpenPortsSensor) GetPluralKind() string { } // Sense collects the open ports data from the host -func (s *OpenPortsSensor) Sense() (interface{}, error) { +func (s *OpenPortsSensor) Sense() (any, error) { res := &OpenPortsSpec{ TcpPorts: make([]Connection, 0), UdpPorts: make([]Connection, 0), diff --git a/pkg/hostsensormanager/sensor_osrelease.go b/pkg/hostsensormanager/sensor_osrelease.go index cf354361e5..58e5665840 100644 --- a/pkg/hostsensormanager/sensor_osrelease.go +++ b/pkg/hostsensormanager/sensor_osrelease.go @@ -38,7 +38,7 @@ func (s *OsReleaseSensor) GetPluralKind() string { } // Sense collects the OS release data from the host -func (s *OsReleaseSensor) Sense() (interface{}, error) { +func (s *OsReleaseSensor) Sense() (any, error) { osFileName, err := s.getOsReleaseFile() if err != nil { return nil, fmt.Errorf("failed to find os-release file: %w", err) diff --git a/pkg/hostsensormanager/sensor_security.go b/pkg/hostsensormanager/sensor_security.go index 9ebf991043..d0ce64b417 100644 --- a/pkg/hostsensormanager/sensor_security.go +++ b/pkg/hostsensormanager/sensor_security.go @@ -34,7 +34,7 @@ func (s *LinuxSecurityHardeningSensor) GetPluralKind() string { } // Sense collects the security hardening data from the host -func (s *LinuxSecurityHardeningSensor) Sense() (interface{}, error) { +func (s *LinuxSecurityHardeningSensor) Sense() (any, error) { return &LinuxSecurityHardeningSpec{ AppArmor: s.getAppArmorStatus(), SeLinux: s.getSELinuxStatus(), diff --git a/pkg/hostsensormanager/types.go b/pkg/hostsensormanager/types.go index c9a08e5c81..7e5df3c871 100644 --- a/pkg/hostsensormanager/types.go +++ b/pkg/hostsensormanager/types.go @@ -24,7 +24,7 @@ type HostSensorManager interface { // Sensor represents a single host sensor that can collect data type Sensor interface { // Sense collects the data from the host - Sense() (interface{}, error) + Sense() (any, error) // GetKind returns the CRD kind for this sensor GetKind() string // GetPluralKind returns the plural and lowercase form of CRD kind for this sensor @@ -33,7 +33,7 @@ type Sensor interface { // Status contains status information about the sensing (common for all host data CRDs) type Status struct { - LastSensed metav1.Time `json:"lastSensed,omitempty"` + LastSensed metav1.Time `json:"lastSensed"` Error string `json:"error,omitempty"` } @@ -75,10 +75,10 @@ type Connection struct { // OsReleaseFile represents the CRD structure for OS release data type OsReleaseFile struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec OsReleaseFileSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec OsReleaseFileSpec `json:"spec"` + Status Status `json:"status"` } // OsReleaseFileSpec contains the actual OS release file content @@ -92,10 +92,10 @@ type OsReleaseFileSpec struct { // KernelVersion represents the CRD structure for kernel version data type KernelVersion struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec KernelVersionSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec KernelVersionSpec `json:"spec"` + Status Status `json:"status"` } type KernelVersionSpec struct { @@ -108,10 +108,10 @@ type KernelVersionSpec struct { // LinuxSecurityHardening represents the CRD structure for security hardening data type LinuxSecurityHardening struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec LinuxSecurityHardeningSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec LinuxSecurityHardeningSpec `json:"spec"` + Status Status `json:"status"` } type LinuxSecurityHardeningSpec struct { @@ -125,10 +125,10 @@ type LinuxSecurityHardeningSpec struct { // OpenPorts represents the CRD structure for open ports data type OpenPorts struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec OpenPortsSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec OpenPortsSpec `json:"spec"` + Status Status `json:"status"` } type OpenPortsSpec struct { @@ -143,10 +143,10 @@ type OpenPortsSpec struct { // LinuxKernelVariables represents the CRD structure for kernel variables data type LinuxKernelVariables struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec LinuxKernelVariablesSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec LinuxKernelVariablesSpec `json:"spec"` + Status Status `json:"status"` } type LinuxKernelVariablesSpec struct { @@ -159,10 +159,10 @@ type LinuxKernelVariablesSpec struct { // KubeletInfo represents the CRD structure for kubelet info data type KubeletInfo struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec KubeletInfoSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec KubeletInfoSpec `json:"spec"` + Status Status `json:"status"` } type KubeletInfoSpec struct { @@ -179,10 +179,10 @@ type KubeletInfoSpec struct { // KubeProxyInfo represents the CRD structure for kube-proxy info data type KubeProxyInfo struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec KubeProxyInfoSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec KubeProxyInfoSpec `json:"spec"` + Status Status `json:"status"` } type KubeProxyInfoSpec struct { @@ -196,10 +196,10 @@ type KubeProxyInfoSpec struct { // ControlPlaneInfo represents the CRD structure for control plane info data type ControlPlaneInfo struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec ControlPlaneInfoSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec ControlPlaneInfoSpec `json:"spec"` + Status Status `json:"status"` } type ControlPlaneInfoSpec struct { @@ -233,10 +233,10 @@ type ApiServerInfo struct { // CloudProviderInfo represents the CRD structure for cloud provider info data type CloudProviderInfo struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec CloudProviderInfoSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec CloudProviderInfoSpec `json:"spec"` + Status Status `json:"status"` } type CloudProviderInfoSpec struct { @@ -249,10 +249,10 @@ type CloudProviderInfoSpec struct { // CNIInfo represents the CRD structure for CNI info data type CNIInfo struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec CNIInfoSpec `json:"spec,omitempty"` - Status Status `json:"status,omitempty"` + Spec CNIInfoSpec `json:"spec"` + Status Status `json:"status"` } type CNIInfoSpec struct { diff --git a/pkg/k8sclient/k8sclient_mock.go b/pkg/k8sclient/k8sclient_mock.go index d9c93c7a0f..92157e6143 100644 --- a/pkg/k8sclient/k8sclient_mock.go +++ b/pkg/k8sclient/k8sclient_mock.go @@ -20,32 +20,32 @@ type K8sClientMock struct { var _ K8sClientInterface = (*K8sClientMock)(nil) func (k *K8sClientMock) GetWorkload(namespace, _, name string) (k8sinterface.IWorkload, error) { - return workloadinterface.NewWorkloadObj(map[string]interface{}{ + return workloadinterface.NewWorkloadObj(map[string]any{ "apiVersion": "v1", "kind": "Pod", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": name, "namespace": namespace, }, - "spec": map[string]interface{}{ - "containers": []interface{}{ - map[string]interface{}{ + "spec": map[string]any{ + "containers": []any{ + map[string]any{ "name": "log", "image": "fluentbit", }, - map[string]interface{}{ + map[string]any{ "name": "cont", "image": "nginx", }, }, }, - "status": map[string]interface{}{ - "containerStatuses": []interface{}{ - map[string]interface{}{ + "status": map[string]any{ + "containerStatuses": []any{ + map[string]any{ "name": "log", "imageID": storage.FluentBitImageID, }, - map[string]interface{}{ + map[string]any{ "name": "cont", "imageID": storage.NginxImageID, }, diff --git a/pkg/metricsmanager/otel/resource_metrics.go b/pkg/metricsmanager/otel/resource_metrics.go index a2e28cdd36..27d45b7d96 100644 --- a/pkg/metricsmanager/otel/resource_metrics.go +++ b/pkg/metricsmanager/otel/resource_metrics.go @@ -423,9 +423,9 @@ func readPodCgroupMem(ownContainerID, ownPodUID string, hostCgroupMounted bool) // /proc/self/cgroup and ok=true when that line is present (path may be "/", the // namespace root). ok=false means no cgroupv2 line (e.g. cgroupv1-only). func parseSelfCgroupV2(content string) (string, bool) { - for _, line := range strings.Split(content, "\n") { - if strings.HasPrefix(line, "0::") { - return strings.TrimPrefix(line, "0::"), true + for line := range strings.SplitSeq(content, "\n") { + if after, ok := strings.CutPrefix(line, "0::"); ok { + return after, true } } return "", false diff --git a/pkg/networkstream/v1/network_stream.go b/pkg/networkstream/v1/network_stream.go index 8c3017d110..df2e46064b 100644 --- a/pkg/networkstream/v1/network_stream.go +++ b/pkg/networkstream/v1/network_stream.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "net" "net/http" "strings" @@ -120,15 +121,13 @@ func (ns *NetworkStream) ContainerCallback(notif containercollection.PubSubEvent containerID = ns.nodeName } entity := armotypes.NetworkStreamEntity{ - Kind: armotypes.NetworkStreamEntityKindContainer, - NetworkStreamEntityContainer: armotypes.NetworkStreamEntityContainer{ - ContainerName: notif.Container.Runtime.ContainerName, - ContainerID: notif.Container.Runtime.ContainerID, - PodNamespace: notif.Container.K8s.Namespace, - PodName: notif.Container.K8s.PodName, - }, - Inbound: make(map[string]armotypes.NetworkStreamEvent), - Outbound: make(map[string]armotypes.NetworkStreamEvent), + Kind: armotypes.NetworkStreamEntityKindContainer, + ContainerName: notif.Container.Runtime.ContainerName, + ContainerID: notif.Container.Runtime.ContainerID, + PodNamespace: notif.Container.K8s.Namespace, + PodName: notif.Container.K8s.PodName, + Inbound: make(map[string]armotypes.NetworkStreamEvent), + Outbound: make(map[string]armotypes.NetworkStreamEvent), } // The watcher submits this callback to a worker pool, so the event path may // already have recorded traffic against this container — a new container's @@ -472,12 +471,10 @@ func (ns *NetworkStream) entityForEventLocked(containerID string) (armotypes.Net } entity := armotypes.NetworkStreamEntity{ - Kind: armotypes.NetworkStreamEntityKindContainer, - NetworkStreamEntityContainer: armotypes.NetworkStreamEntityContainer{ - ContainerID: entityID, - }, - Inbound: make(map[string]armotypes.NetworkStreamEvent), - Outbound: make(map[string]armotypes.NetworkStreamEvent), + Kind: armotypes.NetworkStreamEntityKindContainer, + ContainerID: entityID, + Inbound: make(map[string]armotypes.NetworkStreamEvent), + Outbound: make(map[string]armotypes.NetworkStreamEvent), } ns.networkEventsStorage.Entities[entityID] = entity ns.unannouncedEntities[entityID] = struct{}{} @@ -700,9 +697,7 @@ func snapshotNetworkStream(src *armotypes.NetworkStream) *armotypes.NetworkStrea func copyEvents(events map[string]armotypes.NetworkStreamEvent) map[string]armotypes.NetworkStreamEvent { out := make(map[string]armotypes.NetworkStreamEvent, len(events)) - for key, event := range events { - out[key] = event - } + maps.Copy(out, events) return out } diff --git a/pkg/networkstream/v1/wire_test.go b/pkg/networkstream/v1/wire_test.go index 4203d1e94a..73cd868c4e 100644 --- a/pkg/networkstream/v1/wire_test.go +++ b/pkg/networkstream/v1/wire_test.go @@ -119,7 +119,7 @@ func TestBuildWireStream_DeeperChainWins(t *testing.T) { // Repeated because map iteration order is randomised per range: the outcome // must not depend on which entry is visited first. - for i := 0; i < 32; i++ { + for range 32 { snapshot := outboundOnly("c1", map[string]armotypes.NetworkStreamEvent{ "1.2.3.4/443/TCP/101/5000000000": {ProcessRef: ref, ProcessTree: shallow}, "9.9.9.9/53/UDP/101/5000000000": {ProcessRef: ref, ProcessTree: deep}, @@ -299,14 +299,11 @@ func TestCapCmdline(t *testing.T) { // produces a ~1.2 KB tree however large a size it is asked for. func bigTree(pid uint32, sizeBytes int) *armotypes.ProcessTree { const perNode = processNodeOverheadBytes + maxCmdlineBytes - nodes := (sizeBytes + perNode - 1) / perNode - if nodes < 1 { - nodes = 1 - } + nodes := max((sizeBytes+perNode-1)/perNode, 1) cmdline := strings.Repeat("a", maxCmdlineBytes) var root, prev *armotypes.Process - for i := 0; i < nodes; i++ { + for i := range nodes { // The leaf carries the process's own pid; ancestors get synthetic ones. nodePID := pid if i < nodes-1 { @@ -423,7 +420,7 @@ func TestSelectProcessTrees_IsDeterministic(t *testing.T) { } sort.Strings(firstRefs) - for i := 0; i < 12; i++ { + for range 12 { again := build() refs := make([]string, 0, len(again)) for ref := range again { @@ -446,7 +443,7 @@ func TestSelectProcessTrees_PrefersSmallestTrees(t *testing.T) { } // Chatty processes with large trees that together blow the budget. for pid := uint32(100); pid < 1100; pid++ { - for c := 0; c < 5; c++ { + for c := range 5 { ref := &armotypes.ProcessRef{PID: pid, StartTimeNs: 10_000_000} events[fmt.Sprintf("10.3.%d.%d/%d/TCP/%d/10000000", pid/256, pid%256, c, pid)] = armotypes.NetworkStreamEvent{ProcessRef: ref, ProcessTree: bigTree(pid, 12288)} @@ -468,7 +465,7 @@ func TestSelectProcessTrees_PrefersSmallestTrees(t *testing.T) { func TestSelectProcessTrees_OversizedTreeIsExcluded(t *testing.T) { huge := armotypes.ProcessRef{PID: 1, StartTimeNs: 10_000_000} oversized := &armotypes.Process{PID: 1, Comm: "p", ChildrenMap: map[armotypes.CommPID]*armotypes.Process{}} - for i := 0; i < 4000; i++ { + for i := range 4000 { child := &armotypes.Process{PID: uint32(10_000 + i), Comm: "p", Cmdline: strings.Repeat("a", maxCmdlineBytes), ChildrenMap: map[armotypes.CommPID]*armotypes.Process{}} oversized.ChildrenMap[armotypes.CommPID{Comm: child.Comm, PID: child.PID}] = child @@ -581,7 +578,7 @@ const escapeHeavyComm = "<<<<<<<<<<<<<<<" func escapeHeavyCommTree(children int) *armotypes.ProcessTree { root := realisticNode(1, "sh") - for i := 0; i < children; i++ { + for i := range children { child := realisticNode(uint32(1000+i), "/usr/bin/curl https://example.com") child.Comm = escapeHeavyComm root.ChildrenMap[armotypes.CommPID{Comm: child.Comm, PID: child.PID}] = child @@ -591,7 +588,7 @@ func escapeHeavyCommTree(children int) *armotypes.ProcessTree { func escapeHeavyCommLegacyTree(children int) *armotypes.ProcessTree { root := realisticNode(1, "sh") - for i := 0; i < children; i++ { + for i := range children { child := realisticNode(uint32(1000+i), "/usr/bin/curl https://example.com") child.Comm = escapeHeavyComm root.Children = append(root.Children, *child) @@ -601,7 +598,7 @@ func escapeHeavyCommLegacyTree(children int) *armotypes.ProcessTree { func unboundedCommTree(children, commBytes int) *armotypes.ProcessTree { root := realisticNode(1, "sh") - for i := 0; i < children; i++ { + for i := range children { child := realisticNode(uint32(1000+i), "/usr/bin/curl https://example.com") child.Comm = strings.Repeat("<", commBytes) root.ChildrenMap[armotypes.CommPID{Comm: child.Comm, PID: child.PID}] = child @@ -611,7 +608,7 @@ func unboundedCommTree(children, commBytes int) *armotypes.ProcessTree { func unboundedCommLegacyTree(children, commBytes int) *armotypes.ProcessTree { root := realisticNode(1, "sh") - for i := 0; i < children; i++ { + for i := range children { child := realisticNode(uint32(1000+i), "/usr/bin/curl https://example.com") child.Comm = strings.Repeat("<", commBytes) root.Children = append(root.Children, *child) @@ -621,7 +618,7 @@ func unboundedCommLegacyTree(children, commBytes int) *armotypes.ProcessTree { func escapeHeavyCommChain(nodes int) *armotypes.ProcessTree { var root, prev *armotypes.Process - for i := 0; i < nodes; i++ { + for i := range nodes { node := realisticNode(uint32(100+i), "/usr/bin/curl https://example.com") node.Comm = escapeHeavyComm if prev == nil { @@ -641,7 +638,7 @@ func escapeHeavyCommChain(nodes int) *armotypes.ProcessTree { func TestEstimateTreeBytes_NeverUnderestimates(t *testing.T) { deepChain := func(nodes int, cmdline string) *armotypes.Process { var root, prev *armotypes.Process - for i := 0; i < nodes; i++ { + for i := range nodes { node := realisticNode(uint32(100+i), cmdline) if prev == nil { root = node @@ -653,7 +650,7 @@ func TestEstimateTreeBytes_NeverUnderestimates(t *testing.T) { return root } wide := realisticNode(1, "sh") - for i := 0; i < 50; i++ { + for i := range 50 { child := realisticNode(uint32(1000+i), "worker --shard= & echo \"done\"") wide.ChildrenMap[armotypes.CommPID{Comm: child.Comm, PID: child.PID}] = child } @@ -762,7 +759,7 @@ func TestEstimateTreeBytes_NeverUnderestimatesRandom(t *testing.T) { return string(b) } - for i := 0; i < 400; i++ { + for i := range 400 { node := &armotypes.Process{ PID: uint32(rng.Intn(1 << 20)), PPID: uint32(rng.Intn(1 << 20)), Comm: randomBytes(rng.Intn(24)), Pcomm: randomBytes(rng.Intn(24)), @@ -781,7 +778,7 @@ func TestEstimateTreeBytes_NeverUnderestimatesRandom(t *testing.T) { // which skews the distribution badly (5 children becomes ~1.5% likely instead of // ~16.7%) and starves the high-fan-out cases this generator exists to reach. children := rng.Intn(6) - for c := 0; c < children; c++ { + for range children { uid, gid := uint32(rng.Intn(70000)), uint32(rng.Intn(70000)) upper := rng.Intn(2) == 0 child := &armotypes.Process{ diff --git a/pkg/nodeprofilemanager/nodeprofile_manager_interface.go b/pkg/nodeprofilemanager/nodeprofile_manager_interface.go index 30f56cd697..ddda45a293 100644 --- a/pkg/nodeprofilemanager/nodeprofile_manager_interface.go +++ b/pkg/nodeprofilemanager/nodeprofile_manager_interface.go @@ -1,9 +1,9 @@ package nodeprofilemanager import ( - "golang.org/x/net/context" + context0 "context" ) type NodeProfileManagerClient interface { - Start(ctx context.Context) + Start(ctx context0.Context) } diff --git a/pkg/nodeprofilemanager/v1/nodeprofile_manager.go b/pkg/nodeprofilemanager/v1/nodeprofile_manager.go index 7782c9945c..ce7b579332 100644 --- a/pkg/nodeprofilemanager/v1/nodeprofile_manager.go +++ b/pkg/nodeprofilemanager/v1/nodeprofile_manager.go @@ -2,6 +2,7 @@ package nodeprofilemanager import ( "bytes" + context0 "context" "encoding/json" "fmt" "io" @@ -22,7 +23,6 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - "golang.org/x/net/context" v1 "k8s.io/api/core/v1" ) @@ -59,7 +59,7 @@ func NewNodeProfileManager(config config.Config, clusterData armometadata.Cluste var _ nodeprofilemanager.NodeProfileManagerClient = (*NodeProfileManager)(nil) -func (n *NodeProfileManager) Start(ctx context.Context) { +func (n *NodeProfileManager) Start(ctx context0.Context) { go func() { time.Sleep(utils.AddJitter(n.config.InitialDelay, n.config.MaxJitterPercentage)) for { diff --git a/pkg/nodeprofilemanager/v1/nodeprofile_manager_test.go b/pkg/nodeprofilemanager/v1/nodeprofile_manager_test.go index f634740393..e1a181e5fd 100644 --- a/pkg/nodeprofilemanager/v1/nodeprofile_manager_test.go +++ b/pkg/nodeprofilemanager/v1/nodeprofile_manager_test.go @@ -367,11 +367,9 @@ func TestGetProfile_AppLabel(t *testing.T) { k8sCache := &localK8sCache{ pods: []*corev1.Pod{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "default", - Labels: tt.labels, - }, + Name: "test-pod", + Namespace: "default", + Labels: tt.labels, }, }, } @@ -563,10 +561,8 @@ func TestGetEphemeralContainers(t *testing.T) { t.Run("ephemeral containers", func(t *testing.T) { containers := []corev1.EphemeralContainer{ { - EphemeralContainerCommon: corev1.EphemeralContainerCommon{ - Name: "debug", - Image: "busybox:latest", - }, + Name: "debug", + Image: "busybox:latest", }, } statuses := map[string]corev1.ContainerStatus{ diff --git a/pkg/objectcache/callstackcache/callstackcache_test.go b/pkg/objectcache/callstackcache/callstackcache_test.go index 85f72683c5..b57f7e349a 100644 --- a/pkg/objectcache/callstackcache/callstackcache_test.go +++ b/pkg/objectcache/callstackcache/callstackcache_test.go @@ -142,7 +142,7 @@ func TestCallStackSearchTreeBranching(t *testing.T) { {"2918313636494991837", "867979"}, } - for i := 0; i < len(expectedFrames); i++ { + for i := range expectedFrames { expected := expectedFrames[i] fmt.Printf("\nVerifying depth %d:\n", i) fmt.Printf("Current frame: {%s %s}\n", current.Frame.FileID, current.Frame.Lineno) diff --git a/pkg/objectcache/containerprofilecache/authored_container_section_test.go b/pkg/objectcache/containerprofilecache/authored_container_section_test.go index fac0da430a..ded6ade10a 100644 --- a/pkg/objectcache/containerprofilecache/authored_container_section_test.go +++ b/pkg/objectcache/containerprofilecache/authored_container_section_test.go @@ -16,13 +16,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) func groupedDoc() *v1beta1.ContainerProfile { return &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "mc-doc", Namespace: "default", ResourceVersion: "1"}, + Name: "mc-doc", Namespace: "default", ResourceVersion: "1", Spec: v1beta1.ContainerProfileSpec{ Architectures: []string{"amd64"}, Containers: []v1beta1.ContainerProfileContainer{ @@ -47,7 +46,7 @@ func TestResolveAuthoredContainerSection(t *testing.T) { t.Run("flat document passes through unchanged", func(t *testing.T) { flat := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "flat", Namespace: "default"}, + Name: "flat", Namespace: "default", Spec: v1beta1.ContainerProfileSpec{ Execs: []v1beta1.ExecCalls{{Path: "/bin/only"}}, }, diff --git a/pkg/objectcache/containerprofilecache/containerprofilecache.go b/pkg/objectcache/containerprofilecache/containerprofilecache.go index c0a316ff20..0149262aea 100644 --- a/pkg/objectcache/containerprofilecache/containerprofilecache.go +++ b/pkg/objectcache/containerprofilecache/containerprofilecache.go @@ -730,7 +730,7 @@ func (c *ContainerProfileCacheImpl) NotifyContainerCompleted(containerID string) return } go func() { - for i := 0; i < 20; i++ { + for i := range 20 { if i > 0 { time.Sleep(3 * time.Second) } diff --git a/pkg/objectcache/containerprofilecache/containerprofilecache_test.go b/pkg/objectcache/containerprofilecache/containerprofilecache_test.go index d2eef13649..f8cd1f2a1e 100644 --- a/pkg/objectcache/containerprofilecache/containerprofilecache_test.go +++ b/pkg/objectcache/containerprofilecache/containerprofilecache_test.go @@ -18,7 +18,6 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -95,7 +94,7 @@ func newTestCache(t *testing.T, client storage.ProfileClient) (*ContainerProfile func primeSharedData(t *testing.T, k8s *objectcache.K8sObjectCacheMock, containerID, wlid string) { t.Helper() ids, err := instanceidhandlerV1.GenerateInstanceIDFromPod(&corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "nginx-abc", Namespace: "default"}, + Name: "nginx-abc", Namespace: "default", Spec: corev1.PodSpec{ Containers: []corev1.Container{{Name: "nginx", Image: "nginx:1.25"}}, }, @@ -130,14 +129,12 @@ func eventContainer(id string) *containercollection.Container { // same CP yield entries with populated projected profiles. func TestSharedFastPath_NoOverlay(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-shared", - Namespace: "default", - ResourceVersion: "7", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp-shared", + Namespace: "default", + ResourceVersion: "7", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, Spec: v1beta1.ContainerProfileSpec{ Capabilities: []string{"NET_ADMIN"}, @@ -170,11 +167,9 @@ func TestOverlayPath_UserDefinedCP_NewWay(t *testing.T) { // annotation would be treated as learned and ignored (see // TestUserDefinedCP_LearnedProfileIgnored). userCP := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "override", Namespace: "default", ResourceVersion: "uc1", - Annotations: map[string]string{ - helpersv1.ManagedByMetadataKey: helpersv1.ManagedByUserValue, - }, + Name: "override", Namespace: "default", ResourceVersion: "uc1", + Annotations: map[string]string{ + helpersv1.ManagedByMetadataKey: helpersv1.ManagedByUserValue, }, Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"NET_BIND_SERVICE"}}, } @@ -213,12 +208,10 @@ func TestOverlayPath_CPFetchTransientError_RecordsUserCPRef(t *testing.T) { // CP fetch at the overlay name errors transiently, so userDefinedCP is nil // for this add and the entry is built from the base CP. baseCP := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-base", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp-base", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_PTRACE"}}, } @@ -254,10 +247,8 @@ func TestOverlayPath_CPFetchTransientError_RecordsUserCPRef(t *testing.T) { // fresh mutex. func TestDeleteContainer_LockAndCleanup(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-delete", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, + Name: "cp-delete", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, } client := &fakeProfileClient{cp: cp} c, k8s := newTestCache(t, client) @@ -280,7 +271,7 @@ func TestDeleteContainer_LockAndCleanup(t *testing.T) { // TestContainerCallback_IgnoredContainer verifies IgnoreContainer short-circuits // before any storage call is issued. func TestContainerCallback_IgnoredContainer(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &fakeProfileClient{cp: cp} c, _ := newTestCache(t, client) c.cfg.ExcludeNamespaces = []string{"kube-system"} @@ -306,7 +297,7 @@ func TestContainerCallback_IgnoredContainer(t *testing.T) { // trigger IgnoreContainer even when their namespace is in ExcludeNamespaces // (host events carry namespace="host" after override, not the original one). func TestContainerCallback_HostContainer(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "host", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "host", ResourceVersion: "1"} client := &fakeProfileClient{cp: cp} c, _ := newTestCache(t, client) // Even with every namespace excluded, host containers bypass the check. @@ -333,10 +324,8 @@ func TestContainerCallback_HostContainer(t *testing.T) { // GetCallStackSearchTree. func TestCallStackIndexBuiltFromProfile(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-stack", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, + Name: "cp-stack", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, Spec: v1beta1.ContainerProfileSpec{ IdentifiedCallStacks: []v1beta1.IdentifiedCallStack{ { @@ -372,11 +361,9 @@ func TestCallStackIndexBuiltFromProfile(t *testing.T) { // the projection. func authoredCP(name, execPath, rv string) *v1beta1.ContainerProfile { return &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, Namespace: "default", ResourceVersion: rv, - Annotations: map[string]string{ - helpersv1.ManagedByMetadataKey: helpersv1.ManagedByUserValue, - }, + Name: name, Namespace: "default", ResourceVersion: rv, + Annotations: map[string]string{ + helpersv1.ManagedByMetadataKey: helpersv1.ManagedByUserValue, }, Spec: v1beta1.ContainerProfileSpec{Execs: []v1beta1.ExecCalls{{Path: execPath}}}, } @@ -475,12 +462,10 @@ func TestUserDefinedCP_SingleContainerBareFallback(t *testing.T) { // stays pending. func TestUserDefinedCP_LearnedProfileIgnored(t *testing.T) { learnedAtLabel := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "ready-cp", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.StatusMetadataKey: helpersv1.Learning, // status: ready → still learning - helpersv1.CompletionMetadataKey: helpersv1.Partial, - }, + Name: "ready-cp", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.StatusMetadataKey: helpersv1.Learning, // status: ready → still learning + helpersv1.CompletionMetadataKey: helpersv1.Partial, }, Spec: v1beta1.ContainerProfileSpec{Execs: []v1beta1.ExecCalls{{Path: "/bin/leaked"}}}, } @@ -594,12 +579,10 @@ func TestRefreshUserCP_NoLearnedCP(t *testing.T) { // fast-skips and preserves the entry pointer. func TestRefreshUserCP_FastSkipWhenRVsMatch(t *testing.T) { learned := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "learned-base", Namespace: "default", ResourceVersion: "L1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "learned-base", Namespace: "default", ResourceVersion: "L1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"NET_ADMIN"}}, } @@ -633,12 +616,10 @@ func TestRefreshUserCP_FastSkipWhenRVsMatch(t *testing.T) { // reflected. func TestRefreshUserCP_RebuildWhenUserCPRVChanges(t *testing.T) { learned := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "learned-base", Namespace: "default", ResourceVersion: "L1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "learned-base", Namespace: "default", ResourceVersion: "L1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, } authored := authoredCP("authored-cp-nginx", "/bin/v1", "a1") diff --git a/pkg/objectcache/containerprofilecache/init_eviction_test.go b/pkg/objectcache/containerprofilecache/init_eviction_test.go index 93deb3ff28..8721babd9d 100644 --- a/pkg/objectcache/containerprofilecache/init_eviction_test.go +++ b/pkg/objectcache/containerprofilecache/init_eviction_test.go @@ -11,7 +11,6 @@ import ( cpc "github.com/kubescape/node-agent/pkg/objectcache/containerprofilecache" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" ) @@ -58,11 +57,9 @@ func TestInitContainerEvictionViaRemoveEvent(t *testing.T) { ) cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-test", - Namespace: namespace, - ResourceVersion: "1", - }, + Name: "cp-test", + Namespace: namespace, + ResourceVersion: "1", } store := newFakeStorage(cp) k8s := newFakeK8sCache() @@ -109,11 +106,9 @@ func TestMissedRemoveEventEvictedByReconciler(t *testing.T) { ) cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-reconcile", - Namespace: namespace, - ResourceVersion: "1", - }, + Name: "cp-reconcile", + Namespace: namespace, + ResourceVersion: "1", } store := newFakeStorage(cp) k8s := newFakeK8sCache() diff --git a/pkg/objectcache/containerprofilecache/integration_helpers_test.go b/pkg/objectcache/containerprofilecache/integration_helpers_test.go index c72d5725f7..6895a5813e 100644 --- a/pkg/objectcache/containerprofilecache/integration_helpers_test.go +++ b/pkg/objectcache/containerprofilecache/integration_helpers_test.go @@ -12,7 +12,6 @@ import ( "github.com/kubescape/node-agent/pkg/storage" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -39,11 +38,9 @@ func makeTestContainer(id, podName, namespace, containerName string) *containerc // makeTestPod builds a *corev1.Pod with the provided container statuses. func makeTestPod(name, namespace, uid string, containerStatuses []corev1.ContainerStatus, initStatuses []corev1.ContainerStatus) *corev1.Pod { return &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - UID: types.UID(uid), - }, + Name: name, + Namespace: namespace, + UID: types.UID(uid), Status: corev1.PodStatus{ ContainerStatuses: containerStatuses, InitContainerStatuses: initStatuses, diff --git a/pkg/objectcache/containerprofilecache/lock_stress_test.go b/pkg/objectcache/containerprofilecache/lock_stress_test.go index 44d081f241..85224fa6a6 100644 --- a/pkg/objectcache/containerprofilecache/lock_stress_test.go +++ b/pkg/objectcache/containerprofilecache/lock_stress_test.go @@ -15,7 +15,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" instanceidhandlerV1 "github.com/kubescape/k8s-interface/instanceidhandler/v1" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" @@ -46,11 +45,9 @@ func TestLockStressAddEvictInterleaved(t *testing.T) { ) cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-stress", - Namespace: namespace, - ResourceVersion: "1", - }, + Name: "cp-stress", + Namespace: namespace, + ResourceVersion: "1", } store := newFakeStorage(cp) k8s := newFakeK8sCache() @@ -58,7 +55,7 @@ func TestLockStressAddEvictInterleaved(t *testing.T) { // Prime shared data for each container in the pool so that the internal // waitForSharedContainerData path resolves if needed. containerIDs := make([]string, poolSize) - for i := 0; i < poolSize; i++ { + for i := range poolSize { id := "stress-container-" + itoa3(i) containerIDs[i] = id primeSharedDataForStress(t, k8s, id, podName, namespace, "container-"+itoa3(i), wlid) @@ -97,11 +94,11 @@ func TestLockStressAddEvictInterleaved(t *testing.T) { var wg sync.WaitGroup wg.Add(numWorkers) - for w := 0; w < numWorkers; w++ { + for w := range numWorkers { go func(worker int) { defer wg.Done() r := rand.New(rand.NewSource(time.Now().UnixNano() + int64(worker))) - for iter := 0; iter < numIters; iter++ { + for range numIters { if ctx.Err() != nil { return } @@ -166,7 +163,7 @@ func TestLockStressAddEvictInterleaved(t *testing.T) { func primeSharedDataForStress(t *testing.T, k8s *stubK8sCache, containerID, podName, namespace, containerName, wlid string) { t.Helper() ids, err := instanceidhandlerV1.GenerateInstanceIDFromPod(&corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: podName, Namespace: namespace}, + Name: podName, Namespace: namespace, Spec: corev1.PodSpec{ Containers: []corev1.Container{{Name: containerName, Image: "nginx:1.25"}}, }, diff --git a/pkg/objectcache/containerprofilecache/projection_apply_test.go b/pkg/objectcache/containerprofilecache/projection_apply_test.go index f342e32732..9e2625a76e 100644 --- a/pkg/objectcache/containerprofilecache/projection_apply_test.go +++ b/pkg/objectcache/containerprofilecache/projection_apply_test.go @@ -9,7 +9,6 @@ import ( "github.com/kubescape/storage/pkg/registry/file/dynamicpathdetector" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // --- helpers --- @@ -30,8 +29,8 @@ func prefixSpecBuilt(prefixes ...string) objectcache.FieldSpec { f := objectcache.FieldSpec{ InUse: true, Prefixes: prefixes, - } - f.PrefixMatcher = newTrie(prefixes) + + PrefixMatcher: newTrie(prefixes)} return f } @@ -39,8 +38,8 @@ func suffixSpecBuilt(suffixes ...string) objectcache.FieldSpec { f := objectcache.FieldSpec{ InUse: true, Suffixes: suffixes, - } - f.SuffixMatcher = &suffixTrieMatcher{t: newSuffixTrie(suffixes)} + + SuffixMatcher: &suffixTrieMatcher{t: newSuffixTrie(suffixes)}} return f } @@ -327,10 +326,8 @@ func TestApply_Idempotent(t *testing.T) { func TestApply_SyncChecksum(t *testing.T) { spec := &objectcache.RuleProjectionSpec{} cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - helpersv1.SyncChecksumMetadataKey: "abc123", - }, + Annotations: map[string]string{ + helpersv1.SyncChecksumMetadataKey: "abc123", }, } diff --git a/pkg/objectcache/containerprofilecache/projection_golden_test.go b/pkg/objectcache/containerprofilecache/projection_golden_test.go index 750d120bcb..bea516196c 100644 --- a/pkg/objectcache/containerprofilecache/projection_golden_test.go +++ b/pkg/objectcache/containerprofilecache/projection_golden_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "os" "path/filepath" + "slices" "sort" "testing" @@ -14,7 +15,6 @@ import ( "github.com/kubescape/storage/pkg/registry/file/dynamicpathdetector" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // This file adds a golden-corpus CHARACTERIZATION oracle for Apply. @@ -134,9 +134,9 @@ func declaredPatterns(pats ...typesv1.PatternObject) typesv1.FieldRequirement { // tree-builder skips it), so the frames become one leaf path. func linearCallStack(id string, frames [][2]string) v1beta1.IdentifiedCallStack { var children []v1beta1.CallStackNode - for i := len(frames) - 1; i >= 0; i-- { + for _, frame := range slices.Backward(frames) { children = []v1beta1.CallStackNode{{ - Frame: v1beta1.StackFrame{FileID: frames[i][0], Lineno: frames[i][1]}, + Frame: v1beta1.StackFrame{FileID: frame[0], Lineno: frame[1]}, Children: children, }} } @@ -178,10 +178,8 @@ var ( // PolicyByRuleId. It also carries the SyncChecksum annotation. func richProfile() *v1beta1.ContainerProfile { return &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "kubescape.io/sync-checksum": "sync-abc123", - }, + Annotations: map[string]string{ + "kubescape.io/sync-checksum": "sync-abc123", }, Spec: v1beta1.ContainerProfileSpec{ Capabilities: []string{"NET_ADMIN", "SYS_PTRACE"}, @@ -335,7 +333,6 @@ func TestApply_Golden(t *testing.T) { update := os.Getenv("UPDATE_GOLDEN") != "" for _, tc := range goldenCorpus() { - tc := tc t.Run(tc.name, func(t *testing.T) { spec := CompileSpec(tc.rules) tree := buildTree(tc.cp) @@ -368,7 +365,6 @@ func TestApply_Golden(t *testing.T) { // the same spec + profile twice yields byte-identical projected output. func TestApply_Golden_Idempotent(t *testing.T) { for _, tc := range goldenCorpus() { - tc := tc t.Run(tc.name, func(t *testing.T) { spec := CompileSpec(tc.rules) tree := buildTree(tc.cp) @@ -388,7 +384,6 @@ func TestApply_Golden_Idempotent(t *testing.T) { // produces the same SpecHash, and that Apply copies it into the projection. func TestApply_Golden_SpecHashStable(t *testing.T) { for _, tc := range goldenCorpus() { - tc := tc t.Run(tc.name, func(t *testing.T) { specA := CompileSpec(tc.rules) specB := CompileSpec(tc.rules) diff --git a/pkg/objectcache/containerprofilecache/reconciler_checksum_test.go b/pkg/objectcache/containerprofilecache/reconciler_checksum_test.go index 2d68ac8f93..6206e7a4fe 100644 --- a/pkg/objectcache/containerprofilecache/reconciler_checksum_test.go +++ b/pkg/objectcache/containerprofilecache/reconciler_checksum_test.go @@ -16,7 +16,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -119,11 +118,9 @@ func learnedCPWithChecksum(name, rv, checksum string) *v1beta1.ContainerProfile annotations[storage.ContainerProfileChecksumAnnotationKey] = checksum } return &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, Namespace: "default", ResourceVersion: rv, - Annotations: annotations, - }, - Spec: v1beta1.ContainerProfileSpec{Execs: []v1beta1.ExecCalls{{Path: "/bin/learned"}}}, + Name: name, Namespace: "default", ResourceVersion: rv, + Annotations: annotations, + Spec: v1beta1.ContainerProfileSpec{Execs: []v1beta1.ExecCalls{{Path: "/bin/learned"}}}, } } @@ -556,13 +553,11 @@ func TestGuardDeclinesWhileStateNotYetTerminal(t *testing.T) { // A profile still learning: non-terminal state, but a validator already // stored from a previous fetch. learning := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "learned-cp", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.StatusMetadataKey: helpersv1.Completed, - helpersv1.CompletionMetadataKey: helpersv1.Partial, - storage.ContainerProfileChecksumAnnotationKey: "sum-1", - }, + Name: "learned-cp", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.StatusMetadataKey: helpersv1.Completed, + helpersv1.CompletionMetadataKey: helpersv1.Partial, + storage.ContainerProfileChecksumAnnotationKey: "sum-1", }, Spec: v1beta1.ContainerProfileSpec{Execs: []v1beta1.ExecCalls{{Path: "/bin/learned"}}}, } @@ -1104,8 +1099,7 @@ func TestRefreshSchedulerFinalHandoffDoesNotStrandRequest(t *testing.T) { c := newReconcilerCache(t, client, newControllableK8sCache(), newCountingMetrics()) seedChecksumEntry(c, "cid", cp, "", "") - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + ctx := t.Context() c.scheduleRefresh(ctx) select { case <-client.entered: diff --git a/pkg/objectcache/containerprofilecache/reconciler_ephemeral_test.go b/pkg/objectcache/containerprofilecache/reconciler_ephemeral_test.go index c340e6f1dd..5b2cd6a9fb 100644 --- a/pkg/objectcache/containerprofilecache/reconciler_ephemeral_test.go +++ b/pkg/objectcache/containerprofilecache/reconciler_ephemeral_test.go @@ -9,7 +9,6 @@ import ( "github.com/kubescape/node-agent/pkg/objectcache" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -41,12 +40,12 @@ func seedNamedEntry(c *ContainerProfileCacheImpl, id, containerName, podName, na // ephemeralContainerStatuses entry for it. func podWithEphemeralSpecNoStatus(namespace, podName, podUID, ephemeralName string) *corev1.Pod { return &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: podName, Namespace: namespace, UID: types.UID(podUID)}, + Name: podName, Namespace: namespace, UID: types.UID(podUID), Spec: corev1.PodSpec{ Containers: []corev1.Container{{Name: "app"}}, InitContainers: []corev1.Container{{Name: "setup"}}, EphemeralContainers: []corev1.EphemeralContainer{{ - EphemeralContainerCommon: corev1.EphemeralContainerCommon{Name: ephemeralName}, + Name: ephemeralName, }}, }, Status: corev1.PodStatus{ @@ -110,7 +109,7 @@ func TestReconciler_KeepsInitContainerAwaitingStatusWithEmptyPodUID(t *testing.T // PodUID unknown at entry-creation time. seedNamedEntry(c, "init-id", "setup", "pod-init", "ns-init", "") pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "pod-init", Namespace: "ns-init", UID: types.UID("uid-init")}, + Name: "pod-init", Namespace: "ns-init", UID: types.UID("uid-init"), Spec: corev1.PodSpec{ Containers: []corev1.Container{{Name: "app"}}, InitContainers: []corev1.Container{{Name: "setup"}}, @@ -142,8 +141,8 @@ func TestReconciler_EvictsContainerRemovedFromSpecAndStatus(t *testing.T) { seedNamedEntry(c, "gone-id", "gone", "pod-gone", "ns-gone", "uid-gone") k8s.setPod("ns-gone", "pod-gone", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "pod-gone", Namespace: "ns-gone", UID: types.UID("uid-gone")}, - Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, + Name: "pod-gone", Namespace: "ns-gone", UID: types.UID("uid-gone"), + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, Status: corev1.PodStatus{ ContainerStatuses: []corev1.ContainerStatus{{ Name: "app", @@ -171,8 +170,8 @@ func TestReconciler_TerminationMarkResetsWhenContainerReappears(t *testing.T) { seedNamedEntry(c, "flap-id", "flap", "pod-flap", "ns-flap", "uid-flap") reaped := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "pod-flap", Namespace: "ns-flap", UID: types.UID("uid-flap")}, - Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, + Name: "pod-flap", Namespace: "ns-flap", UID: types.UID("uid-flap"), + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, Status: corev1.PodStatus{ ContainerStatuses: []corev1.ContainerStatus{{ Name: "app", diff --git a/pkg/objectcache/containerprofilecache/reconciler_notfound_test.go b/pkg/objectcache/containerprofilecache/reconciler_notfound_test.go index 266c43fe4a..c177a6ae21 100644 --- a/pkg/objectcache/containerprofilecache/reconciler_notfound_test.go +++ b/pkg/objectcache/containerprofilecache/reconciler_notfound_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -38,12 +37,10 @@ func notFound(name string) error { func TestRefresh_LearnedCP_NotFoundEvictsVsTransientKeeps(t *testing.T) { learned := func() *v1beta1.ContainerProfile { return &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp", Namespace: "default", ResourceVersion: "100", - Annotations: map[string]string{ - helpersv1.StatusMetadataKey: helpersv1.Completed, - helpersv1.CompletionMetadataKey: helpersv1.Full, - }, + Name: "cp", Namespace: "default", ResourceVersion: "100", + Annotations: map[string]string{ + helpersv1.StatusMetadataKey: helpersv1.Completed, + helpersv1.CompletionMetadataKey: helpersv1.Full, }, Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } @@ -81,10 +78,8 @@ func TestRefresh_LearnedCP_NotFoundEvictsVsTransientKeeps(t *testing.T) { func TestRefresh_AuthoredCP_NotFoundUnpinsVsTransientKeeps(t *testing.T) { for _, learnedStatus := range []string{helpersv1.Completed, helpersv1.Learning} { learned := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp", Namespace: "default", ResourceVersion: "100", - Annotations: map[string]string{helpersv1.StatusMetadataKey: learnedStatus}, - }, + Name: "cp", Namespace: "default", ResourceVersion: "100", + Annotations: map[string]string{helpersv1.StatusMetadataKey: learnedStatus}, } mkAuthoredEntry := func() *CachedContainerProfile { return &CachedContainerProfile{ @@ -147,8 +142,8 @@ func TestRefresh_AuthoredCP_NotFoundUnpinsVsTransientKeeps(t *testing.T) { // regardless of UserCPRV's prior value. func TestRefresh_AuthoredCP_TransientErrorBeforeFirstFetchKeepsEntry(t *testing.T) { priorLearned := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "50"}, - Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, + Name: "cp", Namespace: "default", ResourceVersion: "50", + Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } client := &scriptedProfileClient{ errByName: map[string]error{ @@ -193,8 +188,8 @@ func TestRefresh_AuthoredCP_TransientErrorBeforeFirstFetchKeepsEntry(t *testing. // (transient error), not confirmed gone. func TestRefresh_LearnedCP_TransientErrorBeforeFirstFetchKeepsEntry(t *testing.T) { priorAuthored := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "override", Namespace: "default", ResourceVersion: "9"}, - Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, + Name: "override", Namespace: "default", ResourceVersion: "9", + Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } client := &scriptedProfileClient{ errByName: map[string]error{ @@ -234,8 +229,8 @@ func TestRefresh_NoSourcesAfterDelete_EvictsInsteadOfSyntheticComplete(t *testin c := newReconcilerCache(t, client, newControllableK8sCache(), metrics) prior := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "override", Namespace: "default"}, - Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, + Name: "override", Namespace: "default", + Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } entry := &CachedContainerProfile{ Projected: Apply(nil, prior, nil), diff --git a/pkg/objectcache/containerprofilecache/reconciler_test.go b/pkg/objectcache/containerprofilecache/reconciler_test.go index c4d5f754d0..f591c0a772 100644 --- a/pkg/objectcache/containerprofilecache/reconciler_test.go +++ b/pkg/objectcache/containerprofilecache/reconciler_test.go @@ -17,7 +17,6 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) @@ -148,7 +147,7 @@ func newEntry(cp *v1beta1.ContainerProfile, containerName, podName, namespace, p // on busy nodes; evicting on "pod not found" churned every entry per tick. // Cleanup for terminated containers flows through deleteContainer. func TestReconcilerKeepsEntryWhenPodMissing(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() // GetPod returns nil for everything metrics := newCountingMetrics() @@ -166,12 +165,12 @@ func TestReconcilerKeepsEntryWhenPodMissing(t *testing.T) { // TestReconcilerEvictsTerminatedContainer — entry whose container has // clearly transitioned to Terminated state IS evicted. func TestReconcilerEvictsTerminatedContainer(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "terminated123" k8s.setPod("default", "nginx-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "nginx-abc", Namespace: "default", UID: types.UID("uid-1")}, + Name: "nginx-abc", Namespace: "default", UID: types.UID("uid-1"), Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{{ Name: "nginx", ContainerID: "containerd://" + id, @@ -200,12 +199,12 @@ func TestReconcilerEvictsTerminatedContainer(t *testing.T) { // state (e.g. newly-started or pre-running init container with empty ID) // must NOT be evicted. func TestReconcilerKeepsWaitingContainer(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "waitingabc" k8s.setPod("default", "nginx-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "nginx-abc", Namespace: "default", UID: types.UID("uid-1")}, + Name: "nginx-abc", Namespace: "default", UID: types.UID("uid-1"), Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{{ Name: "nginx", ContainerID: "containerd://" + id, @@ -225,12 +224,12 @@ func TestReconcilerKeepsWaitingContainer(t *testing.T) { // TestReconcilerKeepsRunningContainer — entry is kept when pod has a Running // container status matching `id`. func TestReconcilerKeepsRunningContainer(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "abc123" k8s.setPod("default", "nginx-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "nginx-abc", Namespace: "default", UID: types.UID("uid-1")}, + Name: "nginx-abc", Namespace: "default", UID: types.UID("uid-1"), Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{{ Name: "nginx", ContainerID: "containerd://" + id, @@ -255,16 +254,16 @@ func TestReconcilerKeepsRunningContainer(t *testing.T) { // permanent (no re-add path) and silently suppressed every // ProfileDependency=Required rule for the container's entire life. func TestReconcilerKeepsJustAttachedEphemeralContainer(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "ephdebug123" k8s.setPod("default", "mc-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1")}, + Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1"), Spec: corev1.PodSpec{ Containers: []corev1.Container{{Name: "app"}}, EphemeralContainers: []corev1.EphemeralContainer{{ - EphemeralContainerCommon: corev1.EphemeralContainerCommon{Name: "debug"}, + Name: "debug", }}, }, // Statuses are published for the regular container only — the @@ -290,15 +289,15 @@ func TestReconcilerKeepsJustAttachedEphemeralContainer(t *testing.T) { // the fix above: once the ephemeral container's status IS published with a // Terminated state, the entry is evicted normally. func TestReconcilerEvictsEphemeralContainerAfterTermination(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "ephdebug123" k8s.setPod("default", "mc-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1")}, + Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1"), Spec: corev1.PodSpec{ EphemeralContainers: []corev1.EphemeralContainer{{ - EphemeralContainerCommon: corev1.EphemeralContainerCommon{Name: "debug"}, + Name: "debug", }}, }, Status: corev1.PodStatus{EphemeralContainerStatuses: []corev1.ContainerStatus{{ @@ -327,12 +326,12 @@ func TestReconcilerEvictsEphemeralContainerAfterTermination(t *testing.T) { // unreachable and sent the live init container into the "absent = reaped" // eviction. func TestReconcilerKeepsInitContainerWithEmptyStoredPodUID(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "initsetup123" k8s.setPod("default", "mc-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1")}, + Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1"), Spec: corev1.PodSpec{ InitContainers: []corev1.Container{{Name: "setup"}}, Containers: []corev1.Container{{Name: "app"}}, @@ -364,13 +363,13 @@ func TestReconcilerKeepsInitContainerWithEmptyStoredPodUID(t *testing.T) { // container absent from BOTH the pod spec and every status list is genuinely // reaped and must still be evicted. func TestReconcilerEvictsContainerGoneFromSpecAndStatus(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() id := "gonecontainer1" k8s.setPod("default", "mc-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1")}, - Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, + Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1"), + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{{ Name: "app", ContainerID: "containerd://appid456", @@ -396,13 +395,13 @@ func TestReconcilerEvictsContainerGoneFromSpecAndStatus(t *testing.T) { // instance is reaped and must be evicted even though the name is still in the // pod spec. func TestReconcilerEvictsReplacedContainerInstance(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() oldID := "oldinstance1" k8s.setPod("default", "mc-abc", &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1")}, - Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, + Name: "mc-abc", Namespace: "default", UID: types.UID("uid-1"), + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "app"}}}, Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{{ Name: "app", ContainerID: "containerd://newinstance2", @@ -425,7 +424,7 @@ func TestReconcilerEvictsReplacedContainerInstance(t *testing.T) { // TestReconcilerExitsOnCtxCancel — R2 from plan risks, delta #3. Cancelling // ctx mid-Range stops iteration early. func TestReconcilerExitsOnCtxCancel(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "1"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "1"} client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() ctx, cancel := context.WithCancel(context.Background()) @@ -444,7 +443,7 @@ func TestReconcilerExitsOnCtxCancel(t *testing.T) { c := newReconcilerCache(t, client, k8s, metrics) // Populate 100 entries. - for i := 0; i < 100; i++ { + for i := range 100 { id := "c-" + itoa(i) c.entries.Set(id, newEntry(cp, "nginx", "pod-"+itoa(i), "default", "uid-"+itoa(i))) } @@ -462,11 +461,9 @@ func TestReconcilerExitsOnCtxCancel(t *testing.T) { // TestRefreshRebuildsOnCPChange — CP RV changed; entry rebuilds with fresh CP. func TestRefreshRebuildsOnCPChange(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp", Namespace: "default", ResourceVersion: "101", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, - Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, + Name: "cp", Namespace: "default", ResourceVersion: "101", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, + Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } client := &countingProfileClient{cp: cp} k8s := newControllableK8sCache() @@ -474,7 +471,7 @@ func TestRefreshRebuildsOnCPChange(t *testing.T) { c := newReconcilerCache(t, client, k8s, metrics) oldCP := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "100"}, + Name: "cp", Namespace: "default", ResourceVersion: "100", } id := "c1" entry := newEntry(oldCP, "nginx", "nginx-abc", "default", "uid-1") @@ -490,7 +487,7 @@ func TestRefreshRebuildsOnCPChange(t *testing.T) { // TestRefreshNoEntryWhenCPGetFails — storage error on CP keeps the existing // entry unchanged (no deletion). func TestRefreshNoEntryWhenCPGetFails(t *testing.T) { - cp := &v1beta1.ContainerProfile{ObjectMeta: metav1.ObjectMeta{Name: "cp", Namespace: "default", ResourceVersion: "100"}} + cp := &v1beta1.ContainerProfile{Name: "cp", Namespace: "default", ResourceVersion: "100"} failing := &failingProfileClient{cpErr: assertErr{}} k8s := newControllableK8sCache() metrics := newCountingMetrics() @@ -521,12 +518,10 @@ func TestRefreshPreservesEntryOnTransientUserCPError(t *testing.T) { // the base fetch succeeds without an early return and refreshOneEntry reaches // the user-defined CP fetch. cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp", Namespace: "default", ResourceVersion: "100", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp", Namespace: "default", ResourceVersion: "100", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_PTRACE"}}, } @@ -641,7 +636,7 @@ func TestRefreshHonorsContextCancellationMidRPC(t *testing.T) { unblock: unblock, } cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "cp-1", Namespace: "default", ResourceVersion: "42"}, + Name: "cp-1", Namespace: "default", ResourceVersion: "42", } // Seed an existing entry so refreshOneEntry attempts a CP re-fetch. k8s := newControllableK8sCache() @@ -710,12 +705,10 @@ func (b *blockingProfileClient) GetContainerProfile(ctx context.Context, _, _ st // rule evaluation short-circuits as "no profile". func TestRetryPendingEntries_CPCreatedAfterAdd(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-pending", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, + Name: "cp-pending", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, } // Start with storage returning 404 for the initial GET. @@ -791,14 +784,12 @@ func (e *testNotFoundErr) Error() string { return "container profile " + e.name // data coverage, not caching eligibility — only Status matters. func TestPartialCP_Accepted(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-partial", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Partial, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp-partial", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Partial, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, } client := &fakeProfileClient{cp: cp} @@ -816,14 +807,12 @@ func TestPartialCP_Accepted(t *testing.T) { // accept a partial CP when Status=Completed (same rule as non-PreRunning). func TestPartialCP_PreRunning_Accepted(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-partial-prerunning", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Partial, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp-partial-prerunning", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Partial, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, } client := &fakeProfileClient{cp: cp} @@ -844,10 +833,8 @@ func TestPartialCP_PreRunning_Accepted(t *testing.T) { // NOT re-insert it. func TestRefreshDoesNotResurrectDeletedEntry(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-resurrect", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, + Name: "cp-resurrect", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, } client := &fakeProfileClient{cp: cp} c, k8s := newTestCache(t, client) @@ -889,14 +876,12 @@ func primePreRunningSharedData(t *testing.T, k8s *objectcache.K8sObjectCacheMock // from false to true (Test_17 / Test_19 semantics). func TestRefreshUpdatesCPStatus(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-ready", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Learning, // not yet completed - }, + Name: "cp-ready", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Learning, // not yet completed }, } client := &fakeProfileClient{cp: cp} @@ -914,14 +899,12 @@ func TestRefreshUpdatesCPStatus(t *testing.T) { // Storage transitions CP to Status=completed. client.cp = &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-ready", - Namespace: "default", - ResourceVersion: "2", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp-ready", + Namespace: "default", + ResourceVersion: "2", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, } @@ -942,14 +925,12 @@ func TestRefreshUpdatesCPStatus(t *testing.T) { // pending since the manager never transitions TooLarge → Completed. func TestTooLargeCP_Accepted(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-too-large", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Partial, - helpersv1.StatusMetadataKey: helpersv1.TooLarge, - }, + Name: "cp-too-large", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Partial, + helpersv1.StatusMetadataKey: helpersv1.TooLarge, }, Spec: v1beta1.ContainerProfileSpec{ Execs: []v1beta1.ExecCalls{{Path: "/bin/sh"}}, @@ -1000,14 +981,12 @@ func TestNotifyContainerTerminal_TooLarge(t *testing.T) { // Storage now has a TooLarge terminal CP. client.cp = &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-too-large", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Partial, - helpersv1.StatusMetadataKey: helpersv1.TooLarge, - }, + Name: "cp-too-large", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Partial, + helpersv1.StatusMetadataKey: helpersv1.TooLarge, }, Spec: v1beta1.ContainerProfileSpec{ Execs: []v1beta1.ExecCalls{{Path: "/bin/sh"}}, @@ -1048,14 +1027,12 @@ func TestNotifyContainerTerminal_Completed(t *testing.T) { // Simulate the lifecycle: container exits → CP written with Status=Completed. client.cp = &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-exited", - Namespace: "default", - ResourceVersion: "1", - Annotations: map[string]string{ - helpersv1.CompletionMetadataKey: helpersv1.Full, - helpersv1.StatusMetadataKey: helpersv1.Completed, - }, + Name: "cp-exited", + Namespace: "default", + ResourceVersion: "1", + Annotations: map[string]string{ + helpersv1.CompletionMetadataKey: helpersv1.Full, + helpersv1.StatusMetadataKey: helpersv1.Completed, }, } @@ -1080,10 +1057,8 @@ func TestNotifyContainerTerminal_Completed(t *testing.T) { // tests cannot wait for the background goroutine, so we drive it explicitly. func TestSpecChange_TriggersReprojection(t *testing.T) { cp := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp", Namespace: "default", ResourceVersion: "1", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, + Name: "cp", Namespace: "default", ResourceVersion: "1", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, Spec: v1beta1.ContainerProfileSpec{ Capabilities: []string{"SYS_PTRACE", "NET_ADMIN"}, }, diff --git a/pkg/objectcache/containerprofilecache/resolve_authored_section_test.go b/pkg/objectcache/containerprofilecache/resolve_authored_section_test.go index 2aa5993f20..44336c9016 100644 --- a/pkg/objectcache/containerprofilecache/resolve_authored_section_test.go +++ b/pkg/objectcache/containerprofilecache/resolve_authored_section_test.go @@ -6,27 +6,24 @@ import ( helpersv1 "github.com/kubescape/k8s-interface/instanceidhandler/v1/helpers" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Pins the one narrative both add (tryPopulateEntry) and refresh (refreshOneEntry) share via resolveAuthoredSection. 404/transient handling around it is in reconciler_notfound_test.go. func TestResolveAuthoredSection_SharedNarrative(t *testing.T) { flat := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "flat", Namespace: "default"}, - Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, + Name: "flat", Namespace: "default", + Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } grouped := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{Name: "grouped", Namespace: "default"}, + Name: "grouped", Namespace: "default", Spec: v1beta1.ContainerProfileSpec{ Containers: []v1beta1.ContainerProfileContainer{{Name: "app", Capabilities: []string{"NET_ADMIN"}}}, }, } learned := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "learned", Namespace: "default", - Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, - }, - Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, + Name: "learned", Namespace: "default", + Annotations: map[string]string{helpersv1.StatusMetadataKey: helpersv1.Completed}, + Spec: v1beta1.ContainerProfileSpec{Capabilities: []string{"SYS_ADMIN"}}, } t.Run("nil-in-nil-out", func(t *testing.T) { diff --git a/pkg/objectcache/containerprofilecache/shared_pointer_race_test.go b/pkg/objectcache/containerprofilecache/shared_pointer_race_test.go index 0af277ba3e..99216dd0d9 100644 --- a/pkg/objectcache/containerprofilecache/shared_pointer_race_test.go +++ b/pkg/objectcache/containerprofilecache/shared_pointer_race_test.go @@ -29,7 +29,6 @@ import ( cpc "github.com/kubescape/node-agent/pkg/objectcache/containerprofilecache" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestSharedPointerReadersDoNotCorruptCache(t *testing.T) { @@ -42,11 +41,9 @@ func TestSharedPointerReadersDoNotCorruptCache(t *testing.T) { // cpV1 — what is seeded initially (RV="1") cpV1 := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-race", - Namespace: "default", - ResourceVersion: "1", - }, + Name: "cp-race", + Namespace: "default", + ResourceVersion: "1", Spec: v1beta1.ContainerProfileSpec{ Execs: []v1beta1.ExecCalls{{Path: "/bin/sh", Args: []string{"a", "b", "c"}}}, Opens: []v1beta1.OpenCalls{{Path: "/etc/passwd", Flags: []string{"O_RDONLY"}}}, @@ -57,11 +54,9 @@ func TestSharedPointerReadersDoNotCorruptCache(t *testing.T) { // cpV2 — what storage returns after a refresh (RV="2"); the reconciler will // create a brand-new entry pointing to cpV2 (never mutating cpV1). cpV2 := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-race", - Namespace: "default", - ResourceVersion: "2", - }, + Name: "cp-race", + Namespace: "default", + ResourceVersion: "2", Spec: v1beta1.ContainerProfileSpec{ Execs: []v1beta1.ExecCalls{{Path: "/bin/bash", Args: []string{"x", "y"}}}, Opens: []v1beta1.OpenCalls{{Path: "/etc/shadow", Flags: []string{"O_WRONLY"}}}, @@ -113,7 +108,7 @@ func TestSharedPointerReadersDoNotCorruptCache(t *testing.T) { // 50 reader goroutines — read-only traversal of the returned projected profile. wg.Add(numReaders) - for i := 0; i < numReaders; i++ { + for range numReaders { go func() { defer wg.Done() for ctx.Err() == nil { @@ -133,15 +128,13 @@ func TestSharedPointerReadersDoNotCorruptCache(t *testing.T) { // 1 writer goroutine: alternate refresh (rebuilds entry → cpV2) and reset // (reseeds entry → cpV1) to keep the refresh loop active across the window. - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { for ctx.Err() == nil { cache.RefreshAllEntriesForTest(ctx) // Reset to cpV1 so the next refresh sees a stale RV and rebuilds again. seedV1() } - }() + }) wg.Wait() @@ -161,11 +154,9 @@ func TestSharedPointerReadersDoNotCorruptCache(t *testing.T) { // the removed Shared/Profile fields. func TestProjectedEntryPersistsThroughRefresh(t *testing.T) { cpInStorage := &v1beta1.ContainerProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cp-identity", - Namespace: "default", - ResourceVersion: "99", - }, + Name: "cp-identity", + Namespace: "default", + ResourceVersion: "99", } store := newFakeStorage(cpInStorage) k8s := newFakeK8sCache() diff --git a/pkg/objectcache/shared_container_data.go b/pkg/objectcache/shared_container_data.go index 49ac5d7ed0..b2832d0c3f 100644 --- a/pkg/objectcache/shared_container_data.go +++ b/pkg/objectcache/shared_container_data.go @@ -3,6 +3,7 @@ package objectcache import ( "fmt" "iter" + "maps" "strings" "time" @@ -102,9 +103,7 @@ func GetLabels(cloudMetadata *armotypes.CloudMetadata, watchedContainer *Watched labels := watchedContainer.InstanceID.GetLabels() labels[helpersv1.LearningPeriodMetadataKey] = formatDuration(watchedContainer.LearningPeriod) // Apply label overrides - for k, v := range watchedContainer.LabelOverrides { - labels[k] = v - } + maps.Copy(labels, watchedContainer.LabelOverrides) if watchedContainer.ParentResourceVersion != "" { labels[helpersv1.ResourceVersionMetadataKey] = watchedContainer.ParentResourceVersion } @@ -228,7 +227,7 @@ func (watchedContainer *WatchedContainerData) SetContainerInfo(wl workloadinterf func containersIterator(c []v1.Container) iter.Seq2[int, v1.Container] { return func(yield func(int, v1.Container) bool) { - for i := 0; i < len(c); i++ { + for i := range c { if !yield(i, c[i]) { return } @@ -238,7 +237,7 @@ func containersIterator(c []v1.Container) iter.Seq2[int, v1.Container] { func ephemeralContainersIterator(c []v1.EphemeralContainer) iter.Seq2[int, v1.Container] { return func(yield func(int, v1.Container) bool) { - for i := 0; i < len(c); i++ { + for i := range c { if !yield(i, v1.Container(c[i].EphemeralContainerCommon)) { return } diff --git a/pkg/objectcache/shared_container_data_ephemeral_test.go b/pkg/objectcache/shared_container_data_ephemeral_test.go index d8676f42ee..432e86d1f3 100644 --- a/pkg/objectcache/shared_container_data_ephemeral_test.go +++ b/pkg/objectcache/shared_container_data_ephemeral_test.go @@ -12,24 +12,24 @@ import ( // container is enumerated and typed as EphemeralContainer, so the learning // manager receives it and treats it like any other container. func TestSetContainerInfo_ClassifiesEphemeralContainer(t *testing.T) { - pod := map[string]interface{}{ + pod := map[string]any{ "apiVersion": "v1", "kind": "Pod", - "metadata": map[string]interface{}{"name": "victim", "namespace": "ns"}, - "spec": map[string]interface{}{ - "containers": []interface{}{ - map[string]interface{}{"name": "app", "image": "debian:12-slim"}, + "metadata": map[string]any{"name": "victim", "namespace": "ns"}, + "spec": map[string]any{ + "containers": []any{ + map[string]any{"name": "app", "image": "debian:12-slim"}, }, - "ephemeralContainers": []interface{}{ - map[string]interface{}{"name": "ephcon", "image": "debian:12-slim"}, + "ephemeralContainers": []any{ + map[string]any{"name": "ephcon", "image": "debian:12-slim"}, }, }, - "status": map[string]interface{}{ - "containerStatuses": []interface{}{ - map[string]interface{}{"name": "app", "imageID": "docker.io/app@sha256:aaa"}, + "status": map[string]any{ + "containerStatuses": []any{ + map[string]any{"name": "app", "imageID": "docker.io/app@sha256:aaa"}, }, - "ephemeralContainerStatuses": []interface{}{ - map[string]interface{}{"name": "ephcon", "imageID": "docker.io/eph@sha256:bbb"}, + "ephemeralContainerStatuses": []any{ + map[string]any{"name": "ephcon", "imageID": "docker.io/eph@sha256:bbb"}, }, }, } diff --git a/pkg/otelsetup/otelsetup_test.go b/pkg/otelsetup/otelsetup_test.go index 5a45b78c98..eb8c88ee5f 100644 --- a/pkg/otelsetup/otelsetup_test.go +++ b/pkg/otelsetup/otelsetup_test.go @@ -56,7 +56,7 @@ func TestProfileLifecycleTracker_StartEndCompleted(t *testing.T) { assert.Equal(t, "container.profile.cp.saved", spans[0].Name()) // Verify snapshot.number attribute on the child - childAttrs := make(map[string]interface{}) + childAttrs := make(map[string]any) for _, a := range spans[0].Attributes() { childAttrs[string(a.Key)] = a.Value.AsInterface() } diff --git a/pkg/processtree/creator/exit_manager_lifecycle_test.go b/pkg/processtree/creator/exit_manager_lifecycle_test.go index 092df23302..7254ebbe7f 100644 --- a/pkg/processtree/creator/exit_manager_lifecycle_test.go +++ b/pkg/processtree/creator/exit_manager_lifecycle_test.go @@ -33,7 +33,7 @@ func newSpinningExitManagerCreator() *processTreeCreatorImpl { // below keeps the test from being entirely vacuous there, but race evidence for // this package has to come from a local -race run. func TestExitManager_StopIsRaceFreeAgainstCleanupLoop(t *testing.T) { - for i := 0; i < 50; i++ { + for range 50 { pt := newSpinningExitManagerCreator() pt.Start() // Let the loop reach its select and start cycling through iterations. @@ -48,17 +48,15 @@ func TestExitManager_StopIsRaceFreeAgainstCleanupLoop(t *testing.T) { // and the second panicked with "close of closed channel". The check and the close // have to be one atomic transition, which is what the lifecycle mutex makes them. func TestExitManager_ConcurrentStopDoesNotPanic(t *testing.T) { - for i := 0; i < 200; i++ { + for range 200 { pt := newSpinningExitManagerCreator() pt.Start() var wg sync.WaitGroup - for g := 0; g < 8; g++ { - wg.Add(1) - go func() { - defer wg.Done() + for range 8 { + wg.Go(func() { pt.Stop() - }() + }) } wg.Wait() } diff --git a/pkg/processtree/creator/exit_manager_test.go b/pkg/processtree/creator/exit_manager_test.go index 24f043dedd..2f79d9ff67 100644 --- a/pkg/processtree/creator/exit_manager_test.go +++ b/pkg/processtree/creator/exit_manager_test.go @@ -338,7 +338,7 @@ func TestExitManager_ThreadSafety(t *testing.T) { defer pt.Stop() // Create multiple processes - for i := 0; i < 100; i++ { + for i := range 100 { pid := uint32(i + 1) parent := createTestProcess(pid, 1, "parent") pt.processMap.Set(pid, parent) @@ -347,10 +347,8 @@ func TestExitManager_ThreadSafety(t *testing.T) { var wg sync.WaitGroup // Concurrent addition of pending exits - wg.Add(1) - go func() { - defer wg.Done() - for i := 0; i < 50; i++ { + wg.Go(func() { + for i := range 50 { pid := uint32(i + 1) pt.mutex.Lock() event := createTestExitEvent(pid, uint64(i)) @@ -358,30 +356,26 @@ func TestExitManager_ThreadSafety(t *testing.T) { pt.mutex.Unlock() time.Sleep(1 * time.Millisecond) } - }() + }) // Concurrent reading of pending exit count - wg.Add(1) - go func() { - defer wg.Done() - for i := 0; i < 50; i++ { + wg.Go(func() { + for range 50 { pt.mutex.RLock() count := len(pt.pendingExits) pt.mutex.RUnlock() assert.GreaterOrEqual(t, count, 0, "Count should be non-negative") time.Sleep(1 * time.Millisecond) } - }() + }) // Concurrent cleanup - wg.Add(1) - go func() { - defer wg.Done() - for i := 0; i < 10; i++ { + wg.Go(func() { + for range 10 { pt.performExitCleanup() time.Sleep(5 * time.Millisecond) } - }() + }) wg.Wait() diff --git a/pkg/processtree/creator/processtree_creator.go b/pkg/processtree/creator/processtree_creator.go index 5a935243fc..27fe90fff3 100644 --- a/pkg/processtree/creator/processtree_creator.go +++ b/pkg/processtree/creator/processtree_creator.go @@ -148,7 +148,7 @@ func (pt *processTreeCreatorImpl) GetProcessBootTimeNs(pid uint32) uint64 { } // GetPidBranch performs container branch operation (no longer needs to be atomic) -func (pt *processTreeCreatorImpl) GetPidBranch(containerTree interface{}, containerID string, targetPID uint32) (armotypes.Process, error) { +func (pt *processTreeCreatorImpl) GetPidBranch(containerTree any, containerID string, targetPID uint32) (armotypes.Process, error) { pt.mutex.RLock() defer pt.mutex.RUnlock() diff --git a/pkg/processtree/creator/processtree_creator_test.go b/pkg/processtree/creator/processtree_creator_test.go index 23dac920af..80955b8456 100644 --- a/pkg/processtree/creator/processtree_creator_test.go +++ b/pkg/processtree/creator/processtree_creator_test.go @@ -642,11 +642,11 @@ func TestConcurrentAccess(t *testing.T) { const numOperations = 100 // Launch goroutines that feed events - for i := 0; i < numGoroutines; i++ { + for i := range numGoroutines { wg.Add(1) go func(goroutineID int) { defer wg.Done() - for j := 0; j < numOperations; j++ { + for j := range numOperations { pid := uint32(goroutineID*numOperations + j + 1000) event := conversion.ProcessEvent{ Type: conversion.ForkEvent, @@ -660,11 +660,9 @@ func TestConcurrentAccess(t *testing.T) { } // Launch goroutines that read data - for i := 0; i < numGoroutines; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for j := 0; j < numOperations; j++ { + for range numGoroutines { + wg.Go(func() { + for range numOperations { _, err := creator.GetRootTree() assert.NoError(t, err) @@ -675,7 +673,7 @@ func TestConcurrentAccess(t *testing.T) { _, err = creator.GetProcessNode(1234) assert.NoError(t, err) } - }() + }) } // Wait for all goroutines to complete @@ -1067,7 +1065,7 @@ func TestPerformanceWithManyProcesses(t *testing.T) { start := time.Now() // Create many processes - for i := 0; i < numProcesses; i++ { + for i := range numProcesses { event := conversion.ProcessEvent{ Type: conversion.ForkEvent, PID: uint32(i + 1000), @@ -1096,7 +1094,7 @@ func TestPerformanceWithManyProcesses(t *testing.T) { // Test retrieval performance start = time.Now() - for i := 0; i < 100; i++ { // Reduced from 1000 to 100 for faster test + for range 100 { // Reduced from 1000 to 100 for faster test _, err := creator.GetRootTree() assert.NoError(t, err) } diff --git a/pkg/processtree/creator/starttime_test.go b/pkg/processtree/creator/starttime_test.go index 0d02c661db..73e82e3cfd 100644 --- a/pkg/processtree/creator/starttime_test.go +++ b/pkg/processtree/creator/starttime_test.go @@ -35,10 +35,10 @@ func TestHandleProcfsEvent_RecordsStartTime(t *testing.T) { } func TestExitByPid_DeletesStartTimeEntry(t *testing.T) { - cfg := config.Config{} - cfg.ExitCleanup = processtreecreatorconfig.ExitCleanupConfig{ - MaxPendingExits: 10, CleanupInterval: time.Hour, CleanupDelay: 0, - } + cfg := config.Config{ + ExitCleanup: processtreecreatorconfig.ExitCleanupConfig{ + MaxPendingExits: 10, CleanupInterval: time.Hour, CleanupDelay: 0, + }} creator := NewProcessTreeCreator(&mockContainerProcessTree{}, cfg).(*processTreeCreatorImpl) creator.FeedEvent(conversion.ProcessEvent{ Type: conversion.ProcfsEvent, PID: 100, PPID: 1, Comm: "nginx", @@ -140,10 +140,10 @@ func TestHandleForkEvent_IgnoresEventStartTimeNs_OnReadFailure(t *testing.T) { // return: the node is absent from processMap, but a stale side-map entry must // still be reclaimed rather than leaking for the lifetime of the agent. func TestExitByPid_DeletesStartTimeEntry_NodeAlreadyGone(t *testing.T) { - cfg := config.Config{} - cfg.ExitCleanup = processtreecreatorconfig.ExitCleanupConfig{ - MaxPendingExits: 10, CleanupInterval: time.Hour, CleanupDelay: 0, - } + cfg := config.Config{ + ExitCleanup: processtreecreatorconfig.ExitCleanupConfig{ + MaxPendingExits: 10, CleanupInterval: time.Hour, CleanupDelay: 0, + }} creator := NewProcessTreeCreator(&mockContainerProcessTree{}, cfg).(*processTreeCreatorImpl) creator.mutex.Lock() @@ -203,12 +203,12 @@ func TestProcfsStartTimeReader_ReadsRealProcess(t *testing.T) { // Scoped to this package's side map only. This is NOT pid-reuse hardening: the // shared tree node still carries the dead process's comm, cmdline and path. func TestHandleForkEvent_RecycledPidDoesNotInheritDeadProcessStartTime(t *testing.T) { - cfg := config.Config{} - cfg.ExitCleanup = processtreecreatorconfig.ExitCleanupConfig{ - MaxPendingExits: 1000, - CleanupInterval: 30 * time.Second, - CleanupDelay: 5 * time.Minute, // shipped default - } + cfg := config.Config{ + ExitCleanup: processtreecreatorconfig.ExitCleanupConfig{ + MaxPendingExits: 1000, + CleanupInterval: 30 * time.Second, + CleanupDelay: 5 * time.Minute, // shipped default + }} creator := NewProcessTreeCreator(&mockContainerProcessTree{}, cfg).(*processTreeCreatorImpl) const aStart = uint64(1_000_000_000) // process A, boot+1s @@ -283,10 +283,10 @@ func TestHandleForkEvent_ReadsStartTimeWithoutHoldingTreeLock(t *testing.T) { // good scan-recorded value whenever the on-demand read then fails, so the wipe // is gated on there actually being a pending exit for the pid. func TestHandleForkEvent_DoesNotWipeKnownStartTimeWithoutAPendingExit(t *testing.T) { - cfg := config.Config{} - cfg.ExitCleanup = processtreecreatorconfig.ExitCleanupConfig{ - MaxPendingExits: 1000, CleanupInterval: time.Hour, CleanupDelay: time.Minute, - } + cfg := config.Config{ + ExitCleanup: processtreecreatorconfig.ExitCleanupConfig{ + MaxPendingExits: 1000, CleanupInterval: time.Hour, CleanupDelay: time.Minute, + }} creator := NewProcessTreeCreator(&mockContainerProcessTree{}, cfg).(*processTreeCreatorImpl) creator.readStartTime = func(pid uint32) (uint64, time.Time) { return 0, time.Time{} } // read fails diff --git a/pkg/processtree/errors.go b/pkg/processtree/errors.go index edd3b2bed4..502d61fd93 100644 --- a/pkg/processtree/errors.go +++ b/pkg/processtree/errors.go @@ -2,7 +2,6 @@ package processtree import "fmt" - type GetContainerSubtreeError struct { Err error } diff --git a/pkg/processtree/feeder/procfs_feeder.go b/pkg/processtree/feeder/procfs_feeder.go index 180967e483..d3afc9b3db 100644 --- a/pkg/processtree/feeder/procfs_feeder.go +++ b/pkg/processtree/feeder/procfs_feeder.go @@ -151,15 +151,13 @@ func (pf *ProcfsFeeder) scanProcfs() { resultsChan := make(chan procInfo, len(pids)) var wg sync.WaitGroup - for i := 0; i < numWorkers; i++ { - wg.Add(1) - go func() { - defer wg.Done() + for range numWorkers { + wg.Go(func() { for pid := range pidChan { event, err := pf.readProcessInfo(pid) resultsChan <- procInfo{event: event, err: err} } - }() + }) } for _, pid := range pids { diff --git a/pkg/processtree/feeder/procfs_feeder_test.go b/pkg/processtree/feeder/procfs_feeder_test.go index 69b7cb2c02..70669abc1c 100644 --- a/pkg/processtree/feeder/procfs_feeder_test.go +++ b/pkg/processtree/feeder/procfs_feeder_test.go @@ -181,7 +181,7 @@ func TestProcfsFeeder_BroadcastEvent(t *testing.T) { // Check that both subscribers received the event timeout := time.After(100 * time.Millisecond) - for i := 0; i < 2; i++ { + for range 2 { select { case receivedEvent := <-ch1: assert.Equal(t, event, receivedEvent) @@ -196,8 +196,7 @@ func TestProcfsFeeder_BroadcastEvent(t *testing.T) { func TestProcfsFeeder_ScanProcfs(t *testing.T) { mockManager := processtree.NewProcessTreeManagerMock() feeder := NewProcfsFeeder(100*time.Millisecond, 10*time.Millisecond, mockManager) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + ctx := t.Context() err := feeder.Start(ctx) require.NoError(t, err) @@ -244,8 +243,7 @@ ReceiveLoop: func TestProcfsFeeder_ProcessSpecificPID(t *testing.T) { mockManager := processtree.NewProcessTreeManagerMock() feeder := NewProcfsFeeder(100*time.Millisecond, 10*time.Millisecond, mockManager) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + ctx := t.Context() err := feeder.Start(ctx) require.NoError(t, err) diff --git a/pkg/resourcelocks/resourcelocks_test.go b/pkg/resourcelocks/resourcelocks_test.go index b44444d066..906bce6adb 100644 --- a/pkg/resourcelocks/resourcelocks_test.go +++ b/pkg/resourcelocks/resourcelocks_test.go @@ -173,7 +173,7 @@ func TestConcurrentAccess(t *testing.T) { wg.Add(numGoroutines) locks := make([]*sync.Mutex, numGoroutines) - for i := 0; i < numGoroutines; i++ { + for i := range numGoroutines { go func(index int) { defer wg.Done() locks[index] = cl.GetLock(containerID) @@ -196,19 +196,19 @@ func TestConcurrentWithLock(t *testing.T) { containerID := "test-container" numGoroutines := 50 var wg sync.WaitGroup - var counter int64 + var counter atomic.Int64 wg.Add(numGoroutines) // Test that WithLock properly serializes access - for i := 0; i < numGoroutines; i++ { + for range numGoroutines { go func() { defer wg.Done() cl.WithLock(containerID, func() { // Simulate some work and increment counter - current := atomic.LoadInt64(&counter) + current := counter.Load() time.Sleep(1 * time.Millisecond) // Small delay to increase contention - atomic.StoreInt64(&counter, current+1) + counter.Store(current + 1) }) }() } @@ -216,7 +216,7 @@ func TestConcurrentWithLock(t *testing.T) { wg.Wait() // Counter should equal the number of goroutines if locking worked properly - assert.Equal(t, int64(numGoroutines), atomic.LoadInt64(&counter)) + assert.Equal(t, int64(numGoroutines), counter.Load()) } func TestConcurrentMultipleContainers(t *testing.T) { @@ -229,8 +229,8 @@ func TestConcurrentMultipleContainers(t *testing.T) { wg.Add(numContainers * numGoroutinesPerContainer) // Test concurrent access to multiple containers - for containerIndex := 0; containerIndex < numContainers; containerIndex++ { - for goroutineIndex := 0; goroutineIndex < numGoroutinesPerContainer; goroutineIndex++ { + for containerIndex := range numContainers { + for range numGoroutinesPerContainer { go func(cIndex int) { defer wg.Done() containerID := fmt.Sprintf("container-%d", cIndex) @@ -248,7 +248,7 @@ func TestConcurrentMultipleContainers(t *testing.T) { wg.Wait() // Each container should have been incremented the correct number of times - for i := 0; i < numContainers; i++ { + for i := range numContainers { assert.Equal(t, int64(numGoroutinesPerContainer), atomic.LoadInt64(&counters[i]), "Container %d counter mismatch", i) } diff --git a/pkg/rulebindingmanager/cache/cache_test.go b/pkg/rulebindingmanager/cache/cache_test.go index 75eb8b70e3..6d8ff99fb6 100644 --- a/pkg/rulebindingmanager/cache/cache_test.go +++ b/pkg/rulebindingmanager/cache/cache_test.go @@ -41,20 +41,16 @@ func TestRuntimeObjAddHandler(t *testing.T) { args: args{ c: NewCacheMock(""), pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testPod", - Namespace: "testNamespace", - Labels: map[string]string{ - "app": "testPod", - }, + Name: "testPod", + Namespace: "testNamespace", + Labels: map[string]string{ + "app": "testPod", }, }, rb: []typesv1.RuntimeAlertRuleBinding{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "testRB", - Namespace: "testNamespace", - }, + Name: "testRB", + Namespace: "testNamespace", Spec: typesv1.RuntimeAlertRuleBindingSpec{ PodSelector: metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -81,20 +77,16 @@ func TestRuntimeObjAddHandler(t *testing.T) { args: args{ c: NewCacheMock(""), pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testPod", - Namespace: "testNamespace", - Labels: map[string]string{ - "app": "testPod", - }, + Name: "testPod", + Namespace: "testNamespace", + Labels: map[string]string{ + "app": "testPod", }, }, rb: []typesv1.RuntimeAlertRuleBinding{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "testRB", - Namespace: "testNamespace", - }, + Name: "testRB", + Namespace: "testNamespace", Spec: typesv1.RuntimeAlertRuleBindingSpec{ PodSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -125,20 +117,16 @@ func TestRuntimeObjAddHandler(t *testing.T) { args: args{ c: NewCacheMock(""), pod: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testPod", - Namespace: "testNamespace", - Labels: map[string]string{ - "app": "testPod", - }, + Name: "testPod", + Namespace: "testNamespace", + Labels: map[string]string{ + "app": "testPod", }, }, rb: []typesv1.RuntimeAlertRuleBinding{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "testRB", - Namespace: "testNamespace", - }, + Name: "testRB", + Namespace: "testNamespace", Spec: typesv1.RuntimeAlertRuleBindingSpec{ PodSelector: metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -238,10 +226,8 @@ func TestDeleteHandler(t *testing.T) { { name: "Test with Pod kind", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-1", - Namespace: "default", - }, + Name: "pod-1", + Namespace: "default", }, expected: expected{ pod: "default/pod-1", @@ -251,9 +237,9 @@ func TestDeleteHandler(t *testing.T) { { name: "Test with RuntimeRuleBindingAlert kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "kind": "RuntimeRuleAlertBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, @@ -296,10 +282,8 @@ func TestModifyHandler(t *testing.T) { { name: "Test with Pod kind", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-1", - Namespace: "default", - }, + Name: "pod-1", + Namespace: "default", }, addedPod: true, addedRB: false, @@ -311,9 +295,9 @@ func TestModifyHandler(t *testing.T) { { name: "Test with RuntimeRuleBindingAlert kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "kind": "RuntimeRuleAlertBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, @@ -329,10 +313,10 @@ func TestModifyHandler(t *testing.T) { { name: "Test with invalid RuntimeRuleBindingAlert kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "v1", "kind": "RuntimeAlertRuleBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, @@ -349,14 +333,14 @@ func TestModifyHandler(t *testing.T) { { name: "Test with invalid Pod kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "v1", "kind": "Pod", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "pod-1", "namespace": "default", }, - "spec": map[string]interface{}{ + "spec": map[string]any{ "containers": "invalid", }, }, @@ -405,10 +389,8 @@ func TestAddHandler(t *testing.T) { { name: "Test with Pod kind", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-1", - Namespace: "default", - }, + Name: "pod-1", + Namespace: "default", }, addedPod: true, addedRB: false, @@ -420,9 +402,9 @@ func TestAddHandler(t *testing.T) { { name: "Test with RuntimeRuleBindingAlert kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "kind": "RuntimeRuleAlertBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, @@ -438,10 +420,10 @@ func TestAddHandler(t *testing.T) { { name: "Test with invalid RuntimeRuleBindingAlert kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "v1", "kind": "RuntimeAlertRuleBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, @@ -458,14 +440,14 @@ func TestAddHandler(t *testing.T) { { name: "Test with invalid Pod kind", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "v1", "kind": "Pod", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "pod-1", "namespace": "default", }, - "spec": map[string]interface{}{ + "spec": map[string]any{ "containers": "invalid", }, }, @@ -603,17 +585,17 @@ func TestAddRuleBinding(t *testing.T) { k8sClient := k8sinterface.NewKubernetesApiMock() var r []runtime.Object mocks.NAMESPACE = "default" - r = append(r, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: mocks.NAMESPACE, Labels: map[string]string{"app": mocks.NAMESPACE}}}) + r = append(r, &corev1.Namespace{Name: mocks.NAMESPACE, Labels: map[string]string{"app": mocks.NAMESPACE}}) r = append(r, mocks.GetRuntime(mocks.TestKindPod, mocks.TestCollection)) r = append(r, mocks.GetRuntime(mocks.TestKindPod, mocks.TestNginx)) mocks.NAMESPACE = "other" - r = append(r, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: mocks.NAMESPACE, Labels: map[string]string{"app": mocks.NAMESPACE}}}) + r = append(r, &corev1.Namespace{Name: mocks.NAMESPACE, Labels: map[string]string{"app": mocks.NAMESPACE}}) r = append(r, mocks.GetRuntime(mocks.TestKindPod, mocks.TestCollection)) r = append(r, mocks.GetRuntime(mocks.TestKindPod, mocks.TestNginx)) mocks.NAMESPACE = "test" - r = append(r, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: mocks.NAMESPACE, Labels: map[string]string{"app": mocks.NAMESPACE}}}) + r = append(r, &corev1.Namespace{Name: mocks.NAMESPACE, Labels: map[string]string{"app": mocks.NAMESPACE}}) r = append(r, mocks.GetRuntime(mocks.TestKindPod, mocks.TestCollection)) r = append(r, mocks.GetRuntime(mocks.TestKindPod, mocks.TestNginx)) @@ -628,9 +610,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Add roleBinding", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ Rules: []typesv1.RuntimeAlertRuleBindingRule{ { @@ -651,9 +631,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Add roleBinding namespace 'other'", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -682,10 +660,8 @@ func TestAddRuleBinding(t *testing.T) { { name: "Add namespaced roleBinding", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - Namespace: "other", - }, + Name: "rb1", + Namespace: "other", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -714,10 +690,8 @@ func TestAddRuleBinding(t *testing.T) { { name: "Add namespaced roleBinding without pods", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - Namespace: "blabla", - }, + Name: "rb1", + Namespace: "blabla", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -743,9 +717,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Add roleBinding exclude namespace 'other'", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -776,9 +748,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Add roleBinding MatchLabels", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -807,9 +777,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Namespace does not exists", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -828,9 +796,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Invalid ns selector", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ NamespaceSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -854,9 +820,7 @@ func TestAddRuleBinding(t *testing.T) { { name: "Invalid label selector", rb: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rb1", - }, + Name: "rb1", Spec: typesv1.RuntimeAlertRuleBindingSpec{ PodSelector: metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -1054,9 +1018,9 @@ func TestCreateRulePrefilter(t *testing.T) { name: "parameters propagate to prefilter", binding: &typesv1.RuntimeAlertRuleBindingRule{ RuleID: "R0002", - Parameters: map[string]interface{}{ - "ignorePrefixes": []interface{}{"/tmp", "/var/log"}, - "includePrefixes": []interface{}{"/etc"}, + Parameters: map[string]any{ + "ignorePrefixes": []any{"/tmp", "/var/log"}, + "includePrefixes": []any{"/etc"}, }, }, wantIgnore: []string{"/tmp", "/var/log"}, diff --git a/pkg/rulebindingmanager/cache/helpers_test.go b/pkg/rulebindingmanager/cache/helpers_test.go index 82ddd159ae..5dd8b6ed25 100644 --- a/pkg/rulebindingmanager/cache/helpers_test.go +++ b/pkg/rulebindingmanager/cache/helpers_test.go @@ -14,8 +14,8 @@ import ( func TestNamespaceListHasName(t *testing.T) { list := &corev1.NamespaceList{ Items: []corev1.Namespace{ - {ObjectMeta: metav1.ObjectMeta{Name: "devel"}}, - {ObjectMeta: metav1.ObjectMeta{Name: "production"}}, + {Name: "devel"}, + {Name: "production"}, }, } @@ -83,14 +83,14 @@ func TestUnstructuredToRuleBinding(t *testing.T) { { name: "Test with valid rule binding", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "v1", "kind": "RuntimeAlertRuleBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, - "spec": map[string]interface{}{ + "spec": map[string]any{ "ruleName": "rule-1", }, }, @@ -122,10 +122,10 @@ func TestUnstructuredToRuleBinding(t *testing.T) { { name: "Test with invalid rule binding", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "v1", "kind": "RuntimeAlertRuleBinding", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "rule-1", "namespace": "default", }, @@ -156,88 +156,72 @@ func TestUniqueName(t *testing.T) { { name: "Pod with valid namespace and name", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-1", - Namespace: "default", - }, + Name: "pod-1", + Namespace: "default", }, expected: "default/pod-1", }, { name: "Pod with empty namespace", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-1", - Namespace: "", - }, + Name: "pod-1", + Namespace: "", }, expected: "/pod-1", }, { name: "Pod with empty name", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "", - Namespace: "default", - }, + Name: "", + Namespace: "default", }, expected: "default/", }, { name: "Pod with empty namespace and name", obj: &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "", - Namespace: "", - }, + Name: "", + Namespace: "", }, expected: "/", }, { name: "RuntimeAlertRuleBinding with valid namespace and name", obj: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "name-1", - Namespace: "default", - }, + Name: "name-1", + Namespace: "default", }, expected: "default/name-1", }, { name: "RuntimeAlertRuleBinding with empty namespace", obj: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "name-1", - Namespace: "", - }, + Name: "name-1", + Namespace: "", }, expected: "/name-1", }, { name: "RuntimeAlertRuleBinding with empty name", obj: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "", - Namespace: "default", - }, + Name: "", + Namespace: "default", }, expected: "default/", }, { name: "RuntimeAlertRuleBinding with empty namespace and name", obj: &typesv1.RuntimeAlertRuleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "", - Namespace: "", - }, + Name: "", + Namespace: "", }, expected: "/", }, { name: "Unstructured with valid namespace and name", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ + Object: map[string]any{ + "metadata": map[string]any{ "name": "name-1", "namespace": "default", }, @@ -248,8 +232,8 @@ func TestUniqueName(t *testing.T) { { name: "Unstructured with empty namespace", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ + Object: map[string]any{ + "metadata": map[string]any{ "name": "name-1", "namespace": "", }, @@ -260,8 +244,8 @@ func TestUniqueName(t *testing.T) { { name: "Unstructured with empty name", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ + Object: map[string]any{ + "metadata": map[string]any{ "name": "", "namespace": "default", }, @@ -272,8 +256,8 @@ func TestUniqueName(t *testing.T) { { name: "Unstructured with empty namespace and name", obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ + Object: map[string]any{ + "metadata": map[string]any{ "name": "", "namespace": "", }, diff --git a/pkg/rulebindingmanager/types/v1/types.go b/pkg/rulebindingmanager/types/v1/types.go index 6a8f8ec9af..4cc2413fc1 100644 --- a/pkg/rulebindingmanager/types/v1/types.go +++ b/pkg/rulebindingmanager/types/v1/types.go @@ -8,16 +8,16 @@ import ( type RuntimeAlertRuleBindingList struct { metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta `json:"metadata"` // Items is the list of RuntimeAlertRuleBinding Items []RuntimeAlertRuleBinding `json:"items"` } type RuntimeAlertRuleBinding struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` // Specification of the desired behavior of the RuntimeAlertRuleBinding - Spec RuntimeAlertRuleBindingSpec `json:"spec,omitempty"` + Spec RuntimeAlertRuleBindingSpec `json:"spec"` } type RuntimeAlertRuleBindingSpec struct { @@ -27,11 +27,11 @@ type RuntimeAlertRuleBindingSpec struct { } type RuntimeAlertRuleBindingRule struct { - Parameters map[string]interface{} `json:"parameters" yaml:"parameters"` - RuleName string `json:"ruleName" yaml:"ruleName"` - RuleID string `json:"ruleID" yaml:"ruleID"` - Severity string `json:"severity" yaml:"severity"` - RuleTags []string `json:"ruleTags" yaml:"ruleTags"` + Parameters map[string]any `json:"parameters" yaml:"parameters"` + RuleName string `json:"ruleName" yaml:"ruleName"` + RuleID string `json:"ruleID" yaml:"ruleID"` + Severity string `json:"severity" yaml:"severity"` + RuleTags []string `json:"ruleTags" yaml:"ruleTags"` } func (r *RuntimeAlertRuleBindingRule) Equal(other *RuntimeAlertRuleBindingRule) bool { diff --git a/pkg/rulemanager/cel/cel.go b/pkg/rulemanager/cel/cel.go index 1bee764f2b..85688b0f34 100644 --- a/pkg/rulemanager/cel/cel.go +++ b/pkg/rulemanager/cel/cel.go @@ -169,7 +169,7 @@ func (c *CEL) CreateEvalContext(event *events.EnrichedEvent) map[string]any { eventType := event.Event.GetEventType() // Apply event converter if one is registered, otherwise cast to CelEvent - var obj interface{} + var obj any if converter, exists := c.eventConverters[eventType]; exists { obj, _ = xcel.NewObject(converter(event.Event)) } else { @@ -278,7 +278,7 @@ func (c *CEL) RegisterHelper(function cel.EnvOption) error { return nil } -func (c *CEL) RegisterCustomType(eventType utils.EventType, obj interface{}) error { +func (c *CEL) RegisterCustomType(eventType utils.EventType, obj any) error { c.typeMutex.Lock() defer c.typeMutex.Unlock() diff --git a/pkg/rulemanager/cel/cel_interface.go b/pkg/rulemanager/cel/cel_interface.go index 935c7b830f..6df3472a80 100644 --- a/pkg/rulemanager/cel/cel_interface.go +++ b/pkg/rulemanager/cel/cel_interface.go @@ -13,6 +13,6 @@ type RuleEvaluator interface { EvaluateExpression(event *events.EnrichedEvent, expression string) (string, error) CreateEvalContext(event *events.EnrichedEvent) map[string]any RegisterHelper(function cel.EnvOption) error - RegisterCustomType(eventType utils.EventType, obj interface{}) error + RegisterCustomType(eventType utils.EventType, obj any) error RegisterEventConverter(eventType utils.EventType, converter func(utils.K8sEvent) utils.K8sEvent) } diff --git a/pkg/rulemanager/cel/cel_tty_test.go b/pkg/rulemanager/cel/cel_tty_test.go index 86915ed088..2b97cc1de9 100644 --- a/pkg/rulemanager/cel/cel_tty_test.go +++ b/pkg/rulemanager/cel/cel_tty_test.go @@ -145,8 +145,11 @@ func TestCELForwardCompatibility(t *testing.T) { require.False(t, evalTTY(t, phase1, expr)) } -func ptrInt32(v int32) *int32 { return &v } -func ptrUint32(v uint32) *uint32 { return &v } +//go:fix inline +func ptrInt32(v int32) *int32 { return new(v) } + +//go:fix inline +func ptrUint32(v uint32) *uint32 { return new(v) } // --- DatasourceEvent coverage ----------------------------------------------- // diff --git a/pkg/rulemanager/cel/libraries/cache/function_cache.go b/pkg/rulemanager/cel/libraries/cache/function_cache.go index ba07eafcd3..176bc706c5 100644 --- a/pkg/rulemanager/cel/libraries/cache/function_cache.go +++ b/pkg/rulemanager/cel/libraries/cache/function_cache.go @@ -111,19 +111,20 @@ func HashForContainerProfile(oc objectcache.ObjectCache) func([]ref.Val) string // is appended to the key — use HashForContainerProfile to invalidate on spec changes. func (fc *FunctionCache) WithCache(fn CelFunction, functionName string, extraKeyFn ...func([]ref.Val) string) CelFunction { return func(values ...ref.Val) ref.Val { - key := fc.generateCacheKey(functionName, values...) + var key strings.Builder + key.WriteString(fc.generateCacheKey(functionName, values...)) for _, fn := range extraKeyFn { - key += "|" + fn(values) + key.WriteString("|" + fn(values)) } - if cached, found := fc.cache.Get(key); found { + if cached, found := fc.cache.Get(key.String()); found { return cached } result := fn(values...) if !types.IsError(result) { - fc.cache.Add(key, result) + fc.cache.Add(key.String(), result) } return result @@ -156,7 +157,7 @@ func (fc *FunctionCache) valueToString(val ref.Val) string { return fmt.Sprintf("%d", v) case float64: return fmt.Sprintf("%f", v) - case []interface{}: + case []any: var parts []string for _, item := range v { parts = append(parts, fmt.Sprintf("%v", item)) diff --git a/pkg/rulemanager/cel/libraries/celparse/parseargs.go b/pkg/rulemanager/cel/libraries/celparse/parseargs.go index 0c9e8b3fd3..15b0751226 100644 --- a/pkg/rulemanager/cel/libraries/celparse/parseargs.go +++ b/pkg/rulemanager/cel/libraries/celparse/parseargs.go @@ -29,7 +29,7 @@ func ParseList[T any](list ref.Val) ([]T, error) { } result := make([]T, size) - for i := int64(0); i < size; i++ { + for i := range size { val := argsList.Get(types.Int(i)) typedVal, ok := val.Value().(T) if !ok { diff --git a/pkg/rulemanager/cel/libraries/containerprofile/cache_test.go b/pkg/rulemanager/cel/libraries/containerprofile/cache_test.go index 7f25b05d2d..0e8af3d735 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/cache_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/cache_test.go @@ -67,13 +67,13 @@ func TestApplicationProfileCaching(t *testing.T) { testCases := []struct { name string expression string - vars map[string]interface{} + vars map[string]any expected bool }{ { name: "was_path_opened caching", expression: `cp.was_path_opened(containerID, path)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", }, @@ -82,7 +82,7 @@ func TestApplicationProfileCaching(t *testing.T) { { name: "was_executed caching", expression: `cp.was_executed(containerID, path)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "path": "/bin/ls", }, @@ -91,7 +91,7 @@ func TestApplicationProfileCaching(t *testing.T) { { name: "was_executed_with_args caching", expression: `cp.was_executed_with_args(containerID, path, args)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "path": "/bin/ls", "args": []string{"-la"}, @@ -101,7 +101,7 @@ func TestApplicationProfileCaching(t *testing.T) { { name: "was_syscall_used caching", expression: `cp.was_syscall_used(containerID, syscall)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "syscall": "open", }, @@ -110,7 +110,7 @@ func TestApplicationProfileCaching(t *testing.T) { { name: "was_capability_used caching", expression: `cp.was_capability_used(containerID, capability)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "capability": "CAP_NET_ADMIN", }, @@ -203,7 +203,7 @@ func TestApplicationProfileCacheDifferentArguments(t *testing.T) { assert.NoError(t, err) // Call with first path - result1, _, err := program.Eval(map[string]interface{}{ + result1, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", }) @@ -214,7 +214,7 @@ func TestApplicationProfileCacheDifferentArguments(t *testing.T) { assert.Equal(t, 1, cacheSize1, "Cache should have 1 entry") // Call with second path - should create new cache entry - result2, _, err := program.Eval(map[string]interface{}{ + result2, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/tmp/test.txt", }) @@ -225,7 +225,7 @@ func TestApplicationProfileCacheDifferentArguments(t *testing.T) { assert.Equal(t, 2, cacheSize2, "Cache should have 2 entries for different arguments") // Call with non-existent path - should create third cache entry - result3, _, err := program.Eval(map[string]interface{}{ + result3, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/nonexistent", }) @@ -286,7 +286,7 @@ func TestApplicationProfileCacheExpiration(t *testing.T) { program, err := env.Program(ast) assert.NoError(t, err) - vars := map[string]interface{}{ + vars := map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", } @@ -357,7 +357,7 @@ func TestApplicationProfileCachePerformance(t *testing.T) { program, err := env.Program(ast) assert.NoError(t, err) - vars := map[string]interface{}{ + vars := map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", } @@ -433,7 +433,7 @@ func TestApplicationProfileCacheClearCache(t *testing.T) { program, err := env.Program(ast) assert.NoError(t, err) - vars := map[string]interface{}{ + vars := map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", } diff --git a/pkg/rulemanager/cel/libraries/containerprofile/capability_test.go b/pkg/rulemanager/cel/libraries/containerprofile/capability_test.go index 94f73ef943..c831842c85 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/capability_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/capability_test.go @@ -86,7 +86,7 @@ func TestCapabilityInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "capabilityName": tc.capabilityName, }) @@ -122,7 +122,7 @@ func TestCapabilityNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "capabilityName": "NET_ADMIN", }) diff --git a/pkg/rulemanager/cel/libraries/containerprofile/containerprofile.go b/pkg/rulemanager/cel/libraries/containerprofile/containerprofile.go index 228e4fda87..35b6d70cdf 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/containerprofile.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/containerprofile.go @@ -206,7 +206,6 @@ var containerProfileFuncSpecs = []containerProfileFuncSpec{ func (l *containerProfileLibrary) declarationsWithPrefix(namePrefix, overloadIDPrefix string) map[string][]cel.FunctionOpt { decls := make(map[string][]cel.FunctionOpt, len(containerProfileFuncSpecs)) for _, spec := range containerProfileFuncSpecs { - spec := spec fullName := namePrefix + spec.name overloadID := overloadIDPrefix + "_" + spec.name decls[fullName] = []cel.FunctionOpt{ @@ -303,8 +302,8 @@ type legacyCostEstimator struct { } func (e *legacyCostEstimator) EstimateCallCost(function, overloadID string, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if strings.HasPrefix(function, e.legacyPrefix) { - function = e.canonicalPrefix + strings.TrimPrefix(function, e.legacyPrefix) + if after, ok := strings.CutPrefix(function, e.legacyPrefix); ok { + function = e.canonicalPrefix + after } return e.inner.EstimateCallCost(function, overloadID, target, args) } @@ -381,7 +380,7 @@ func (e *containerProfileCostEstimator) EstimateCallCost(function, overloadID st // This estimator doesn't know about other functions. return nil } - return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: uint64(cost), Max: uint64(cost)}} + return &checker.CallEstimate{Min: uint64(cost), Max: uint64(cost)} } func (e *containerProfileCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { diff --git a/pkg/rulemanager/cel/libraries/containerprofile/containerprofile_test.go b/pkg/rulemanager/cel/libraries/containerprofile/containerprofile_test.go index f21a8b903c..a418ea3a0c 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/containerprofile_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/containerprofile_test.go @@ -60,7 +60,7 @@ func TestDeclarationsCompileEachOverload(t *testing.T) { // Activation for the eval pass: an empty objectCache has no profile, so // every helper resolves to false via ConvertProfileNotAvailableErrToBool. // Eval exercises each declared function's binding closure end-to-end. - activation := map[string]interface{}{ + activation := map[string]any{ "containerID": "cid", "s": "x", "strs": []string{"a", "b"}, diff --git a/pkg/rulemanager/cel/libraries/containerprofile/exec.go b/pkg/rulemanager/cel/libraries/containerprofile/exec.go index 1019b0c81c..ea02945b27 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/exec.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/exec.go @@ -1,6 +1,8 @@ package containerprofile import ( + "slices" + "github.com/google/cel-go/common/types" "github.com/google/cel-go/common/types/ref" @@ -189,28 +191,22 @@ func (l *containerProfileLibrary) isExecInPodSpec(containerID, path ref.Val) ref for _, container := range podSpec.Containers { if container.Name == containerName { if container.Command != nil { - for _, exec := range container.Command { - if exec == pathStr { - return types.Bool(true) - } + if slices.Contains(container.Command, pathStr) { + return types.Bool(true) } } if container.Lifecycle != nil { if container.Lifecycle.PreStop != nil && container.Lifecycle.PreStop.Exec != nil && container.Lifecycle.PreStop.Exec.Command != nil { - for _, exec := range container.Lifecycle.PreStop.Exec.Command { - if exec == pathStr { - if l.preStopCache != nil { - l.preStopCache.MarkPreStopTriggered(containerIDStr) - } - return types.Bool(true) + if slices.Contains(container.Lifecycle.PreStop.Exec.Command, pathStr) { + if l.preStopCache != nil { + l.preStopCache.MarkPreStopTriggered(containerIDStr) } + return types.Bool(true) } } if container.Lifecycle.PostStart != nil && container.Lifecycle.PostStart.Exec != nil && container.Lifecycle.PostStart.Exec.Command != nil { - for _, exec := range container.Lifecycle.PostStart.Exec.Command { - if exec == pathStr { - return types.Bool(true) - } + if slices.Contains(container.Lifecycle.PostStart.Exec.Command, pathStr) { + return types.Bool(true) } } } @@ -223,28 +219,22 @@ func (l *containerProfileLibrary) isExecInPodSpec(containerID, path ref.Val) ref for _, container := range podSpec.InitContainers { if container.Name == containerName { if container.Command != nil { - for _, exec := range container.Command { - if exec == pathStr { - return types.Bool(true) - } + if slices.Contains(container.Command, pathStr) { + return types.Bool(true) } } if container.Lifecycle != nil { if container.Lifecycle.PreStop != nil && container.Lifecycle.PreStop.Exec != nil && container.Lifecycle.PreStop.Exec.Command != nil { - for _, exec := range container.Lifecycle.PreStop.Exec.Command { - if exec == pathStr { - if l.preStopCache != nil { - l.preStopCache.MarkPreStopTriggered(containerIDStr) - } - return types.Bool(true) + if slices.Contains(container.Lifecycle.PreStop.Exec.Command, pathStr) { + if l.preStopCache != nil { + l.preStopCache.MarkPreStopTriggered(containerIDStr) } + return types.Bool(true) } } if container.Lifecycle.PostStart != nil && container.Lifecycle.PostStart.Exec != nil && container.Lifecycle.PostStart.Exec.Command != nil { - for _, exec := range container.Lifecycle.PostStart.Exec.Command { - if exec == pathStr { - return types.Bool(true) - } + if slices.Contains(container.Lifecycle.PostStart.Exec.Command, pathStr) { + return types.Bool(true) } } } @@ -257,28 +247,22 @@ func (l *containerProfileLibrary) isExecInPodSpec(containerID, path ref.Val) ref for _, container := range podSpec.EphemeralContainers { if container.Name == containerName { if container.Command != nil { - for _, exec := range container.Command { - if exec == pathStr { - return types.Bool(true) - } + if slices.Contains(container.Command, pathStr) { + return types.Bool(true) } } if container.Lifecycle != nil { if container.Lifecycle.PreStop != nil && container.Lifecycle.PreStop.Exec != nil && container.Lifecycle.PreStop.Exec.Command != nil { - for _, exec := range container.Lifecycle.PreStop.Exec.Command { - if exec == pathStr { - if l.preStopCache != nil { - l.preStopCache.MarkPreStopTriggered(containerIDStr) - } - return types.Bool(true) + if slices.Contains(container.Lifecycle.PreStop.Exec.Command, pathStr) { + if l.preStopCache != nil { + l.preStopCache.MarkPreStopTriggered(containerIDStr) } + return types.Bool(true) } } if container.Lifecycle.PostStart != nil && container.Lifecycle.PostStart.Exec != nil && container.Lifecycle.PostStart.Exec.Command != nil { - for _, exec := range container.Lifecycle.PostStart.Exec.Command { - if exec == pathStr { - return types.Bool(true) - } + if slices.Contains(container.Lifecycle.PostStart.Exec.Command, pathStr) { + return types.Bool(true) } } } diff --git a/pkg/rulemanager/cel/libraries/containerprofile/exec_test.go b/pkg/rulemanager/cel/libraries/containerprofile/exec_test.go index 860e1757d9..13ceddb4dc 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/exec_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/exec_test.go @@ -91,7 +91,7 @@ func TestExecInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "path": tc.path, }) @@ -127,7 +127,7 @@ func TestExecNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/bin/ls", }) @@ -254,7 +254,7 @@ func TestExecWithArgsInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "path": tc.path, "args": tc.args, @@ -292,7 +292,7 @@ func TestExecWithArgsNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/bin/ls", "args": []string{"-la", "/tmp"}, @@ -411,7 +411,7 @@ func TestExecWithArgsWildcardInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": tc.path, "args": tc.args, diff --git a/pkg/rulemanager/cel/libraries/containerprofile/integration_test.go b/pkg/rulemanager/cel/libraries/containerprofile/integration_test.go index 024fb5f1ad..03f7f1ff04 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/integration_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/integration_test.go @@ -127,7 +127,7 @@ func TestIntegrationWithAllFunctions(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", }) if err != nil { diff --git a/pkg/rulemanager/cel/libraries/containerprofile/legacy_test.go b/pkg/rulemanager/cel/libraries/containerprofile/legacy_test.go index 0d0a55687a..ef9997503e 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/legacy_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/legacy_test.go @@ -149,8 +149,8 @@ func TestLegacyAPMatchesCP_ExecOpenSyscallCapability(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - cpResult := evalBool(t, env, tc.cp, map[string]interface{}{"containerID": "test-container-id"}) - apResult := evalBool(t, env, tc.ap, map[string]interface{}{"containerID": "test-container-id"}) + cpResult := evalBool(t, env, tc.cp, map[string]any{"containerID": "test-container-id"}) + apResult := evalBool(t, env, tc.ap, map[string]any{"containerID": "test-container-id"}) assert.Equal(t, tc.want, cpResult, "cp.* result for %s", tc.name) assert.Equal(t, cpResult, apResult, "ap.* must match cp.* for %s", tc.name) }) @@ -228,8 +228,8 @@ func TestLegacyAPMatchesCP_HTTPAndHost(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - cpResult := evalBool(t, env, tc.cp, map[string]interface{}{"containerID": "cid"}) - apResult := evalBool(t, env, tc.ap, map[string]interface{}{"containerID": "cid"}) + cpResult := evalBool(t, env, tc.cp, map[string]any{"containerID": "cid"}) + apResult := evalBool(t, env, tc.ap, map[string]any{"containerID": "cid"}) assert.Equal(t, tc.want, cpResult, "cp.* result for %s", tc.name) assert.Equal(t, cpResult, apResult, "ap.* must match cp.* for %s", tc.name) }) @@ -238,7 +238,7 @@ func TestLegacyAPMatchesCP_HTTPAndHost(t *testing.T) { // evalBool compiles and evaluates a CEL boolean expression against env, // failing the test on any compile/program/eval error. -func evalBool(t *testing.T, env *cel.Env, expr string, activation map[string]interface{}) bool { +func evalBool(t *testing.T, env *cel.Env, expr string, activation map[string]any) bool { t.Helper() ast, issues := env.Compile(expr) if issues != nil && issues.Err() != nil { diff --git a/pkg/rulemanager/cel/libraries/containerprofile/open_test.go b/pkg/rulemanager/cel/libraries/containerprofile/open_test.go index 6b55354b8d..140e0c8e0f 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/open_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/open_test.go @@ -192,7 +192,7 @@ func TestOpenInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "path": tc.path, }) @@ -228,7 +228,7 @@ func TestOpenNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", }) @@ -375,7 +375,7 @@ func TestOpenWithSuffixInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "suffix": tc.suffix, }) @@ -411,7 +411,7 @@ func TestOpenWithSuffixNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "suffix": ".txt", }) @@ -545,7 +545,7 @@ func TestOpenWithPrefixInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "prefix": tc.prefix, }) @@ -581,7 +581,7 @@ func TestOpenWithPrefixNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "prefix": "/etc", }) @@ -758,7 +758,7 @@ func TestOpenWithFlagsInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "path": tc.path, "flags": tc.flags, @@ -796,7 +796,7 @@ func TestOpenWithFlagsNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "path": "/etc/passwd", "flags": []string{"O_RDONLY"}, diff --git a/pkg/rulemanager/cel/libraries/containerprofile/path_match.go b/pkg/rulemanager/cel/libraries/containerprofile/path_match.go index fdcbf06076..5db73a33ec 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/path_match.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/path_match.go @@ -17,8 +17,8 @@ func matchLiteralPath(values map[string]struct{}, query string) bool { return true } if query != "/" && !strings.HasSuffix(query, "//") { - if strings.HasSuffix(query, "/") { - trimmed := strings.TrimSuffix(query, "/") + if before, ok := strings.CutSuffix(query, "/"); ok { + trimmed := before if trimmed != "" && !strings.HasSuffix(trimmed, "/") { if _, ok := values[trimmed]; ok { return true diff --git a/pkg/rulemanager/cel/libraries/containerprofile/prestop_cache_test.go b/pkg/rulemanager/cel/libraries/containerprofile/prestop_cache_test.go index 57995b3ac5..6b6ebff615 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/prestop_cache_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/prestop_cache_test.go @@ -145,11 +145,11 @@ func TestPreStopHookCache_ConcurrentAccess(t *testing.T) { numOperations := 100 // Concurrent writes - for i := 0; i < numGoroutines; i++ { + for i := range numGoroutines { wg.Add(1) go func(id int) { defer wg.Done() - for j := 0; j < numOperations; j++ { + for range numOperations { containerID := "container-" + string(rune('A'+id%26)) cache.MarkPreStopTriggered(containerID) } @@ -157,11 +157,11 @@ func TestPreStopHookCache_ConcurrentAccess(t *testing.T) { } // Concurrent reads - for i := 0; i < numGoroutines; i++ { + for i := range numGoroutines { wg.Add(1) go func(id int) { defer wg.Done() - for j := 0; j < numOperations; j++ { + for range numOperations { containerID := "container-" + string(rune('A'+id%26)) cache.WasPreStopTriggered(containerID) } diff --git a/pkg/rulemanager/cel/libraries/containerprofile/syscall_test.go b/pkg/rulemanager/cel/libraries/containerprofile/syscall_test.go index 089d4754da..790b381c4f 100644 --- a/pkg/rulemanager/cel/libraries/containerprofile/syscall_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofile/syscall_test.go @@ -88,7 +88,7 @@ func TestSyscallInProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": tc.containerID, "syscallName": tc.syscallName, }) @@ -124,7 +124,7 @@ func TestSyscallNoProfile(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "syscallName": "open", }) diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/cache_test.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/cache_test.go index 87fdb6584e..a5d4883eff 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/cache_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/cache_test.go @@ -11,7 +11,6 @@ import ( "github.com/kubescape/node-agent/pkg/rulemanager/cel/libraries/cache" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - "k8s.io/utils/ptr" ) func TestNetworkNeighborhoodCaching(t *testing.T) { @@ -40,7 +39,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { Name: "tcp-80", Protocol: "TCP", - Port: ptr.To(int32(80)), + Port: new(int32(80)), }, }, }, @@ -51,7 +50,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { Name: "tcp-5432", Protocol: "TCP", - Port: ptr.To(int32(5432)), + Port: new(int32(5432)), }, }, }, @@ -64,7 +63,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { Name: "tcp-8080", Protocol: "TCP", - Port: ptr.To(int32(8080)), + Port: new(int32(8080)), }, }, }, @@ -91,13 +90,13 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { testCases := []struct { name string expression string - vars map[string]interface{} + vars map[string]any expected bool }{ { name: "was_address_in_egress caching", expression: `cp.was_address_in_egress(containerID, address)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", }, @@ -106,7 +105,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { name: "was_address_in_ingress caching", expression: `cp.was_address_in_ingress(containerID, address)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "address": "172.16.0.10", }, @@ -115,7 +114,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { name: "is_domain_in_egress caching", expression: `cp.is_domain_in_egress(containerID, domain)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "domain": "api.example.com", }, @@ -124,7 +123,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { name: "is_domain_in_ingress caching", expression: `cp.is_domain_in_ingress(containerID, domain)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "domain": "loadbalancer.example.com", }, @@ -133,7 +132,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { name: "was_address_port_protocol_in_egress caching", expression: `cp.was_address_port_protocol_in_egress(containerID, address, port, protocol)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", "port": int64(80), @@ -144,7 +143,7 @@ func TestNetworkNeighborhoodCaching(t *testing.T) { { name: "was_address_port_protocol_in_ingress caching", expression: `cp.was_address_port_protocol_in_ingress(containerID, address, port, protocol)`, - vars: map[string]interface{}{ + vars: map[string]any{ "containerID": "test-container-id", "address": "172.16.0.10", "port": int64(8080), @@ -239,7 +238,7 @@ func TestNetworkNeighborhoodCacheDifferentArguments(t *testing.T) { assert.NoError(t, err) // Call with first address - result1, _, err := program.Eval(map[string]interface{}{ + result1, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", }) @@ -250,7 +249,7 @@ func TestNetworkNeighborhoodCacheDifferentArguments(t *testing.T) { assert.Equal(t, 1, cacheSize1, "Cache should have 1 entry") // Call with second address - should create new cache entry - result2, _, err := program.Eval(map[string]interface{}{ + result2, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "address": "10.0.0.50", }) @@ -261,7 +260,7 @@ func TestNetworkNeighborhoodCacheDifferentArguments(t *testing.T) { assert.Equal(t, 2, cacheSize2, "Cache should have 2 entries for different arguments") // Call with non-existent address - should create third cache entry - result3, _, err := program.Eval(map[string]interface{}{ + result3, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", "address": "1.1.1.1", }) @@ -322,7 +321,7 @@ func TestNetworkNeighborhoodCacheExpiration(t *testing.T) { program, err := env.Program(ast) assert.NoError(t, err) - vars := map[string]interface{}{ + vars := map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", } @@ -393,7 +392,7 @@ func TestNetworkNeighborhoodCachePerformance(t *testing.T) { program, err := env.Program(ast) assert.NoError(t, err) - vars := map[string]interface{}{ + vars := map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", } @@ -487,7 +486,7 @@ func TestNetworkNeighborhoodCacheMultipleFunctions(t *testing.T) { assert.NoError(t, err) // First call - should cache the result - result1, _, err := program.Eval(map[string]interface{}{ + result1, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", }) assert.NoError(t, err) @@ -498,7 +497,7 @@ func TestNetworkNeighborhoodCacheMultipleFunctions(t *testing.T) { assert.Equal(t, i+1, cacheSize1, "Cache should have %d entries", i+1) // Second call with same parameters - should use cache - result2, _, err := program.Eval(map[string]interface{}{ + result2, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", }) assert.NoError(t, err) @@ -555,7 +554,7 @@ func TestNetworkNeighborhoodCacheClearCache(t *testing.T) { program, err := env.Program(ast) assert.NoError(t, err) - vars := map[string]interface{}{ + vars := map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", } @@ -630,7 +629,7 @@ func TestNetworkNeighborhoodCacheKeyGeneration(t *testing.T) { // Test that same arguments in different order produce same cache result // (cache key generation should be order-independent where possible) - vars1 := map[string]interface{}{ + vars1 := map[string]any{ "containerID": "test-container-id", "address": "192.168.1.100", } diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/containerprofilenetwork.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/containerprofilenetwork.go index 58058c2aed..d015d1014c 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/containerprofilenetwork.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/containerprofilenetwork.go @@ -152,7 +152,6 @@ var containerProfileNetworkFuncSpecs = []containerProfileNetworkFuncSpec{ func (l *containerProfileNetworkLibrary) declarationsWithPrefix(namePrefix, overloadIDPrefix string) map[string][]cel.FunctionOpt { decls := make(map[string][]cel.FunctionOpt, len(containerProfileNetworkFuncSpecs)) for _, spec := range containerProfileNetworkFuncSpecs { - spec := spec fullName := namePrefix + spec.name overloadID := overloadIDPrefix + "_" + spec.name decls[fullName] = []cel.FunctionOpt{ @@ -248,8 +247,8 @@ type legacyNetworkCostEstimator struct { } func (e *legacyNetworkCostEstimator) EstimateCallCost(function, overloadID string, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if strings.HasPrefix(function, e.legacyPrefix) { - function = e.canonicalPrefix + strings.TrimPrefix(function, e.legacyPrefix) + if after, ok := strings.CutPrefix(function, e.legacyPrefix); ok { + function = e.canonicalPrefix + after } return e.inner.EstimateCallCost(function, overloadID, target, args) } @@ -276,7 +275,7 @@ func (e *containerProfileNetworkCostEstimator) EstimateCallCost(function, overlo default: return nil } - return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: uint64(cost), Max: uint64(cost)}} + return &checker.CallEstimate{Min: uint64(cost), Max: uint64(cost)} } func (e *containerProfileNetworkCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/fixtures_test.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/fixtures_test.go index 2601f256e0..b52060f93c 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/fixtures_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/fixtures_test.go @@ -223,7 +223,7 @@ func findFixturesDir(t *testing.T) string { t.Helper() dir, err := os.Getwd() require.NoError(t, err) - for i := 0; i < 10; i++ { + for range 10 { candidate := filepath.Join(dir, "tests", "resources", "network-wildcards") if _, err := os.Stat(candidate); err == nil { return candidate diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/integration_test.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/integration_test.go index e515a5fd73..e31bfd1ee8 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/integration_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/integration_test.go @@ -12,7 +12,6 @@ import ( "github.com/kubescape/node-agent/pkg/rulemanager/cel/libraries/cache" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - "k8s.io/utils/ptr" ) func TestIntegrationWithAllNetworkFunctions(t *testing.T) { @@ -41,12 +40,12 @@ func TestIntegrationWithAllNetworkFunctions(t *testing.T) { { Name: "tcp-80", Protocol: "TCP", - Port: ptr.To(int32(80)), + Port: new(int32(80)), }, { Name: "tcp-443", Protocol: "TCP", - Port: ptr.To(int32(443)), + Port: new(int32(443)), }, }, }, @@ -57,7 +56,7 @@ func TestIntegrationWithAllNetworkFunctions(t *testing.T) { { Name: "tcp-5432", Protocol: "TCP", - Port: ptr.To(int32(5432)), + Port: new(int32(5432)), }, }, }, @@ -68,7 +67,7 @@ func TestIntegrationWithAllNetworkFunctions(t *testing.T) { { Name: "udp-53", Protocol: "UDP", - Port: ptr.To(int32(53)), + Port: new(int32(53)), }, }, }, @@ -81,12 +80,12 @@ func TestIntegrationWithAllNetworkFunctions(t *testing.T) { { Name: "tcp-8080", Protocol: "TCP", - Port: ptr.To(int32(8080)), + Port: new(int32(8080)), }, { Name: "tcp-9090", Protocol: "TCP", - Port: ptr.To(int32(9090)), + Port: new(int32(9090)), }, }, }, @@ -97,7 +96,7 @@ func TestIntegrationWithAllNetworkFunctions(t *testing.T) { { Name: "tcp-3000", Protocol: "TCP", - Port: ptr.To(int32(3000)), + Port: new(int32(3000)), }, }, }, @@ -262,7 +261,7 @@ func TestIntegrationWithAllNetworkFunctions(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ "containerID": "test-container-id", }) if err != nil { diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/legacy_test.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/legacy_test.go index 391c512ad2..54dd3cb6bc 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/legacy_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/legacy_test.go @@ -12,7 +12,6 @@ import ( objectcachev1 "github.com/kubescape/node-agent/pkg/objectcache/v1" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - "k8s.io/utils/ptr" ) // TestLegacyNNDeclarationsMirrorCP is a drift guard: NN() must expose @@ -65,7 +64,7 @@ func TestLegacyNNMatchesCP(t *testing.T) { IPAddress: "192.168.1.100", DNSNames: []string{"api.example.com"}, Ports: []v1beta1.NetworkPort{ - {Name: "tcp-80", Protocol: "TCP", Port: ptr.To(int32(80))}, + {Name: "tcp-80", Protocol: "TCP", Port: new(int32(80))}, }, }, }, @@ -74,7 +73,7 @@ func TestLegacyNNMatchesCP(t *testing.T) { IPAddress: "172.16.0.10", DNSNames: []string{"loadbalancer.example.com"}, Ports: []v1beta1.NetworkPort{ - {Name: "tcp-8080", Protocol: "TCP", Port: ptr.To(int32(8080))}, + {Name: "tcp-8080", Protocol: "TCP", Port: new(int32(8080))}, }, }, }, @@ -142,8 +141,8 @@ func TestLegacyNNMatchesCP(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - cpResult := evalBool(t, env, tc.cp, map[string]interface{}{"containerID": "test-container-id"}) - nnResult := evalBool(t, env, tc.nn, map[string]interface{}{"containerID": "test-container-id"}) + cpResult := evalBool(t, env, tc.cp, map[string]any{"containerID": "test-container-id"}) + nnResult := evalBool(t, env, tc.nn, map[string]any{"containerID": "test-container-id"}) assert.Equal(t, tc.want, cpResult, "cp.* result for %s", tc.name) assert.Equal(t, cpResult, nnResult, "nn.* must match cp.* for %s", tc.name) }) @@ -152,7 +151,7 @@ func TestLegacyNNMatchesCP(t *testing.T) { // evalBool compiles and evaluates a CEL boolean expression against env, // failing the test on any compile/program/eval error. -func evalBool(t *testing.T, env *cel.Env, expr string, activation map[string]interface{}) bool { +func evalBool(t *testing.T, env *cel.Env, expr string, activation map[string]any) bool { t.Helper() ast, issues := env.Compile(expr) if issues != nil && issues.Err() != nil { diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/network_test.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/network_test.go index 10321073cc..824a7976a9 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/network_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/network_test.go @@ -10,7 +10,6 @@ import ( "github.com/kubescape/node-agent/pkg/rulemanager/cel/libraries/cache" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - "k8s.io/utils/ptr" ) func TestWasAddressPortProtocolInEgress(t *testing.T) { @@ -38,12 +37,12 @@ func TestWasAddressPortProtocolInEgress(t *testing.T) { { Name: "tcp-80", Protocol: "TCP", - Port: ptr.To(int32(80)), + Port: new(int32(80)), }, { Name: "tcp-443", Protocol: "TCP", - Port: ptr.To(int32(443)), + Port: new(int32(443)), }, }, }, @@ -53,7 +52,7 @@ func TestWasAddressPortProtocolInEgress(t *testing.T) { { Name: "udp-53", Protocol: "UDP", - Port: ptr.To(int32(53)), + Port: new(int32(53)), }, }, }, @@ -174,12 +173,12 @@ func TestWasAddressPortProtocolInIngress(t *testing.T) { { Name: "tcp-8080", Protocol: "TCP", - Port: ptr.To(int32(8080)), + Port: new(int32(8080)), }, { Name: "tcp-9090", Protocol: "TCP", - Port: ptr.To(int32(9090)), + Port: new(int32(9090)), }, }, }, @@ -189,7 +188,7 @@ func TestWasAddressPortProtocolInIngress(t *testing.T) { { Name: "tcp-3000", Protocol: "TCP", - Port: ptr.To(int32(3000)), + Port: new(int32(3000)), }, }, }, diff --git a/pkg/rulemanager/cel/libraries/containerprofilenetwork/wildcard_test.go b/pkg/rulemanager/cel/libraries/containerprofilenetwork/wildcard_test.go index e0a16c2299..29e261df32 100644 --- a/pkg/rulemanager/cel/libraries/containerprofilenetwork/wildcard_test.go +++ b/pkg/rulemanager/cel/libraries/containerprofilenetwork/wildcard_test.go @@ -10,7 +10,6 @@ import ( "github.com/kubescape/node-agent/pkg/rulemanager/cel/libraries/cache" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - "k8s.io/utils/ptr" ) // Helper: build a ready-to-use library with a single-container profile. @@ -267,7 +266,7 @@ func TestWasAddressPortProtocolInEgress_PortWrapRejected(t *testing.T) { { IPAddress: "10.1.2.3", Ports: []v1beta1.NetworkPort{ - {Name: "TCP-443", Protocol: "TCP", Port: ptr.To(int32(443))}, + {Name: "TCP-443", Protocol: "TCP", Port: new(int32(443))}, }, }, }, nil) @@ -345,7 +344,7 @@ func TestWasAddressPortProtocolInEgress_WithCIDR(t *testing.T) { { IPAddresses: []string{"10.0.0.0/8"}, Ports: []v1beta1.NetworkPort{ - {Name: "TCP-443", Protocol: "TCP", Port: ptr.To(int32(443))}, + {Name: "TCP-443", Protocol: "TCP", Port: new(int32(443))}, }, }, }, nil) diff --git a/pkg/rulemanager/cel/libraries/k8s/k8s.go b/pkg/rulemanager/cel/libraries/k8s/k8s.go index b468d2de36..640916a32d 100644 --- a/pkg/rulemanager/cel/libraries/k8s/k8s.go +++ b/pkg/rulemanager/cel/libraries/k8s/k8s.go @@ -224,7 +224,7 @@ func (e *k8sCostEstimator) EstimateCallCost(function, overloadID string, target // Cache lookup + O(n) search through 3 container types by name cost = 15 } - return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: uint64(cost), Max: uint64(cost)}} + return &checker.CallEstimate{Min: uint64(cost), Max: uint64(cost)} } func (e *k8sCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { diff --git a/pkg/rulemanager/cel/libraries/k8s/k8s_test.go b/pkg/rulemanager/cel/libraries/k8s/k8s_test.go index 039c9fbeb4..8b34a715da 100644 --- a/pkg/rulemanager/cel/libraries/k8s/k8s_test.go +++ b/pkg/rulemanager/cel/libraries/k8s/k8s_test.go @@ -11,7 +11,6 @@ import ( "github.com/kubescape/node-agent/pkg/objectcache/v1" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestK8sLibrary(t *testing.T) { @@ -27,10 +26,8 @@ func TestK8sLibrary(t *testing.T) { // Create a proper Pod object and add it to the cache testPod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "default", - }, + Name: "test-pod", + Namespace: "default", Spec: corev1.PodSpec{ Containers: []corev1.Container{ { @@ -80,8 +77,8 @@ func TestK8sLibrary(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "event": map[string]any{ "namespace": "default", "podName": "test-pod", "containerName": "test-container", @@ -111,10 +108,8 @@ func TestK8sLibraryGetContainerByName(t *testing.T) { // Create a test Pod with multiple containers testPod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "default", - }, + Name: "test-pod", + Namespace: "default", Spec: corev1.PodSpec{ Containers: []corev1.Container{ { @@ -187,8 +182,8 @@ func TestK8sLibraryGetContainerByName(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "event": map[string]any{ "namespace": "default", "podName": "test-pod", "containerName": "main-container", diff --git a/pkg/rulemanager/cel/libraries/net/net_test.go b/pkg/rulemanager/cel/libraries/net/net_test.go index acc15e158b..c18b8b7101 100644 --- a/pkg/rulemanager/cel/libraries/net/net_test.go +++ b/pkg/rulemanager/cel/libraries/net/net_test.go @@ -101,8 +101,8 @@ func TestNetLibrary(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "event": map[string]any{ "ip": "test", }, }) @@ -169,8 +169,8 @@ func TestNetLibraryErrorCases(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - _, _, err = program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + _, _, err = program.Eval(map[string]any{ + "event": map[string]any{ "ip": "test", }, }) diff --git a/pkg/rulemanager/cel/libraries/net/netlib.go b/pkg/rulemanager/cel/libraries/net/netlib.go index 5616ad3a6b..4fbc8d28bc 100644 --- a/pkg/rulemanager/cel/libraries/net/netlib.go +++ b/pkg/rulemanager/cel/libraries/net/netlib.go @@ -81,7 +81,7 @@ func (e *netCostEstimator) EstimateCallCost(function, overloadID string, target // IP parsing O(1) + byte comparison across 6 IP ranges O(6) = O(1) cost = 8 } - return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: uint64(cost), Max: uint64(cost)}} + return &checker.CallEstimate{Min: uint64(cost), Max: uint64(cost)} } func (e *netCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { diff --git a/pkg/rulemanager/cel/libraries/parse/default_rules_yaml_lint_test.go b/pkg/rulemanager/cel/libraries/parse/default_rules_yaml_lint_test.go index 7776883eb7..a99948c256 100644 --- a/pkg/rulemanager/cel/libraries/parse/default_rules_yaml_lint_test.go +++ b/pkg/rulemanager/cel/libraries/parse/default_rules_yaml_lint_test.go @@ -109,11 +109,11 @@ func TestDefaultRulesYAML_R1000DetectsDevShmViaArgv(t *testing.T) { // Isolate the R1000 rule block: from its id line to the next rule's id line. text := string(data) - start := strings.Index(text, `id: "R1000"`) - if start < 0 { + _, after, ok := strings.Cut(text, `id: "R1000"`) + if !ok { t.Fatal(`R1000 rule not found in default-rules.yaml`) } - rest := text[start+len(`id: "R1000"`):] + rest := after end := strings.Index(rest, `id: "R`) if end < 0 { end = len(rest) diff --git a/pkg/rulemanager/cel/libraries/parse/integration_test.go b/pkg/rulemanager/cel/libraries/parse/integration_test.go index e7a76c693d..5933a04b09 100644 --- a/pkg/rulemanager/cel/libraries/parse/integration_test.go +++ b/pkg/rulemanager/cel/libraries/parse/integration_test.go @@ -52,8 +52,8 @@ func TestParseLibraryIntegration(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "data": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "data": map[string]any{ "args": []string{}, "comm": "test", }, diff --git a/pkg/rulemanager/cel/libraries/parse/parselib.go b/pkg/rulemanager/cel/libraries/parse/parselib.go index 758492d542..49a8ca0948 100644 --- a/pkg/rulemanager/cel/libraries/parse/parselib.go +++ b/pkg/rulemanager/cel/libraries/parse/parselib.go @@ -88,7 +88,7 @@ func (e *parseCostEstimator) EstimateCallCost(function, overloadID string, targe // List parsing + simple array access + string comparison - O(1) operation cost = 5 } - return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: uint64(cost), Max: uint64(cost)}} + return &checker.CallEstimate{Min: uint64(cost), Max: uint64(cost)} } func (e *parseCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { diff --git a/pkg/rulemanager/cel/libraries/parse/parsing_test.go b/pkg/rulemanager/cel/libraries/parse/parsing_test.go index c4e10dddfd..ca6c376c5e 100644 --- a/pkg/rulemanager/cel/libraries/parse/parsing_test.go +++ b/pkg/rulemanager/cel/libraries/parse/parsing_test.go @@ -56,8 +56,8 @@ func TestParseLibrary(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "event": map[string]any{ "args": []string{}, "comm": "test", }, @@ -120,8 +120,8 @@ func TestParseLibraryErrorCases(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - _, _, err = program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + _, _, err = program.Eval(map[string]any{ + "event": map[string]any{ "args": []string{}, "comm": "test", }, @@ -236,8 +236,8 @@ func TestGetExecPath_SymmetryWithRecordingSide(t *testing.T) { if err != nil { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "event": map[string]any{ "args": []string{}, "comm": "test", "exepath": "", diff --git a/pkg/rulemanager/cel/libraries/process/process.go b/pkg/rulemanager/cel/libraries/process/process.go index d62accecc3..9028804582 100644 --- a/pkg/rulemanager/cel/libraries/process/process.go +++ b/pkg/rulemanager/cel/libraries/process/process.go @@ -52,7 +52,7 @@ func (l *processLibrary) getProcessEnv(pid ref.Val) ref.Val { } // Convert map[string]string to map[string]interface{} for CEL - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range envMap { result[k] = v } diff --git a/pkg/rulemanager/cel/libraries/process/process_test.go b/pkg/rulemanager/cel/libraries/process/process_test.go index 21d86d71f3..01c0b38a33 100644 --- a/pkg/rulemanager/cel/libraries/process/process_test.go +++ b/pkg/rulemanager/cel/libraries/process/process_test.go @@ -2,6 +2,7 @@ package process import ( "fmt" + "slices" "testing" "github.com/google/cel-go/cel" @@ -24,12 +25,12 @@ func TestProcessLibrary(t *testing.T) { tests := []struct { name string expr string - expected interface{} + expected any }{ { name: "get_process_env with current process PID", expr: fmt.Sprintf("process.get_process_env(%d)", currentPID), - expected: map[string]interface{}{}, // This will be empty for PID 1, but the function should work + expected: map[string]any{}, // This will be empty for PID 1, but the function should work }, { name: "get_ld_hook_var with current process PID", @@ -50,8 +51,8 @@ func TestProcessLibrary(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - result, _, err := program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + result, _, err := program.Eval(map[string]any{ + "event": map[string]any{ "pid": 1234, }, }) @@ -72,7 +73,7 @@ func TestProcessLibrary(t *testing.T) { // For get_process_env, we expect a map (could be empty) // For get_ld_hook_var, we expect a string (could be empty) if tt.name == "get_process_env with current process PID" { - _, isMap := actual.(map[string]interface{}) + _, isMap := actual.(map[string]any) assert.True(t, isMap, "get_process_env should return a map") } else if tt.name == "get_ld_hook_var with current process PID" { _, isString := actual.(string) @@ -146,8 +147,8 @@ func TestProcessLibraryErrorCases(t *testing.T) { t.Fatalf("failed to create program: %v", err) } - _, _, err = program.Eval(map[string]interface{}{ - "event": map[string]interface{}{ + _, _, err = program.Eval(map[string]any{ + "event": map[string]any{ "pid": 1234, }, }) @@ -232,13 +233,7 @@ func TestLD_PRELOAD_ENV_VARS(t *testing.T) { } for _, expectedVar := range expectedVars { - found := false - for _, actualVar := range LD_PRELOAD_ENV_VARS { - if actualVar == expectedVar { - found = true - break - } - } + found := slices.Contains(LD_PRELOAD_ENV_VARS, expectedVar) assert.True(t, found, "Expected LD environment variable %s not found in LD_PRELOAD_ENV_VARS", expectedVar) } } diff --git a/pkg/rulemanager/cel/libraries/process/processlib.go b/pkg/rulemanager/cel/libraries/process/processlib.go index 56e31c87e8..3672003d36 100644 --- a/pkg/rulemanager/cel/libraries/process/processlib.go +++ b/pkg/rulemanager/cel/libraries/process/processlib.go @@ -99,7 +99,7 @@ func (e *processCostEstimator) EstimateCallCost(function, overloadID string, tar // File I/O + O(n) environment parsing + O(m) LD_PRELOAD array search (m=41 constants) cost = 60 } - return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: uint64(cost), Max: uint64(cost)}} + return &checker.CallEstimate{Min: uint64(cost), Max: uint64(cost)} } func (e *processCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { diff --git a/pkg/rulemanager/prefilter/prefilter.go b/pkg/rulemanager/prefilter/prefilter.go index dfad278f86..0f9a100377 100644 --- a/pkg/rulemanager/prefilter/prefilter.go +++ b/pkg/rulemanager/prefilter/prefilter.go @@ -2,6 +2,7 @@ package prefilter import ( "encoding/json" + "maps" "slices" "strings" @@ -146,12 +147,9 @@ func ParseWithDefaults(ruleState map[string]any, bindingParams map[string]any) * } merged := make(map[string]any, len(ruleState)+len(bindingParams)) - for k, v := range ruleState { - merged[k] = v - } - for k, v := range bindingParams { - merged[k] = v // binding overrides state - } + maps.Copy(merged, ruleState) + // binding overrides state + maps.Copy(merged, bindingParams) buf, err := json.Marshal(merged) if err != nil { diff --git a/pkg/rulemanager/prefilter/prefilter_test.go b/pkg/rulemanager/prefilter/prefilter_test.go index defc95d2b5..92f07550df 100644 --- a/pkg/rulemanager/prefilter/prefilter_test.go +++ b/pkg/rulemanager/prefilter/prefilter_test.go @@ -20,17 +20,17 @@ func TestParseWithDefaults(t *testing.T) { }, { name: "binding params only — ignorePrefixes", - bindingParams: map[string]any{"ignorePrefixes": []interface{}{"/tmp", "/var/log"}}, + bindingParams: map[string]any{"ignorePrefixes": []any{"/tmp", "/var/log"}}, expect: &Params{IgnorePrefixes: []string{"/tmp", "/var/log"}}, }, { name: "trailing slash stripped from prefix", - bindingParams: map[string]any{"ignorePrefixes": []interface{}{"/tmp/", "/var/log/"}}, + bindingParams: map[string]any{"ignorePrefixes": []any{"/tmp/", "/var/log/"}}, expect: &Params{IgnorePrefixes: []string{"/tmp", "/var/log"}}, }, { name: "rule state only — direction and methods", - ruleState: map[string]any{"direction": "inbound", "methods": []interface{}{"POST", "PUT"}}, + ruleState: map[string]any{"direction": "inbound", "methods": []any{"POST", "PUT"}}, expect: &Params{Dir: DirInbound, MethodMask: MethodPOST | MethodPUT}, }, { @@ -41,18 +41,18 @@ func TestParseWithDefaults(t *testing.T) { }, { name: "merge: state has direction, binding has prefixes", - ruleState: map[string]any{"direction": "inbound", "methods": []interface{}{"POST"}}, - bindingParams: map[string]any{"ignorePrefixes": []interface{}{"/tmp"}}, + ruleState: map[string]any{"direction": "inbound", "methods": []any{"POST"}}, + bindingParams: map[string]any{"ignorePrefixes": []any{"/tmp"}}, expect: &Params{Dir: DirInbound, MethodMask: MethodPOST, IgnorePrefixes: []string{"/tmp"}}, }, { name: "ports (float64 from JSON)", - bindingParams: map[string]any{"ports": []interface{}{float64(22), float64(2222)}}, + bindingParams: map[string]any{"ports": []any{float64(22), float64(2222)}}, expect: &Params{Ports: []uint16{22, 2222}}, }, { name: "file path prefix not broken by trailing-slash normalization", - bindingParams: map[string]any{"ignorePrefixes": []interface{}{"/etc/passwd"}}, + bindingParams: map[string]any{"ignorePrefixes": []any{"/etc/passwd"}}, expect: &Params{IgnorePrefixes: []string{"/etc/passwd"}}, }, { @@ -62,20 +62,20 @@ func TestParseWithDefaults(t *testing.T) { }, { name: "non-filterable keys only", - bindingParams: map[string]any{"enforceArgs": true, "additionalPaths": []interface{}{"/etc/shadow"}}, + bindingParams: map[string]any{"enforceArgs": true, "additionalPaths": []any{"/etc/shadow"}}, expect: nil, }, { name: "non-filterable in state, filterable in binding", ruleState: map[string]any{"enforceArgs": true}, - bindingParams: map[string]any{"ignorePrefixes": []interface{}{"/tmp"}}, + bindingParams: map[string]any{"ignorePrefixes": []any{"/tmp"}}, expect: &Params{IgnorePrefixes: []string{"/tmp"}}, }, { name: "excludeProcesses parsed", bindingParams: map[string]any{ - "excludeProcesses": []interface{}{ - map[string]interface{}{"name": "dockerd", "path": "/usr/bin/dockerd"}, + "excludeProcesses": []any{ + map[string]any{"name": "dockerd", "path": "/usr/bin/dockerd"}, }, }, expect: &Params{ @@ -87,9 +87,9 @@ func TestParseWithDefaults(t *testing.T) { { name: "excludeParentProcesses parsed with multiple entries", bindingParams: map[string]any{ - "excludeParentProcesses": []interface{}{ - map[string]interface{}{"name": "inspectorssmplu", "path": "/usr/bin/inspector-ssm-plugin"}, - map[string]interface{}{"name": "ssm-agent-worke", "path": "/usr/bin/ssm-agent-worker"}, + "excludeParentProcesses": []any{ + map[string]any{"name": "inspectorssmplu", "path": "/usr/bin/inspector-ssm-plugin"}, + map[string]any{"name": "ssm-agent-worke", "path": "/usr/bin/ssm-agent-worker"}, }, }, expect: &Params{ @@ -102,9 +102,9 @@ func TestParseWithDefaults(t *testing.T) { { name: "excludeProcesses mixed valid and invalid entries", bindingParams: map[string]any{ - "excludeProcesses": []interface{}{ - map[string]interface{}{"name": "", "path": "/usr/bin/foo"}, - map[string]interface{}{"name": "dockerd", "path": "/usr/bin/dockerd"}, + "excludeProcesses": []any{ + map[string]any{"name": "", "path": "/usr/bin/foo"}, + map[string]any{"name": "dockerd", "path": "/usr/bin/dockerd"}, }, }, expect: &Params{ @@ -116,10 +116,10 @@ func TestParseWithDefaults(t *testing.T) { { name: "excludeProcesses path normalized (trailing slash, missing leading slash, redundant segments)", bindingParams: map[string]any{ - "excludeProcesses": []interface{}{ - map[string]interface{}{"name": "dockerd", "path": "/usr/bin/dockerd/"}, - map[string]interface{}{"name": "rpm", "path": "usr/bin/rpm"}, - map[string]interface{}{"name": "curl", "path": "/usr/./bin/curl"}, + "excludeProcesses": []any{ + map[string]any{"name": "dockerd", "path": "/usr/bin/dockerd/"}, + map[string]any{"name": "rpm", "path": "usr/bin/rpm"}, + map[string]any{"name": "curl", "path": "/usr/./bin/curl"}, }, }, expect: &Params{ @@ -133,10 +133,10 @@ func TestParseWithDefaults(t *testing.T) { { name: "excludeProcesses path that normalizes to root is dropped", bindingParams: map[string]any{ - "excludeProcesses": []interface{}{ - map[string]interface{}{"name": "wildcard", "path": "."}, - map[string]interface{}{"name": "root", "path": "/"}, - map[string]interface{}{"name": "dockerd", "path": "/usr/bin/dockerd"}, + "excludeProcesses": []any{ + map[string]any{"name": "wildcard", "path": "."}, + map[string]any{"name": "root", "path": "/"}, + map[string]any{"name": "dockerd", "path": "/usr/bin/dockerd"}, }, }, expect: &Params{ diff --git a/pkg/rulemanager/rule_manager.go b/pkg/rulemanager/rule_manager.go index 3d88c3ab8a..cd6a1511a5 100644 --- a/pkg/rulemanager/rule_manager.go +++ b/pkg/rulemanager/rule_manager.go @@ -4,6 +4,7 @@ import ( "context" "crypto/md5" "fmt" + maps0 "maps" "strconv" "sync" "time" @@ -689,9 +690,7 @@ func cloneState(state map[string]any) map[string]any { } stateCopy := make(map[string]any, len(state)) - for k, v := range state { - stateCopy[k] = v - } + maps0.Copy(stateCopy, state) return stateCopy } diff --git a/pkg/rulemanager/ruleadapters/adapters/bpf.go b/pkg/rulemanager/ruleadapters/adapters/bpf.go index f64cc5216b..966d3822c5 100644 --- a/pkg/rulemanager/ruleadapters/adapters/bpf.go +++ b/pkg/rulemanager/ruleadapters/adapters/bpf.go @@ -32,7 +32,7 @@ func (c *BpfAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEvent baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["cmd"] = cmd baseRuntimeAlert.Arguments["attrSize"] = attrSize diff --git a/pkg/rulemanager/ruleadapters/adapters/capabilities.go b/pkg/rulemanager/ruleadapters/adapters/capabilities.go index 536a48ddd4..e4ad9482e0 100644 --- a/pkg/rulemanager/ruleadapters/adapters/capabilities.go +++ b/pkg/rulemanager/ruleadapters/adapters/capabilities.go @@ -26,7 +26,7 @@ func (c *CapabilitiesAdapter) SetFailureMetadata(failure types.RuleFailure, enri baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["syscall"] = capEvent.GetSyscall() baseRuntimeAlert.Arguments["capability"] = capEvent.GetCapability() diff --git a/pkg/rulemanager/ruleadapters/adapters/dns.go b/pkg/rulemanager/ruleadapters/adapters/dns.go index 9841725a31..2fa0f3e975 100644 --- a/pkg/rulemanager/ruleadapters/adapters/dns.go +++ b/pkg/rulemanager/ruleadapters/adapters/dns.go @@ -33,7 +33,7 @@ func (c *DnsAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEvent baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["domain"] = dnsName baseRuntimeAlert.Arguments["addresses"] = dnsEvent.GetAddresses() diff --git a/pkg/rulemanager/ruleadapters/adapters/exec.go b/pkg/rulemanager/ruleadapters/adapters/exec.go index f4f70c7476..078a25a52f 100644 --- a/pkg/rulemanager/ruleadapters/adapters/exec.go +++ b/pkg/rulemanager/ruleadapters/adapters/exec.go @@ -36,7 +36,7 @@ func (c *ExecAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEven baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["exec"] = execPath baseRuntimeAlert.Arguments["args"] = execEvent.GetArgs() diff --git a/pkg/rulemanager/ruleadapters/adapters/hardlink.go b/pkg/rulemanager/ruleadapters/adapters/hardlink.go index 5ee5e2f33a..c4614a53fa 100644 --- a/pkg/rulemanager/ruleadapters/adapters/hardlink.go +++ b/pkg/rulemanager/ruleadapters/adapters/hardlink.go @@ -32,7 +32,7 @@ func (c *HardlinkAdapter) SetFailureMetadata(failure types.RuleFailure, enriched baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["oldPath"] = oldPath baseRuntimeAlert.Arguments["newPath"] = hardlinkEvent.GetNewPath() diff --git a/pkg/rulemanager/ruleadapters/adapters/http.go b/pkg/rulemanager/ruleadapters/adapters/http.go index 8d1038bbbc..31ddd35806 100644 --- a/pkg/rulemanager/ruleadapters/adapters/http.go +++ b/pkg/rulemanager/ruleadapters/adapters/http.go @@ -25,7 +25,7 @@ func (c *HTTPAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEven baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = httpEvent.GetPID() if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["internal"] = httpEvent.GetInternal() baseRuntimeAlert.Arguments["direction"] = httpEvent.GetDirection() diff --git a/pkg/rulemanager/ruleadapters/adapters/iouring.go b/pkg/rulemanager/ruleadapters/adapters/iouring.go index 36ab7563c9..741c0890d8 100644 --- a/pkg/rulemanager/ruleadapters/adapters/iouring.go +++ b/pkg/rulemanager/ruleadapters/adapters/iouring.go @@ -33,7 +33,7 @@ func (c *IoUringAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedE baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["opcode"] = opcode baseRuntimeAlert.Arguments["flags"] = iouringEvent.GetFlags() diff --git a/pkg/rulemanager/ruleadapters/adapters/kmod.go b/pkg/rulemanager/ruleadapters/adapters/kmod.go index 583b39c829..5fd2159474 100644 --- a/pkg/rulemanager/ruleadapters/adapters/kmod.go +++ b/pkg/rulemanager/ruleadapters/adapters/kmod.go @@ -30,7 +30,7 @@ func (c *KmodAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEven baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["module"] = module baseRuntimeAlert.Arguments["syscall"] = kmodEvent.GetSyscall() diff --git a/pkg/rulemanager/ruleadapters/adapters/network.go b/pkg/rulemanager/ruleadapters/adapters/network.go index 6c37a49ad9..0abba39a29 100644 --- a/pkg/rulemanager/ruleadapters/adapters/network.go +++ b/pkg/rulemanager/ruleadapters/adapters/network.go @@ -29,7 +29,7 @@ func (c *NetworkAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedE baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["ip"] = dstEndpoint.Addr baseRuntimeAlert.Arguments["port"] = port diff --git a/pkg/rulemanager/ruleadapters/adapters/open.go b/pkg/rulemanager/ruleadapters/adapters/open.go index 4dada10cdb..d3864afe9e 100644 --- a/pkg/rulemanager/ruleadapters/adapters/open.go +++ b/pkg/rulemanager/ruleadapters/adapters/open.go @@ -31,7 +31,7 @@ func (c *OpenAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEven baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["flags"] = openEvent.GetFlags() baseRuntimeAlert.Arguments["path"] = fullPath diff --git a/pkg/rulemanager/ruleadapters/adapters/procfs.go b/pkg/rulemanager/ruleadapters/adapters/procfs.go index 26941ab838..a1952e9d4f 100644 --- a/pkg/rulemanager/ruleadapters/adapters/procfs.go +++ b/pkg/rulemanager/ruleadapters/adapters/procfs.go @@ -25,7 +25,7 @@ func (c *ProcfsFailureSetter) SetFailureMetadata(failure types.RuleFailure, enri baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = procfsEvent.PID if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["ppid"] = procfsEvent.PPID baseRuntimeAlert.Arguments["start_time_ns"] = procfsEvent.StartTimeNs diff --git a/pkg/rulemanager/ruleadapters/adapters/randomx.go b/pkg/rulemanager/ruleadapters/adapters/randomx.go index 3ea7b8f2de..c1ce9921d3 100644 --- a/pkg/rulemanager/ruleadapters/adapters/randomx.go +++ b/pkg/rulemanager/ruleadapters/adapters/randomx.go @@ -26,7 +26,7 @@ func (c *RandomXAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedE baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["ppid"] = randomXEvent.GetPpid() baseRuntimeAlert.Identifiers = &common.Identifiers{ diff --git a/pkg/rulemanager/ruleadapters/adapters/ssh.go b/pkg/rulemanager/ruleadapters/adapters/ssh.go index 2202ecfa51..e4532cddf2 100644 --- a/pkg/rulemanager/ruleadapters/adapters/ssh.go +++ b/pkg/rulemanager/ruleadapters/adapters/ssh.go @@ -28,7 +28,7 @@ func (c *SSHAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedEvent baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["src_ip"] = sshEvent.GetSrcIP() baseRuntimeAlert.Arguments["dst_ip"] = dstIP diff --git a/pkg/rulemanager/ruleadapters/adapters/symlink.go b/pkg/rulemanager/ruleadapters/adapters/symlink.go index 2be6454578..eec74617e3 100644 --- a/pkg/rulemanager/ruleadapters/adapters/symlink.go +++ b/pkg/rulemanager/ruleadapters/adapters/symlink.go @@ -32,7 +32,7 @@ func (c *SymlinkAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedE baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["oldPath"] = oldPath baseRuntimeAlert.Arguments["newPath"] = symlinkEvent.GetNewPath() diff --git a/pkg/rulemanager/ruleadapters/adapters/syscall.go b/pkg/rulemanager/ruleadapters/adapters/syscall.go index 4c868b3b78..0aaa3928b6 100644 --- a/pkg/rulemanager/ruleadapters/adapters/syscall.go +++ b/pkg/rulemanager/ruleadapters/adapters/syscall.go @@ -25,7 +25,7 @@ func (c *SyscallAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedE baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = syscallEvent.GetPID() if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["syscall"] = syscallEvent.GetSyscall() baseRuntimeAlert.Identifiers = &common.Identifiers{ diff --git a/pkg/rulemanager/ruleadapters/adapters/unshare.go b/pkg/rulemanager/ruleadapters/adapters/unshare.go index 5d3b1af03b..edbabc5da8 100644 --- a/pkg/rulemanager/ruleadapters/adapters/unshare.go +++ b/pkg/rulemanager/ruleadapters/adapters/unshare.go @@ -30,7 +30,7 @@ func (c *UnshareAdapter) SetFailureMetadata(failure types.RuleFailure, enrichedE baseRuntimeAlert := failure.GetBaseRuntimeAlert() baseRuntimeAlert.InfectedPID = pid if baseRuntimeAlert.Arguments == nil { - baseRuntimeAlert.Arguments = make(map[string]interface{}) + baseRuntimeAlert.Arguments = make(map[string]any) } baseRuntimeAlert.Arguments["exePath"] = exePath baseRuntimeAlert.Identifiers = &common.Identifiers{ diff --git a/pkg/rulemanager/ruleadapters/creator.go b/pkg/rulemanager/ruleadapters/creator.go index 391973de2d..14b8b30878 100644 --- a/pkg/rulemanager/ruleadapters/creator.go +++ b/pkg/rulemanager/ruleadapters/creator.go @@ -72,7 +72,7 @@ func (r *RuleFailureCreator) CreateRuleFailure(rule typesv1.Rule, enrichedEvent UniqueID: uniqueID, AlertName: rule.Name, Severity: rule.Severity, - Arguments: map[string]interface{}{ + Arguments: map[string]any{ "apChecksum": apChecksum, "message": message, }, diff --git a/pkg/rulemanager/rulecooldown/rulecooldown_test.go b/pkg/rulemanager/rulecooldown/rulecooldown_test.go index 357a1a4919..2d5a704675 100644 --- a/pkg/rulemanager/rulecooldown/rulecooldown_test.go +++ b/pkg/rulemanager/rulecooldown/rulecooldown_test.go @@ -304,7 +304,7 @@ func TestShouldCooldownMaxSize(t *testing.T) { }) // Fill up the cache - for i := 0; i < maxSize; i++ { + for i := range maxSize { failure := &types.GenericRuleFailure{ BaseRuntimeAlert: armotypes.BaseRuntimeAlert{ UniqueID: fmt.Sprintf("test-alert-%d", i), diff --git a/pkg/rulemanager/rulepolicy_test.go b/pkg/rulemanager/rulepolicy_test.go index 8f0319c27a..214cae5464 100644 --- a/pkg/rulemanager/rulepolicy_test.go +++ b/pkg/rulemanager/rulepolicy_test.go @@ -13,7 +13,7 @@ type mockContextInfo struct { } func (m *mockContextInfo) Context() contextdetection.EventSourceContext { return m.ctx } -func (m *mockContextInfo) WorkloadID() string { return m.workloadID } +func (m *mockContextInfo) WorkloadID() string { return m.workloadID } func TestRuleAppliesToContext(t *testing.T) { tests := []struct { diff --git a/pkg/rulemanager/types/failure.go b/pkg/rulemanager/types/failure.go index 9c632ec19a..04b8690ab4 100644 --- a/pkg/rulemanager/types/failure.go +++ b/pkg/rulemanager/types/failure.go @@ -24,7 +24,7 @@ type GenericRuleFailure struct { RuleID string CloudServices []string HttpRuleAlert armotypes.HttpRuleAlert - Extra interface{} + Extra any IsTriggerAlert bool SourceContext contextdetection.EventSourceContext } @@ -53,7 +53,7 @@ type RuleFailure interface { // Get Alert Platform GetAlertPlatform() armotypes.AlertSourcePlatform // Get Extra - GetExtra() interface{} + GetExtra() any // Get Source Context GetSourceContext() contextdetection.EventSourceContext @@ -78,7 +78,7 @@ type RuleFailure interface { // Set Http Rule Alert SetHttpRuleAlert(httpRuleAlert armotypes.HttpRuleAlert) // Set Extra - SetExtra(extra interface{}) + SetExtra(extra any) // Get IsTriggerAlert GetIsTriggerAlert() bool // Set IsTriggerAlert @@ -115,7 +115,7 @@ func (rule *GenericRuleFailure) GetRuleId() string { return rule.RuleID } -func (rule *GenericRuleFailure) GetExtra() interface{} { +func (rule *GenericRuleFailure) GetExtra() any { return rule.Extra } @@ -183,7 +183,7 @@ func (rule *GenericRuleFailure) SetHttpRuleAlert(httpRuleAlert armotypes.HttpRul rule.HttpRuleAlert = httpRuleAlert } -func (rule *GenericRuleFailure) SetExtra(extra interface{}) { +func (rule *GenericRuleFailure) SetExtra(extra any) { rule.Extra = extra } diff --git a/pkg/rulemanager/types/v1/doc_exec_tty_test.go b/pkg/rulemanager/types/v1/doc_exec_tty_test.go index 90b60acd17..3bf45c0388 100644 --- a/pkg/rulemanager/types/v1/doc_exec_tty_test.go +++ b/pkg/rulemanager/types/v1/doc_exec_tty_test.go @@ -40,7 +40,6 @@ func TestExecTTYDocRuleYAMLIsParseable(t *testing.T) { } for i, block := range blocks { - block := block t.Run("block", func(t *testing.T) { // The example in the doc is a YAML sequence fragment (a single // list item), matching the shape of RulesSpec.Rules ([]Rule), not diff --git a/pkg/rulemanager/types/v1/profiledata.go b/pkg/rulemanager/types/v1/profiledata.go index 257be7660a..ffb3172d39 100644 --- a/pkg/rulemanager/types/v1/profiledata.go +++ b/pkg/rulemanager/types/v1/profiledata.go @@ -10,15 +10,15 @@ import ( // ProfileDataRequired declares the per-rule profile fields the rule queries. // Nil means the rule reads no profile data. type ProfileDataRequired struct { - Opens FieldRequirement `json:"opens,omitempty" yaml:"opens,omitempty"` - Execs FieldRequirement `json:"execs,omitempty" yaml:"execs,omitempty"` - Capabilities FieldRequirement `json:"capabilities,omitempty" yaml:"capabilities,omitempty"` - Syscalls FieldRequirement `json:"syscalls,omitempty" yaml:"syscalls,omitempty"` - Endpoints FieldRequirement `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` - EgressDomains FieldRequirement `json:"egressDomains,omitempty" yaml:"egressDomains,omitempty"` - EgressAddresses FieldRequirement `json:"egressAddresses,omitempty" yaml:"egressAddresses,omitempty"` - IngressDomains FieldRequirement `json:"ingressDomains,omitempty" yaml:"ingressDomains,omitempty"` - IngressAddresses FieldRequirement `json:"ingressAddresses,omitempty" yaml:"ingressAddresses,omitempty"` + Opens FieldRequirement `json:"opens" yaml:"opens,omitempty"` + Execs FieldRequirement `json:"execs" yaml:"execs,omitempty"` + Capabilities FieldRequirement `json:"capabilities" yaml:"capabilities,omitempty"` + Syscalls FieldRequirement `json:"syscalls" yaml:"syscalls,omitempty"` + Endpoints FieldRequirement `json:"endpoints" yaml:"endpoints,omitempty"` + EgressDomains FieldRequirement `json:"egressDomains" yaml:"egressDomains,omitempty"` + EgressAddresses FieldRequirement `json:"egressAddresses" yaml:"egressAddresses,omitempty"` + IngressDomains FieldRequirement `json:"ingressDomains" yaml:"ingressDomains,omitempty"` + IngressAddresses FieldRequirement `json:"ingressAddresses" yaml:"ingressAddresses,omitempty"` } var profileDataRequiredKnownFields = map[string]bool{ diff --git a/pkg/rulemanager/types/v1/types.go b/pkg/rulemanager/types/v1/types.go index 20e387552c..d3f16fd159 100644 --- a/pkg/rulemanager/types/v1/types.go +++ b/pkg/rulemanager/types/v1/types.go @@ -9,9 +9,9 @@ import ( type Rules struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec RulesSpec `json:"spec,omitempty"` + Spec RulesSpec `json:"spec"` } type RulesSpec struct { diff --git a/pkg/sbommanager/v1/sbom_manager.go b/pkg/sbommanager/v1/sbom_manager.go index 2961fde6f5..7854d76e1b 100644 --- a/pkg/sbommanager/v1/sbom_manager.go +++ b/pkg/sbommanager/v1/sbom_manager.go @@ -51,7 +51,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" k8serrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" _ "modernc.org/sqlite" // required for rpmdb and other features @@ -214,10 +213,10 @@ func (s *SbomManager) getMountedVolumes(pid string) ([]string, error) { // filesystem on the host regardless of the underlying snapshotter. return []string{filepath.Join(s.procDir, pid, "root")}, nil } - for _, option := range strings.Split(mounts[0].VFSOptions, ",") { + for option := range strings.SplitSeq(mounts[0].VFSOptions, ",") { if strings.HasPrefix(option, "lowerdir=") { var volumes []string - for _, volume := range strings.Split(option[9:], ":") { + for volume := range strings.SplitSeq(option[9:], ":") { // FIXME this is a workaround if !strings.HasPrefix(volume, "/") { volume = "/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/" + volume @@ -362,17 +361,15 @@ func (s *SbomManager) processContainerWithMetadata(notif containercollection.Pub // try to create a SBOM with initializing status to reserve our slot normalizedID := normalizeImageID(imageTag, imageID) wipSbom := &v1beta1.SBOMSyft{ - ObjectMeta: metav1.ObjectMeta{ - Name: sbomName, - Annotations: map[string]string{ - helpersv1.ImageIDMetadataKey: normalizedID, - helpersv1.ImageTagMetadataKey: imageTag, - helpersv1.StatusMetadataKey: helpersv1.Initializing, - NodeNameMetadataKey: s.cfg.NodeName, - helpersv1.ToolVersionMetadataKey: s.version, - }, - Labels: labelsFromImageID(normalizedID), + Name: sbomName, + Annotations: map[string]string{ + helpersv1.ImageIDMetadataKey: normalizedID, + helpersv1.ImageTagMetadataKey: imageTag, + helpersv1.StatusMetadataKey: helpersv1.Initializing, + NodeNameMetadataKey: s.cfg.NodeName, + helpersv1.ToolVersionMetadataKey: s.version, }, + Labels: labelsFromImageID(normalizedID), } wipSbom, err = s.storageClient.CreateSBOM(wipSbom) // wipSbomHadContent is true only when we're about to reprocess an SBOM that previously diff --git a/pkg/sbommanager/v1/sbom_manager_sharedwait_test.go b/pkg/sbommanager/v1/sbom_manager_sharedwait_test.go index e927fa4c49..7f50e33fef 100644 --- a/pkg/sbommanager/v1/sbom_manager_sharedwait_test.go +++ b/pkg/sbommanager/v1/sbom_manager_sharedwait_test.go @@ -103,8 +103,7 @@ func addContainerNotif(containerID string) containercollection.PubSubEvent { // wait ran inline on the pool worker again, A would head-of-line-block B — so B's work reaching // the worker while A is stuck is exactly what the fix guarantees. func Test_awaitAndSubmit_StuckContainerDoesNotBlockOthers(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() // unblocks container A's still-waiting goroutine at test end + ctx := t.Context() // unblocks container A's still-waiting goroutine at test end imageTag := "quay.io/kubescape/kubevuln:v0.3.2" imageID := "sha256:94cbbb94f8d6bdf2529d5f9c5279ac4c7411182f4e8e5a3d0b5e8f10a465f73a" @@ -150,8 +149,7 @@ func Test_awaitAndSubmit_StuckContainerDoesNotBlockOthers(t *testing.T) { // Test_cancelWait_StopsInFlightWait proves the container-remove path cancels the wait promptly so // a short-lived container can't park a goroutine for the full timeout. func Test_cancelWait_StopsInFlightWait(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + ctx := t.Context() sm := &SbomManager{ ctx: ctx, diff --git a/pkg/sbomscanner/v1/client.go b/pkg/sbomscanner/v1/client.go index 407347d18b..7e93fb5da6 100644 --- a/pkg/sbomscanner/v1/client.go +++ b/pkg/sbomscanner/v1/client.go @@ -13,9 +13,9 @@ import ( "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "google.golang.org/grpc" - grpcstats "google.golang.org/grpc/stats" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" + grpcstats "google.golang.org/grpc/stats" "google.golang.org/grpc/status" ) diff --git a/pkg/sbomscanner/v1/server.go b/pkg/sbomscanner/v1/server.go index 717c103ec7..7fb0447998 100644 --- a/pkg/sbomscanner/v1/server.go +++ b/pkg/sbomscanner/v1/server.go @@ -19,8 +19,8 @@ import ( "github.com/kubescape/node-agent/pkg/sbommanager/v1/syftutil" pb "github.com/kubescape/node-agent/pkg/sbomscanner/v1/proto" "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" - otelcodes "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/attribute" + otelcodes "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/pkg/sbomscanner/v1/types.go b/pkg/sbomscanner/v1/types.go index 27c4358ce4..9b06ef32ed 100644 --- a/pkg/sbomscanner/v1/types.go +++ b/pkg/sbomscanner/v1/types.go @@ -11,7 +11,7 @@ import ( var ( ErrScannerCrashed = errors.New("SBOM scanner sidecar crashed during scan") ErrScannerNotReady = errors.New("SBOM scanner sidecar not ready") - ErrImageTooLarge = errors.New("image size exceeds maximum allowed size") + ErrImageTooLarge = errors.New("image size exceeds maximum allowed size") ) type ScanRequest struct { diff --git a/pkg/seccompmanager/v1/seccomp_manager_test.go b/pkg/seccompmanager/v1/seccomp_manager_test.go index 1d2362f58d..42add62b8f 100644 --- a/pkg/seccompmanager/v1/seccomp_manager_test.go +++ b/pkg/seccompmanager/v1/seccomp_manager_test.go @@ -7,7 +7,6 @@ import ( "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) //func TestName(t *testing.T) { @@ -47,10 +46,8 @@ func TestSeccompManager(t *testing.T) { { name: "create seccomp profile", obj: &v1beta1.SeccompProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "replicaset-nginx-77b4fdf86c", - Namespace: "default", - }, + Name: "replicaset-nginx-77b4fdf86c", + Namespace: "default", Spec: v1beta1.SeccompProfileSpec{ Containers: []v1beta1.SingleSeccompProfile{{ Name: "nginx", diff --git a/pkg/storage/v1/seccompprofile.go b/pkg/storage/v1/seccompprofile.go index 21201dbfea..1ee3274a48 100644 --- a/pkg/storage/v1/seccompprofile.go +++ b/pkg/storage/v1/seccompprofile.go @@ -37,4 +37,3 @@ func (c *StorageSeccompProfileClient) GetSeccompProfile(namespace, name string) ResourceVersion: softwarecomposition.ResourceVersionFullSpec, }) } - diff --git a/pkg/storage/v1/seccompprofile_crd.go b/pkg/storage/v1/seccompprofile_crd.go index a945cd57ac..657eeb251b 100644 --- a/pkg/storage/v1/seccompprofile_crd.go +++ b/pkg/storage/v1/seccompprofile_crd.go @@ -47,14 +47,12 @@ func (c *CRDSeccompProfileClient) ListSeccompProfiles(namespace string, opts met } result := &v1beta1.SeccompProfileList{ - TypeMeta: metav1.TypeMeta{ - Kind: "SeccompProfileList", - APIVersion: "spdx.softwarecomposition.kubescape.io/v1beta1", - }, + Kind: "SeccompProfileList", + APIVersion: "spdx.softwarecomposition.kubescape.io/v1beta1", } // Set ListMeta from unstructured - if metadata, ok := unstructuredList.Object["metadata"].(map[string]interface{}); ok { + if metadata, ok := unstructuredList.Object["metadata"].(map[string]any); ok { if rv, ok := metadata["resourceVersion"].(string); ok { result.ListMeta.ResourceVersion = rv } @@ -170,4 +168,3 @@ func (cw *convertingWatch) Stop() { func (cw *convertingWatch) ResultChan() <-chan watch.Event { return cw.result } - diff --git a/pkg/storage/v1/seccompprofile_test.go b/pkg/storage/v1/seccompprofile_test.go index eacbc4ea5e..3f719708e8 100644 --- a/pkg/storage/v1/seccompprofile_test.go +++ b/pkg/storage/v1/seccompprofile_test.go @@ -55,4 +55,3 @@ func TestCreateSeccompProfileClient_InvalidBackendDefaultsToStorage(t *testing.T _, ok := client.(*StorageSeccompProfileClient) assert.True(t, ok, "Expected StorageSeccompProfileClient for invalid backend (should default to storage)") } - diff --git a/pkg/storage/v1/storage_test.go b/pkg/storage/v1/storage_test.go index 350d5f764f..2649138c10 100644 --- a/pkg/storage/v1/storage_test.go +++ b/pkg/storage/v1/storage_test.go @@ -9,7 +9,6 @@ import ( "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1" "github.com/stretchr/testify/assert" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestGetMultiplier(t *testing.T) { @@ -203,17 +202,15 @@ func TestStorage_CreateContainerProfile(t *testing.T) { { name: "create basic container profile", profile: &v1beta1.ContainerProfile{ - ObjectMeta: v1.ObjectMeta{ - Name: "test-container-profile", - Annotations: map[string]string{ - "kubescape.io/instance-id": "test-instance-123", - "kubescape.io/wlid": "wlid://cluster-test/namespace-default/deployment-nginx", - "kubescape.io/completion": "complete", - "kubescape.io/status": "ready", - }, - Labels: map[string]string{ - "app": "nginx", - }, + Name: "test-container-profile", + Annotations: map[string]string{ + "kubescape.io/instance-id": "test-instance-123", + "kubescape.io/wlid": "wlid://cluster-test/namespace-default/deployment-nginx", + "kubescape.io/completion": "complete", + "kubescape.io/status": "ready", + }, + Labels: map[string]string{ + "app": "nginx", }, Spec: v1beta1.ContainerProfileSpec{ Architectures: []string{"amd64"}, @@ -241,12 +238,10 @@ func TestStorage_CreateContainerProfile(t *testing.T) { { name: "create container profile with network data", profile: &v1beta1.ContainerProfile{ - ObjectMeta: v1.ObjectMeta{ - Name: "test-container-with-network", - Annotations: map[string]string{ - "kubescape.io/instance-id": "test-instance-456", - "kubescape.io/wlid": "wlid://cluster-test/namespace-default/deployment-web", - }, + Name: "test-container-with-network", + Annotations: map[string]string{ + "kubescape.io/instance-id": "test-instance-456", + "kubescape.io/wlid": "wlid://cluster-test/namespace-default/deployment-web", }, Spec: v1beta1.ContainerProfileSpec{ Architectures: []string{"amd64"}, diff --git a/pkg/utils/datasource_event.go b/pkg/utils/datasource_event.go index 3732223a5c..c24eac1a81 100644 --- a/pkg/utils/datasource_event.go +++ b/pkg/utils/datasource_event.go @@ -77,7 +77,7 @@ type DatasourceEvent struct { Request *http.Request Response *http.Response Syscall string - extra interface{} + extra any } var _ BpfEvent = (*DatasourceEvent)(nil) @@ -370,16 +370,14 @@ func (e *DatasourceEvent) GetDstEndpoint() types.L4Endpoint { port, _ := e.getFieldAccessor("endpoint.port").Uint16(e.Data) proto, _ := e.getFieldAccessor("endpoint.proto_raw").Uint16(e.Data) return types.L4Endpoint{ - L3Endpoint: types.L3Endpoint{ - Addr: rawIPv4ToString(addr), - Version: version, - Namespace: namespace, - Name: name, - Kind: types.EndpointKind(kind), - PodLabels: parseStringToMap(podLabels), - }, - Port: port, - Proto: proto, + Addr: rawIPv4ToString(addr), + Version: version, + Namespace: namespace, + Name: name, + Kind: types.EndpointKind(kind), + PodLabels: parseStringToMap(podLabels), + Port: port, + Proto: proto, } } @@ -489,7 +487,7 @@ func (e *DatasourceEvent) GetExitCode() uint32 { return exitCode } -func (e *DatasourceEvent) GetExtra() interface{} { +func (e *DatasourceEvent) GetExtra() any { return e.extra } @@ -933,7 +931,7 @@ func (e *DatasourceEvent) Release() { e.Datasource.Release(e.Data) } -func (e *DatasourceEvent) SetExtra(extra interface{}) { +func (e *DatasourceEvent) SetExtra(extra any) { e.extra = extra } diff --git a/pkg/utils/datasource_event_tty_test.go b/pkg/utils/datasource_event_tty_test.go index e71a66e7ab..f99f6ae7f1 100644 --- a/pkg/utils/datasource_event_tty_test.go +++ b/pkg/utils/datasource_event_tty_test.go @@ -71,8 +71,11 @@ func newExecEvent(t *testing.T, f ttyFields) *DatasourceEvent { } } -func i32(v int32) *int32 { return &v } -func u32(v uint32) *uint32 { return &v } +//go:fix inline +func i32(v int32) *int32 { return new(v) } + +//go:fix inline +func u32(v uint32) *uint32 { return new(v) } func TestDatasourceEventFieldPresent(t *testing.T) { // Phase-1 gadget shape: only "tty" is emitted. @@ -240,7 +243,7 @@ func TestTTYGettersDoNotLog(t *testing.T) { resetLog(t, f) // The property under test. - for i := 0; i < 100; i++ { + for range 100 { e.GetHasTTY() e.GetTTY() e.GetTTYMajor() @@ -288,7 +291,7 @@ func TestTTYGettersUseTheirOwnDatasource(t *testing.T) { commAcc, err := ds.AddField("comm", api.Kind_String) require.NoError(t, err) padAccs := make([]datasource.FieldAccessor, pads) - for i := 0; i < pads; i++ { + for i := range pads { padAccs[i], err = ds.AddField("pad"+string(rune('a'+i)), api.Kind_Uint64) require.NoError(t, err) } diff --git a/pkg/utils/events.go b/pkg/utils/events.go index bc0a4cdf58..3d8030c153 100644 --- a/pkg/utils/events.go +++ b/pkg/utils/events.go @@ -36,7 +36,7 @@ type EnrichEvent interface { GetContainerImage() string GetContainerImageDigest() string GetError() int64 - GetExtra() interface{} + GetExtra() any FieldPresent(name string) bool GetGid() *uint32 GetHostNetwork() bool @@ -47,7 +47,7 @@ type EnrichEvent interface { GetPodLabels() map[string]string GetPpid() uint32 GetUid() *uint32 - SetExtra(extra interface{}) + SetExtra(extra any) // ECS-specific methods GetEcsClusterName() string diff --git a/pkg/utils/events_test.go b/pkg/utils/events_test.go index 276a628b07..a0bf4634af 100644 --- a/pkg/utils/events_test.go +++ b/pkg/utils/events_test.go @@ -121,7 +121,7 @@ func TestDatasourceEventGetDirection(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Clear package-level fieldCaches maps so we don't bleed cache between tests - fieldCaches.Range(func(key, val interface{}) bool { + fieldCaches.Range(func(key, val any) bool { fieldCaches.Delete(key) return true }) diff --git a/pkg/utils/k8s.go b/pkg/utils/k8s.go index 918c7c068f..c452d0cc6b 100644 --- a/pkg/utils/k8s.go +++ b/pkg/utils/k8s.go @@ -8,9 +8,9 @@ import ( ) type PatchOperation struct { - Op string `json:"op"` - Path string `json:"path"` - Value interface{} `json:"value"` + Op string `json:"op"` + Path string `json:"path"` + Value any `json:"value"` } func CreateK8sContainerID(namespaceName string, podName string, containerId string) string { diff --git a/pkg/utils/struct_event.go b/pkg/utils/struct_event.go index 6879ffed14..84db5fefd2 100644 --- a/pkg/utils/struct_event.go +++ b/pkg/utils/struct_event.go @@ -27,14 +27,14 @@ type StructEvent struct { DNSName string `json:"dnsName,omitempty" yaml:"dnsName,omitempty"` Dir bool `json:"dir,omitempty" yaml:"dir,omitempty"` Direction consts.NetworkDirection `json:"direction,omitempty" yaml:"direction,omitempty"` - DstEndpoint types.L3Endpoint `json:"dstEndpoint,omitempty" yaml:"dstEndpoint,omitempty"` + DstEndpoint types.L3Endpoint `json:"dstEndpoint" yaml:"dstEndpoint,omitempty"` DstIP string `json:"dstIP,omitempty" yaml:"dstIP,omitempty"` DstPort uint16 `json:"dstPort,omitempty" yaml:"dstPort,omitempty"` Error int64 `json:"error,omitempty" yaml:"error,omitempty"` EventType EventType `json:"eventType,omitempty" yaml:"eventType,omitempty"` ExePath string `json:"exePath,omitempty" yaml:"exePath,omitempty"` ExitCode uint32 `json:"exitCode,omitempty" yaml:"exitCode,omitempty"` - Extra interface{} `json:"extra,omitempty" yaml:"extra,omitempty"` + Extra any `json:"extra,omitempty" yaml:"extra,omitempty"` Flags []string `json:"flags,omitempty" yaml:"flags,omitempty"` FlagsRaw uint32 `json:"flagsRaw,omitempty" yaml:"flagsRaw,omitempty"` FullPath string `json:"fullPath,omitempty" yaml:"fullPath,omitempty"` @@ -265,7 +265,7 @@ func (e *StructEvent) GetExitCode() uint32 { return e.ExitCode } -func (e *StructEvent) GetExtra() interface{} { +func (e *StructEvent) GetExtra() any { return e.Extra } @@ -506,7 +506,7 @@ func (e *StructEvent) MakeHttpEvent(request *http.Request, direction consts.Netw func (e *StructEvent) Release() {} -func (e *StructEvent) SetExtra(extra interface{}) { +func (e *StructEvent) SetExtra(extra any) { e.Extra = extra } diff --git a/pkg/utils/time.go b/pkg/utils/time.go index 39d5582dbf..3ba80c7ead 100644 --- a/pkg/utils/time.go +++ b/pkg/utils/time.go @@ -34,6 +34,6 @@ func RandomDuration(max int, duration time.Duration) time.Duration { return time.Duration(rand.Intn(1+max-mini)+mini) * duration } -func FuncName(i interface{}) string { +func FuncName(i any) string { return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() } diff --git a/pkg/watcher/seccompprofilewatcher/seccompprofilewatcher_test.go b/pkg/watcher/seccompprofilewatcher/seccompprofilewatcher_test.go index 41605c17bc..26099197e7 100644 --- a/pkg/watcher/seccompprofilewatcher/seccompprofilewatcher_test.go +++ b/pkg/watcher/seccompprofilewatcher/seccompprofilewatcher_test.go @@ -72,10 +72,8 @@ func TestSeccompProfileWatcher_HandleAdd(t *testing.T) { watcher := NewSeccompProfileWatcher(mockClient, mockManager) profile := &v1beta1api.SeccompProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-profile", - Namespace: "test-namespace", - }, + Name: "test-profile", + Namespace: "test-namespace", Spec: v1beta1api.SeccompProfileSpec{ Containers: []v1beta1api.SingleSeccompProfile{ {Name: "container1"}, @@ -96,10 +94,8 @@ func TestSeccompProfileWatcher_HandleModify(t *testing.T) { watcher := NewSeccompProfileWatcher(mockClient, mockManager) profile := &v1beta1api.SeccompProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-profile", - Namespace: "test-namespace", - }, + Name: "test-profile", + Namespace: "test-namespace", } ctx := context.Background() @@ -115,10 +111,8 @@ func TestSeccompProfileWatcher_HandleDelete(t *testing.T) { watcher := NewSeccompProfileWatcher(mockClient, mockManager) profile := &v1beta1api.SeccompProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-profile", - Namespace: "test-namespace", - }, + Name: "test-profile", + Namespace: "test-namespace", } // First add the profile @@ -139,16 +133,12 @@ func TestSeccompProfileWatcher_ListExisting(t *testing.T) { // Add some profiles to the mock client mockClient.Profiles = []*v1beta1api.SeccompProfile{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "profile1", - Namespace: "ns1", - }, + Name: "profile1", + Namespace: "ns1", }, { - ObjectMeta: metav1.ObjectMeta{ - Name: "profile2", - Namespace: "ns2", - }, + Name: "profile2", + Namespace: "ns2", }, } @@ -165,11 +155,9 @@ func TestSeccompProfileWatcher_ProcessEvents(t *testing.T) { watcher := NewSeccompProfileWatcher(mockClient, mockManager) profile := &v1beta1api.SeccompProfile{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-profile", - Namespace: "test-namespace", - ResourceVersion: "123", - }, + Name: "test-profile", + Namespace: "test-namespace", + ResourceVersion: "123", } ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) @@ -252,7 +240,7 @@ func (c *erroringClient) ListSeccompProfiles(_ string, _ metav1.ListOptions) (*v c.mu.Lock() c.listCalls++ c.mu.Unlock() - return &v1beta1api.SeccompProfileList{ListMeta: metav1.ListMeta{ResourceVersion: "fresh"}}, nil + return &v1beta1api.SeccompProfileList{ResourceVersion: "fresh"}, nil } func (c *erroringClient) GetSeccompProfile(_ string, _ string) (*v1beta1api.SeccompProfile, error) { diff --git a/tests/resources/network_fixture_lint_test.go b/tests/resources/network_fixture_lint_test.go index a7ec6cd0e2..0d78932291 100644 --- a/tests/resources/network_fixture_lint_test.go +++ b/tests/resources/network_fixture_lint_test.go @@ -221,7 +221,7 @@ func dnsNameProblem(d string) string { if strings.Contains(d, "...") { return `contains "..." — use the single-codepoint ellipsis "⋯" (U+22EF) for a mid-label wildcard` } - for _, label := range strings.Split(d, ".") { + for label := range strings.SplitSeq(d, ".") { if label == "" { continue // apex / trailing-dot slot } diff --git a/tests/testutils/k8s.go b/tests/testutils/k8s.go index d98566fa7c..fd99cf55c2 100644 --- a/tests/testutils/k8s.go +++ b/tests/testutils/k8s.go @@ -10,6 +10,7 @@ import ( "math/rand" "os" "path/filepath" + "slices" "strings" "testing" "time" @@ -387,13 +388,7 @@ func (w *TestWorkload) WaitForContainerProfileCompletionWithDenylist(maxRetries } fresh := 0 for i := range cps { - denied := false - for _, item := range denylist { - if cps[i].Name == item { - denied = true - break - } - } + denied := slices.Contains(denylist, cps[i].Name) if denied { continue } @@ -440,16 +435,14 @@ func NewRandomNamespace() TestNamespace { return NewNamespace(generateRandomNamespaceName()) } func NewNamespace(name string) TestNamespace { - ns := TestNamespace{} - ns.Name = name + ns := TestNamespace{ + Name: name} k8sClient := k8sinterface.NewKubernetesApi() _, err := k8sClient.KubernetesClient.CoreV1().Namespaces().Get(context.TODO(), ns.Name, metav1.GetOptions{}) if err != nil { nsSpec := &v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: ns.Name, - }, + Name: ns.Name, } _, err := k8sClient.KubernetesClient.CoreV1().Namespaces().Create(context.TODO(), nsSpec, metav1.CreateOptions{}) @@ -470,7 +463,7 @@ func generateRandomNamespaceName() string { var sb strings.Builder prefix := "node-agent-test-" sb.WriteString(prefix) - for i := 0; i < 4; i++ { + for range 4 { randomIndex := rand.Intn(len(letters)) sb.WriteByte(letters[randomIndex]) } @@ -506,7 +499,7 @@ func IncreaseNodeAgentSniffingTime(newDuration string) { panic(err) } val := cm.Data["config.json"] - config := map[string]interface{}{} + config := map[string]any{} err = json.Unmarshal([]byte(val), &config) if err != nil { panic(err) @@ -832,11 +825,9 @@ func (w *TestWorkload) AddEphemeralContainer(name, image string, command []strin return err } current.Spec.EphemeralContainers = append(current.Spec.EphemeralContainers, v1.EphemeralContainer{ - EphemeralContainerCommon: v1.EphemeralContainerCommon{ - Name: name, - Image: image, - Command: command, - }, + Name: name, + Image: image, + Command: command, }) if _, err := k8sClient.KubernetesClient.CoreV1().Pods(w.Namespace).UpdateEphemeralContainers( context.TODO(), pod.Name, current, metav1.UpdateOptions{}); err != nil { diff --git a/tests/testutils/prometheus.go b/tests/testutils/prometheus.go index 73e335eddc..8dbffa7fa1 100644 --- a/tests/testutils/prometheus.go +++ b/tests/testutils/prometheus.go @@ -111,7 +111,7 @@ func PlotNodeAgentPrometheusMemoryUsage(testcase string, startTime, endTime time } // Function to execute PromQL query -func executePromQLQuery(prometheusURL, query string, timeStart, timeEnd time.Time, steps string) ([]interface{}, error) { +func executePromQLQuery(prometheusURL, query string, timeStart, timeEnd time.Time, steps string) ([]any, error) { // Prepare the query parameters params := url.Values{} params.Set("query", query) @@ -139,7 +139,7 @@ func executePromQLQuery(prometheusURL, query string, timeStart, timeEnd time.Tim var result struct { Status string `json:"status"` Data struct { - Result []interface{} `json:"result"` + Result []any `json:"result"` } `json:"data"` } if err := json.Unmarshal(body, &result); err != nil { @@ -177,13 +177,13 @@ func sendPromQLQueryToProm(query string, timeStart, timeEnd time.Time, steps str // Assuming data is correctly structured as per Prometheus API // Extract timestamps and values assuming the format is correct - result := data[0].(map[string]interface{}) - values := result["values"].([]interface{}) + result := data[0].(map[string]any) + values := result["values"].([]any) timestamps := make([]float64, len(values)) vals := make([]float64, len(values)) for i, v := range values { - valuePair := v.([]interface{}) + valuePair := v.([]any) timestamp := int64(valuePair[0].(float64)) // Convert to int64 timestamps[i] = float64(time.Unix(timestamp, 0).Unix()) valString := fmt.Sprint(valuePair[1]) diff --git a/tests/testutils/utils.go b/tests/testutils/utils.go index 1e39599ccf..db6cdf6b3e 100644 --- a/tests/testutils/utils.go +++ b/tests/testutils/utils.go @@ -14,8 +14,7 @@ func RunCommand(name string, args ...string) int { var stderr bytes.Buffer cmd.Stderr = &stderr if err := cmd.Run(); err != nil { - var exiterr *exec.ExitError - if errors.As(err, &exiterr) { + if exiterr, ok := errors.AsType[*exec.ExitError](err); ok { if stderr.Len() > 0 { fmt.Printf("Command '%s %v' failed: %s\n", name, args, stderr.String()) } From d7eba965d9e918414b0ab4cc305113e91bb2a991 Mon Sep 17 00:00:00 2001 From: Matthias Bertschy Date: Fri, 11 Sep 2026 14:15:19 +0200 Subject: [PATCH 2/2] build: bump Go version to 1.27 in Dockerfiles and GitHub Actions Signed-off-by: Matthias Bertschy --- .github/workflows/benchmark.yaml | 2 +- .github/workflows/bypass.yaml | 2 +- .github/workflows/component-tests.yaml | 2 +- .github/workflows/pr-created.yaml | 2 +- .github/workflows/pr-merged.yaml | 2 +- README.md | 2 +- build/Dockerfile | 2 +- build/Dockerfile.debug | 2 +- build/README.md | 2 +- docs/features/network-stream-process-attribution.md | 2 +- docs/features/process-id-reuse-hardening.md | 2 +- docs/features/process-start-time.md | 2 +- docs/features/process-tree-exit-manager-lifecycle.md | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index cf262a25f4..0c7995b784 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -40,7 +40,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.25" + go-version: "1.27" - name: Install Kind run: | diff --git a/.github/workflows/bypass.yaml b/.github/workflows/bypass.yaml index 49b38b42c5..a518374d5d 100644 --- a/.github/workflows/bypass.yaml +++ b/.github/workflows/bypass.yaml @@ -26,7 +26,7 @@ jobs: CGO_ENABLED: 0 GO111MODULE: "on" BUILD_PLATFORM: linux/amd64,linux/arm64 - GO_VERSION: "1.25" + GO_VERSION: "1.27" REQUIRED_TESTS: "" FORCE: true COSIGN: true diff --git a/.github/workflows/component-tests.yaml b/.github/workflows/component-tests.yaml index bc252d1b78..64a75c3cfd 100644 --- a/.github/workflows/component-tests.yaml +++ b/.github/workflows/component-tests.yaml @@ -168,7 +168,7 @@ jobs: CGO_ENABLED: 0 uses: actions/setup-go@v4 with: - go-version: "1.25" + go-version: "1.27" - name: Set unlimited memlock limit run: | sudo sh -c "ulimit -l unlimited" diff --git a/.github/workflows/pr-created.yaml b/.github/workflows/pr-created.yaml index 856fa2bc26..8f879f80a9 100644 --- a/.github/workflows/pr-created.yaml +++ b/.github/workflows/pr-created.yaml @@ -15,6 +15,6 @@ jobs: pr-created: uses: ./.github/workflows/incluster-comp-pr-created.yaml with: - GO_VERSION: "1.25" + GO_VERSION: "1.27" CGO_ENABLED: 0 secrets: inherit diff --git a/.github/workflows/pr-merged.yaml b/.github/workflows/pr-merged.yaml index 33beef8c76..66ed073d7a 100644 --- a/.github/workflows/pr-merged.yaml +++ b/.github/workflows/pr-merged.yaml @@ -42,7 +42,7 @@ jobs: CGO_ENABLED: 0 GO111MODULE: "on" BUILD_PLATFORM: linux/amd64,linux/arm64 - GO_VERSION: "1.25" + GO_VERSION: "1.27" REQUIRED_TESTS: '[ "relevantCVEs", "relevancy_enabled_stop_sniffing", diff --git a/README.md b/README.md index 7ed5281b45..e51c23dc95 100644 --- a/README.md +++ b/README.md @@ -467,7 +467,7 @@ ls -la /sys/kernel/btf/vmlinux ### Prerequisites -- Go 1.25+ +- Go 1.27+ - Linux with kernel 5.4+ (for eBPF) - Docker (for building images) - kubectl & helm (for testing) diff --git a/build/Dockerfile b/build/Dockerfile index a99f30291b..757bbba378 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.25-trixie AS builder +FROM --platform=$BUILDPLATFORM golang:1.27-trixie AS builder ENV GO111MODULE=on CGO_ENABLED=0 WORKDIR /work diff --git a/build/Dockerfile.debug b/build/Dockerfile.debug index 46ae41a938..b21938e5af 100644 --- a/build/Dockerfile.debug +++ b/build/Dockerfile.debug @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.25-trixie AS builder +FROM --platform=$BUILDPLATFORM golang:1.27-trixie AS builder ENV GO111MODULE=on CGO_ENABLED=0 WORKDIR /work diff --git a/build/README.md b/build/README.md index 2d4f1a4932..aca2da75c6 100644 --- a/build/README.md +++ b/build/README.md @@ -68,7 +68,7 @@ make gadgets ## Build Prerequisites -- **Go 1.25+** - For building the binary +- **Go 1.27+** - For building the binary - **Docker** with buildx - For building container images - **Linux** - Required for eBPF gadget compilation - **Root/sudo** - Required for running gadget builds diff --git a/docs/features/network-stream-process-attribution.md b/docs/features/network-stream-process-attribution.md index da6b91b783..7c0d473a67 100644 --- a/docs/features/network-stream-process-attribution.md +++ b/docs/features/network-stream-process-attribution.md @@ -412,7 +412,7 @@ excludes darwin and is imported transitively. ```bash docker run --rm -v "$PWD":/src -v "$(go env GOMODCACHE)":/go/pkg/mod -w /src \ - -e GOFLAGS=-mod=mod golang:1.25 go test ./pkg/networkstream/... + -e GOFLAGS=-mod=mod golang:1.27 go test ./pkg/networkstream/... ``` `pkg/networkstream/v1` had two test functions before this change, so it carries diff --git a/docs/features/process-id-reuse-hardening.md b/docs/features/process-id-reuse-hardening.md index a4261e8e48..f6be2d6526 100644 --- a/docs/features/process-id-reuse-hardening.md +++ b/docs/features/process-id-reuse-hardening.md @@ -273,7 +273,7 @@ Linux container: ```bash docker run --rm -v "$PWD":/src -v "$(go env GOMODCACHE)":/go/pkg/mod -w /src \ - -e GOFLAGS=-mod=mod golang:1.25 go test -race ./pkg/processtree/... + -e GOFLAGS=-mod=mod golang:1.27 go test -race ./pkg/processtree/... ``` Every reproduction and guard test lives in diff --git a/docs/features/process-start-time.md b/docs/features/process-start-time.md index 1bcefd9487..8892f17344 100644 --- a/docs/features/process-start-time.md +++ b/docs/features/process-start-time.md @@ -195,7 +195,7 @@ excludes darwin and everything under `pkg/processtree` imports it transitively. ```bash docker run --rm -v "$PWD":/src -v "$(go env GOMODCACHE)":/go/pkg/mod -w /src \ - -e GOFLAGS=-mod=mod golang:1.25 go test ./pkg/processtree/... ./pkg/utils/... + -e GOFLAGS=-mod=mod golang:1.27 go test ./pkg/processtree/... ./pkg/utils/... ``` The tick conversion is defined once per package (feeder and creator). Both are diff --git a/docs/features/process-tree-exit-manager-lifecycle.md b/docs/features/process-tree-exit-manager-lifecycle.md index edbb389d0a..eee768d4fa 100644 --- a/docs/features/process-tree-exit-manager-lifecycle.md +++ b/docs/features/process-tree-exit-manager-lifecycle.md @@ -100,5 +100,5 @@ locally: ```bash docker run --rm -v "$PWD":/src -v "$(go env GOMODCACHE)":/go/pkg/mod -w /src \ - -e GOFLAGS=-mod=mod golang:1.25 go test -race ./pkg/processtree/... + -e GOFLAGS=-mod=mod golang:1.27 go test -race ./pkg/processtree/... ```