kubescape / kubescape/storage

Enhancement: Implement /status subresource for SBOMSyft and SBOMSyftFiltered

Open
#360 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
4
Forks
22
Avg merge
20h 43m
Merged PRs (30d)
33

Description

### Problem

Currently, the `SBOMSyftStatus` struct is empty, and there is no `/status` REST subresource implemented for `SBOMSyft` and `SBOMSyftFiltered`.

Because of this limitation, downstream consumers (like the vulnerability scanner in `kubevuln`) are forced to store the operational state (e.g., `learning`, `tooLarge`, `incomplete`) as annotations on the object instead of using standard Kubernetes API conventions. This is an anti-pattern for aggregated API servers and makes state tracking difficult for controllers.

### Proposed Solution

1. Add structured fields (`Status`, `StatusReason`, `Limit`) to the `SBOMSyftStatus` struct in the API definitions.
2. Implement a `StatusStrategy` that protects the `Spec` from being modified during `/status` updates.
3. Expose the `NewStatusREST` endpoints in the `etcd.go` registry stores.
4. Wire the endpoints into `pkg/apiserver/apiserver.go`.

### Context

This is a prerequisite to resolving the annotation anti-pattern in `kubevuln`:
* kubescape/kubevuln#496

Contributor guide

Open the contributing guide

Research direction

Start with the API definitions containing SBOMSyftStatus, then inspect the etcd.go registry stores and pkg/apiserver/apiserver.go. Trace how existing status subresources define their strategy and REST endpoints; done means SBOMSyft and SBOMSyftFiltered expose /status, protect Spec during status updates, and store the proposed status fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.