Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions adapters/backend/v1/pulsar.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ func (c *PulsarMessageReader) readerLoop(ctx context.Context) {
for {
msg, err := c.reader.Next(ctx)
if err != nil {
if ctx.Err() != nil {
logger.L().Ctx(ctx).Info("pulsar reader closed due to context cancellation")
return
}
if pulsarErr, ok := err.(*pulsar.Error); ok && pulsarErr.Result() == pulsar.ConsumerClosed {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amirmalka can you check if that makes sense?

logger.L().Ctx(ctx).Info("pulsar reader closed normally")
return
}
logger.L().Ctx(ctx).Fatal("failed to read message from pulsar", helpers.Error(err))
}

Expand Down
57 changes: 26 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/kubescape/synchronizer
go 1.25.6

require (
github.com/apache/pulsar-client-go v0.12.1
github.com/apache/pulsar-client-go v0.16.0
github.com/armosec/armoapi-go v0.0.596
github.com/armosec/utils-k8s-go v0.0.30
github.com/cenkalti/backoff/v4 v4.3.0
Expand All @@ -24,7 +24,7 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/spf13/viper v1.20.1
github.com/stretchr/testify v1.11.0
github.com/testcontainers/testcontainers-go v0.33.0
github.com/testcontainers/testcontainers-go v0.35.0
github.com/testcontainers/testcontainers-go/modules/k3s v0.33.0
Comment on lines +27 to 28
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

testcontainers-go k3s module v0.35.0 compatibility

💡 Result:

In testcontainers-go v0.35.0, the K3s module is supported and ships in-repo (it has existed since v0.21.0) and you use it by importing github.com/testcontainers/testcontainers-go/modules/k3s and starting it via k3s.Run(...) (the Run entrypoint is documented as available since v0.32.0). [1][2]

K3s image compatibility: the module is designed to run whatever rancher/k3s:<tag> image you pass in (the docs show examples like rancher/k3s:v1.27.1-k3s1). [1][3]

Environment compatibility constraints (common “it doesn’t work” cases): K3s runs as a privileged container and needs to be able to spawn containers, so it may not work in rootless Docker, Docker-in-Docker, or other environments where privileged containers are disallowed. [4]

v0.35.0-specific note: v0.35.0 introduced core breaking changes (not K3s-specific), notably container.Terminate(ctx) gaining variadic termination options and a change from ShouldPrintBuildLog to BuildLogWriter for Dockerfile builds—these can affect compilation if your test harness uses those APIs. [2]

Sources:
[1] https://golang.testcontainers.org/modules/k3s/
[2] https://github.com/testcontainers/testcontainers-go/releases/tag/v0.35.0
[3] https://testcontainers.com/modules/k3s/
[4] https://java.testcontainers.org/modules/k3s/


🌐 Web query:

testcontainers-go/modules/k3s version release history

💡 Result:

testcontainers-go/modules/k3s (Go) – version/release history (highlights)

Module-level milestones are tracked as part of the main github.com/testcontainers/testcontainers-go release versions:

Testcontainers-Go version K3s module change
v0.21.0 K3s module exists (“Since v0.21.0”); GetKubeConfig available. [2]
v0.25.0 (*K3sContainer).LoadImages(...) added. [1], [2]
v0.29.0 WithManifest(manifestPath) option added. [1], [2]
v0.32.0 Run(ctx, img, ...) entrypoint added (and RunContainer later marked deprecated). [1], [2]
v0.39.0 (*K3sContainer).LoadImagesWithOpts(...) added. [1]
v0.40.0 (latest shown on GitHub releases page, Nov 6, 2025) Repo-wide module migration work includes “k3s: use Run function” (PR #3413). [3]

Sources: pkg.go.dev API “added in vX.Y.Z” annotations for modules/k3s [1], Testcontainers-Go K3s module docs [2], and testcontainers-go GitHub releases page (latest + v0.40.0 notes) [3].


🌐 Web query:

testcontainers-go v0.35.0 k3s module version requirements

💡 Result:

For testcontainers-go v0.35.0, the K3s module is a separate Go module you depend on as:

  • github.com/testcontainers/testcontainers-go/modules/k3s@v0.35.0 (published Jan 10, 2025) [1][2]

In practice, that means:

  • Pinning modules/k3s to v0.35.0 will also pull in the matching testcontainers-go v0.35.0 dependency (because the module lives in the same repo/version line) [2].
  • Your project will also need Kubernetes client libraries (e.g., k8s.io/client-go, k8s.io/api, k8s.io/apimachinery) as shown by the module’s documented usage/imports [3].

I wasn’t able to fetch the exact modules/k3s v0.35.0 go.mod contents (to list the precise Go version / exact dependency version pins) from the available sources here, because the go.mod link resolves to GitHub content that failed to load in this environment [2]. If you paste the go.mod (or tell me your go env GOPROXY), I can extract the exact version requirements precisely.

Sources: [1] [2] [3]


Align K3s module version to match core v0.35.0.

The K3s module is pinned to v0.33.0 while the core is at v0.35.0. Since both are part of the same testcontainers-go repository and versioned together, they should match. The v0.35.0 release introduced breaking changes to the core API (Terminate signature and ShouldPrintBuildLogBuildLogWriter), which the v0.33.0 K3s module may not account for. Update modules/k3s to v0.35.0 to ensure compatibility.

Fix
-	github.com/testcontainers/testcontainers-go/modules/k3s v0.33.0
+	github.com/testcontainers/testcontainers-go/modules/k3s v0.35.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
github.com/testcontainers/testcontainers-go v0.35.0
github.com/testcontainers/testcontainers-go/modules/k3s v0.33.0
github.com/testcontainers/testcontainers-go v0.35.0
github.com/testcontainers/testcontainers-go/modules/k3s v0.35.0
🤖 Prompt for AI Agents
In `@go.mod` around lines 27 - 28, Update the testcontainers k3s module version to
match the core package: change the dependency for
"github.com/testcontainers/testcontainers-go/modules/k3s" from v0.33.0 to
v0.35.0 so it aligns with "github.com/testcontainers/testcontainers-go v0.35.0";
this ensures the k3s module is compatible with the core API changes (e.g.,
Terminate signature and BuildLogWriter) and avoids version mismatch issues.

go.uber.org/multierr v1.11.0
golang.org/x/mod v0.29.0
Expand All @@ -37,14 +37,14 @@ require (
)

require (
cloud.google.com/go/auth v0.9.9 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/auth v0.15.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
cloud.google.com/go/compute/metadata v0.7.0 // indirect
cloud.google.com/go/container v1.42.0 // indirect
cloud.google.com/go/container v1.42.2 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/AthenZ/athenz v1.11.52 // indirect
github.com/AthenZ/athenz v1.12.13 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect
Expand All @@ -67,21 +67,21 @@ require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/aws/aws-sdk-go-v2 v1.36.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.29.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.59 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.28 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.32 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.32 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.2 // indirect
github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect
github.com/aws/aws-sdk-go-v2/config v1.29.9 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.62 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.40.3 // indirect
github.com/aws/aws-sdk-go-v2/service/eks v1.48.5 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.35.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.13 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.15 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.14 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.14 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.17 // indirect
github.com/aws/smithy-go v1.22.2 // indirect
github.com/becheran/wildmatch-go v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -98,7 +98,7 @@ require (
github.com/containerd/platforms v0.2.1 // indirect
github.com/containers/common v0.63.0 // indirect
github.com/coreos/go-oidc/v3 v3.14.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v28.3.2+incompatible // indirect
Expand Down Expand Up @@ -135,20 +135,19 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gohugoio/hashstructure v0.5.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-containerregistry v0.20.6 // indirect
github.com/google/licensecheck v0.3.1 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.5 // indirect
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hamba/avro/v2 v2.26.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -158,7 +157,6 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/linkedin/goavro/v2 v2.12.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mackerelio/go-osstat v0.2.5 // indirect
github.com/magiconair/properties v1.8.10 // indirect
Expand Down Expand Up @@ -186,7 +184,6 @@ require (
github.com/opencontainers/runtime-spec v1.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand Down Expand Up @@ -225,7 +222,6 @@ require (
github.com/yl2chen/cidranger v1.0.2 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
Expand Down Expand Up @@ -256,15 +252,14 @@ require (
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/api v0.203.0 // indirect
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
google.golang.org/api v0.224.0 // indirect
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect
google.golang.org/grpc v1.72.1 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.34.1 // indirect
k8s.io/apiserver v0.34.1 // indirect
Expand Down
Loading
Loading