Conversation
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughType signatures for syscall-related fields changed from unsigned to signed 64-bit integers across API types and the generated protobuf in the softwarecomposition package: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/apis/softwarecomposition/v1beta1/types.go`:
- Line 615: The ErrnoRet int64 field (ErrnoRet) and the other seccomp-related
fields recently changed from uint64 to int64 must enforce non-negativity; add
kubebuilder validation markers to require >= 0 (for example add a comment tag
like "+kubebuilder:validation:Minimum=0" immediately above the ErrnoRet field
and the other int64 seccomp fields that used to be uint64) so the CRD schema
will reject negative values while keeping the Go type as int64 for SSA.
| // the errno return code to use. Some actions like SCMP_ACT_ERRNO and | ||
| // SCMP_ACT_TRACE allow to specify the errno code to return | ||
| ErrnoRet uint64 `json:"errnoRet,omitempty" protobuf:"bytes,3,opt,name=errnoRet"` | ||
| ErrnoRet int64 `json:"errnoRet,omitempty" protobuf:"bytes,3,opt,name=errnoRet"` |
There was a problem hiding this comment.
Reintroduce non-negative validation after changing to int64.
Line 615 and Lines 649-653 now accept negative values that were previously impossible with uint64. Keep int64 for SSA, but enforce >= 0 on these fields to prevent invalid seccomp inputs from entering the API.
Suggested schema-level guardrails
type Syscall struct {
// the errno return code to use. Some actions like SCMP_ACT_ERRNO and
// SCMP_ACT_TRACE allow to specify the errno code to return
+ // +kubebuilder:validation:Minimum=0
ErrnoRet int64 `json:"errnoRet,omitempty" protobuf:"bytes,3,opt,name=errnoRet"`
}
// Arg defines the specific syscall in seccomp.
type Arg struct {
// the index for syscall arguments in seccomp
+ // +kubebuilder:validation:Minimum=0
Index int64 `json:"index" protobuf:"bytes,1,opt,name=index"`
// the value for syscall arguments in seccomp
+ // +kubebuilder:validation:Minimum=0
Value int64 `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
// the value for syscall arguments in seccomp
+ // +kubebuilder:validation:Minimum=0
ValueTwo int64 `json:"valueTwo,omitempty" protobuf:"bytes,3,opt,name=valueTwo"`
}Also applies to: 649-653
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/apis/softwarecomposition/v1beta1/types.go` at line 615, The ErrnoRet
int64 field (ErrnoRet) and the other seccomp-related fields recently changed
from uint64 to int64 must enforce non-negativity; add kubebuilder validation
markers to require >= 0 (for example add a comment tag like
"+kubebuilder:validation:Minimum=0" immediately above the ErrnoRet field and the
other int64 seccomp fields that used to be uint64) so the CRD schema will reject
negative values while keeping the Go type as int64 for SSA.
|
Summary:
|
Summary by CodeRabbit