Skip to content

fix: bump kubescape/storage to v0.0.301 to resolve CRD schema drift - #404

Merged
matthyx merged 2 commits into
kubescape:mainfrom
doraem-on:fix-403-bump-storage
Aug 11, 2026
Merged

fix: bump kubescape/storage to v0.0.301 to resolve CRD schema drift#404
matthyx merged 2 commits into
kubescape:mainfrom
doraem-on:fix-403-bump-storage

Conversation

@doraem-on

@doraem-on doraem-on commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #403

Overview

This PR fixes #403

Signed Commits

  • Yes, I signed my commits.

This PR updates the github.com/kubescape/storage dependency from v0.0.239 to v0.0.301 to match the rest of the fleet (kubescape, kubevuln, node-agent).

Current Behavior: The operator is ~60 releases behind the shared storage library. While there are no active bugs for the CRDs it currently reads (WorkloadConfigurationScan, etc.), if it were to read other CRDs like NetworkNeighborhood today, it would silently drop newly introduced fields (like ipAddresses) due to outdated Go struct bindings.

Future Behavior: By bumping the dependency, the operator's schema definitions are now fully synchronized with the rest of the fleet, preventing latent bugs or silent schema drift.

Additional Information

The dependency bump pulled in the latest schemas and automatically upgraded a few transient telemetry packages via go mod tidy. No functional operator code required changes, proving backwards compatibility.

Here are the real output logs from applying the fix:

$ go get github.com/kubescape/storage\@v0.0.301 && go mod tidy

go: downloading github.com/kubescape/storage v0.0.301

go: upgraded github.com/kubescape/k8s-interface v0.0.202 => v0.0.214

go: upgraded github.com/kubescape/storage v0.0.239 => v0.0.301

go: upgraded go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 => v1.43.0

How to Test

  1. Run the existing test suite in CI (go test ./...) to verify that the upgraded library models do not break the operator's unmarshaling logic.
  2. Ensure that operator builds properly and all existing workflows pass.

Related issues/PRs:

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas (N/A)
  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests. (N/A - dependency update)
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes

    • Improved detection and association of workloads, pods, and container profiles during findings and monitoring workflows.
    • Updated metadata handling to ensure related resources are identified consistently.
  • Chores

    • Updated internal dependency versions to incorporate the latest maintenance updates and improvements.

Fixes kubescape#403

Signed-off-by: Lalit Kishore <lr_be24@thapar.edu>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@doraem-on, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0af91b80-c6cf-41d9-bc0f-d550903d7e15

📥 Commits

Reviewing files that changed from the base of the PR and between d583463 and a900a1c.

📒 Files selected for processing (1)
  • watcher/containerprofilewatcher.go
📝 Walkthrough

Walkthrough

The pull request updates resource identity lookups to use related-resource metadata labels. It updates the related test fixtures and increases the versions of two direct Go dependencies.

Changes

Related resource label handling

Layer / File(s) Summary
Migrate resource identity lookups
mainhandler/findings.go, mainhandler/findings_test.go, watcher/containerprofilewatcher.go, watcher/containerprofilewatcher_test.go
Findings and container profile watcher logic now reads related kind, name, and namespace labels. Tests use the updated label keys.

Dependency updates

Layer / File(s) Summary
Update direct dependency versions
go.mod
Updates github.com/kubescape/k8s-interface to v0.0.214 and github.com/kubescape/storage to v0.0.301.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: updating kubescape/storage to v0.0.301 to address CRD schema drift.
Linked Issues check ✅ Passed The PR updates kubescape/storage to v0.0.301 and adjusts affected metadata references, meeting issue #403 requirements.
Out of Scope Changes check ✅ Passed All changes support the dependency update and its required build fixes; no unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

matthyx
matthyx previously approved these changes Aug 11, 2026

@matthyx matthyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Dependency bump of to and to is clean and correctly resolves CRD schema drift (#403).

@matthyx

matthyx commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

CI is failing due to build errors in after bumping to :

watcher/containerprofilewatcher.go:164:38: undefined: helpersv1.KindMetadataKey
watcher/containerprofilewatcher.go:168:38: undefined: helpersv1.NameMetadataKey
watcher/containerprofilewatcher.go:170:59: undefined: helpersv1.NameMetadataKey
watcher/containerprofilewatcher.go:182:46: undefined: helpersv1.KindMetadataKey
watcher/containerprofilewatcher.go:184:27: undefined: helpersv1.NameMetadataKey
watcher/containerprofilewatcher.go:185:32: undefined: helpersv1.NamespaceMetadataKey

The metadata keys in were updated/relocated in . Please update to use the new constant names.

…ild failures

Signed-off-by: Lalit Kishore <lr_be24@thapar.edu>
@doraem-on
doraem-on force-pushed the fix-403-bump-storage branch from c486920 to a900a1c Compare August 11, 2026 07:33
@doraem-on

Copy link
Copy Markdown
Contributor Author

@matthyx thanks for your time , now I have resolved conflicts

@matthyx matthyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Code has been updated to use the new RelatedKindMetadataKey, RelatedNameMetadataKey, and RelatedNamespaceMetadataKey constants from storage v0.0.301. All CI checks are green.

@matthyx
matthyx merged commit e10569c into kubescape:main Aug 11, 2026
11 checks passed
@matthyx matthyx moved this to To Archive in KS PRs tracking Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Archive

Development

Successfully merging this pull request may close these issues.

Tech Debt: kubescape/storage dependency is ~60 releases behind, risking silent schema drift on CRDs

2 participants