bpfman / bpfman/bpfman-operator

Update API types to comply with new Kubernetes API conventions

Open
#460 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
38
Forks
27
PR merge metrics
No merged PRs in 30d

Description

## Summary
Update bpfman-operator CRD API types to comply with new Kubernetes API conventions as outlined in [kubernetes/community#8486](https://github.com/kubernetes/community/pull/8486) and OpenShift API linter requirements.

## Context
Recent updates to Kubernetes API conventions require:
- All fields must have `omitempty` tags
- Optional fields in aggregated APIs (those with protobuf tags) must use pointers
- Complete validation rules for all string and list fields
- `omitzero` tags for struct fields where appropriate

## Current State
Our APIs are partially compliant but need systematic updates across:
- `apis/v1alpha1/shared_types.go`
- `apis/v1alpha1/*_types.go` (all program type files)
- Validation rules are incomplete for many fields

## Proposed Changes
1. **Field Tags**: Add `omitempty` to all fields
2. **Pointer Usage**: Convert optional fields to pointers in aggregated APIs
3. **Validation**: Add MinLength/MaxLength to strings, MinItems/MaxItems to arrays
4. **Struct Validation**: Add MinProperties for structs with all optional fields

## References
- [Kubernetes API Conventions PR #8486](https://github.com/kubernetes/community/pull/8486)
- OpenShift API linter enforcement

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with apis/v1alpha1/shared_types.go and the apis/v1alpha1/*_types.go program files, then compare their tags, pointer usage, and validation markers with Kubernetes API conventions PR #8486 and OpenShift API linter requirements. Done means the affected fields follow the stated omitempty, pointer, string/list validation, and struct validation rules across the API types.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
api, infrastructure
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.