Skip to content

Update API types to comply with new Kubernetes API conventions #460

@frobware

Description

@frobware

Summary

Update bpfman-operator CRD API types to comply with new Kubernetes API conventions as outlined in kubernetes/community#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions