Skip to content

fix: remove unrecognized int format from CRD schemas#1399

Closed
fl-sean03 wants to merge 1 commit intokagent-dev:mainfrom
fl-sean03:fix/1318-crd-int64-warning
Closed

fix: remove unrecognized int format from CRD schemas#1399
fl-sean03 wants to merge 1 commit intokagent-dev:mainfrom
fl-sean03:fix/1318-crd-int64-warning

Conversation

@fl-sean03
Copy link
Contributor

Summary

Fixes #1318

When running helm install kagent-crds oci://ghcr.io/kagent-dev/kagent/helm/kagent-crds, warnings are emitted:

Warning: unrecognized format "int64"
Warning: unrecognized format "int32"

These warnings come from format: int32 and format: int64 annotations in the CRD OpenAPI schemas. While controller-gen adds these annotations from Go types (int32/int64), the Kubernetes API server does not recognize them as valid OpenAPI format values.

Changes

  1. go/Makefile: Added a post-processing step to make manifests that strips format: int32 and format: int64 lines from generated CRD YAML files after controller-gen runs
  2. CRD files: Removed the format annotations from all CRD files in both go/config/crd/bases/ and helm/kagent-crds/templates/

This is a standard approach used by many Kubernetes operators to suppress these warnings. The integer type information (type: integer) is preserved — only the unrecognized format annotation is removed.

Test plan

  • All CRD YAML files parse correctly after removal
  • CRD files in go/config/crd/bases/ and helm/kagent-crds/templates/ are in sync
  • helm install kagent-crds no longer produces int format warnings

Remove `format: int32` and `format: int64` annotations from CRD OpenAPI
schemas. These format values are not recognized by the Kubernetes API
server and produce warnings during `helm install`:

  Warning: unrecognized format "int64"
  Warning: unrecognized format "int32"

The format annotations are automatically added by controller-gen from Go
types (int32/int64) but serve no purpose in the Kubernetes CRD validation
schema. This change:

1. Adds a post-processing step to `make manifests` that strips these
   format lines from generated CRD YAML files
2. Updates the current CRD files in both go/config/crd/bases/ and
   helm/kagent-crds/templates/

Fixes kagent-dev#1318

Signed-off-by: Sean <sean@opspawn.com>
Signed-off-by: fl-sean03 <jmhbh@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 27, 2026 19:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Kubernetes API server warnings emitted during helm install by removing unsupported format: int32 / format: int64 entries from CRD OpenAPI schemas, and ensuring regenerated CRDs have those fields stripped post-controller-gen.

Changes:

  • Add a make manifests post-processing step to delete format: int32 / format: int64 from generated CRDs.
  • Remove format: int32 / format: int64 entries from CRD YAMLs under go/config/crd/bases/.
  • Remove the same format entries from the Helm CRD chart templates under helm/kagent-crds/templates/.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go/Makefile Adds a post-generation cleanup step to strip unsupported integer format fields from CRDs.
go/config/crd/bases/kagent.dev_agents.yaml Removes format: int32/int64 from schema fields to avoid install warnings.
go/config/crd/bases/kagent.dev_memories.yaml Removes format: int64 entries from schema fields.
go/config/crd/bases/kagent.dev_modelconfigs.yaml Removes format: int64 entries from schema fields.
go/config/crd/bases/kagent.dev_modelproviderconfigs.yaml Removes format: int64 entries from schema fields.
go/config/crd/bases/kagent.dev_remotemcpservers.yaml Removes format: int64 entries from schema fields.
go/config/crd/bases/kagent.dev_toolservers.yaml Removes format: int64 entries from schema fields.
helm/kagent-crds/templates/kagent.dev_agents.yaml Mirrors CRD schema cleanup in Helm CRD chart templates.
helm/kagent-crds/templates/kagent.dev_memories.yaml Mirrors CRD schema cleanup in Helm CRD chart templates.
helm/kagent-crds/templates/kagent.dev_modelconfigs.yaml Mirrors CRD schema cleanup in Helm CRD chart templates.
helm/kagent-crds/templates/kagent.dev_modelproviderconfigs.yaml Mirrors CRD schema cleanup in Helm CRD chart templates.
helm/kagent-crds/templates/kagent.dev_remotemcpservers.yaml Mirrors CRD schema cleanup in Helm CRD chart templates.
helm/kagent-crds/templates/kagent.dev_toolservers.yaml Mirrors CRD schema cleanup in Helm CRD chart templates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@# Remove format: int32/int64 from CRD schemas to avoid Kubernetes API server warnings
@# See https://github.com/kagent-dev/kagent/issues/1318
@for f in config/crd/bases/*.yaml; do \
sed -i '/^[[:space:]]*format: int\(32\|64\)$$/d' "$$f"; \
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sed -i without a backup extension is GNU-sed specific; on macOS/BSD sed this will fail and break make manifests (and anything depending on it, e.g. make run). Consider making the in-place edit portable (e.g., use a backup suffix and remove it, or detect GNU vs BSD sed and set a SED_INPLACE variable accordingly).

Suggested change
sed -i '/^[[:space:]]*format: int\(32\|64\)$$/d' "$$f"; \
sed -i.bak '/^[[:space:]]*format: int\(32\|64\)$$/d' "$$f"; \
rm "$$f.bak"; \

Copilot uses AI. Check for mistakes.
@fl-sean03
Copy link
Contributor Author

Closing as duplicate of #1352 which addresses the same issue. Apologies for the noise.

@fl-sean03 fl-sean03 closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] kagent helm install warning

3 participants