Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,27 @@ Two manifest variants exist:
- **Standard:** Production-ready features
- **Experimental:** Features under development/testing (includes `ClusterObjectSet` API)

### API Conventions

API changes in `api/v1/*_types.go` must follow the [OpenShift API conventions](https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md) in addition to upstream [Kubernetes API conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md).

After modifying API types, run `make manifests crd-ref-docs` to regenerate CRDs, reference docs, and manifests. Run `make lint-api-diff` to validate changes against kube-api-linter.

**Deprecating fields:** Follow Go and OpenShift conventions (see [openshift/api](https://github.com/openshift/api) for examples):

```go
// Deprecated: fieldName is no longer used and will be removed in a future release.
// Explanation of why and what replaces it.
//
// +optional
FieldName Type `json:"fieldName,omitzero"`
Comment on lines +219 to +223
```

- Use `Deprecated:` with capital D and colon (Go convention, recognized by godoc and staticcheck)
- Deprecated fields must be `+optional`, never `+required`
- Add `omitzero` (structs) or `omitempty` (scalars) to JSON tags
- For intentional reads of deprecated fields (e.g. deprecation warnings), add `//nolint:staticcheck` with a reason

---

## Git Workflows
Expand Down