Skip to content

Invalid CRD with when no string default value is used #6654

@mfvitale

Description

@mfvitale

Describe the bug

With the generator v2 the default are not working as expected. If you define for example

@Default(defaultValue = "60000")
private long flushMs = 60000L;

the generated crd will put the default value as a string causing the crd to not be valid.

Error from server (Invalid): error when creating "k8/debeziumservers.debezium.io-v1.yml": CustomResourceDefinition.apiextensions.k8s.io "debeziumservers.debezium.io" is invalid: [spec.validation.openAPIV3Schema.properties[spec].properties[source].properties[offset].properties[flushMs].default: Invalid value: "string":  in body must be of type integer: 

Fabric8 Kubernetes Client version

6.13.4

Steps to reproduce

Maybe adding a test in

will be a good starting point to easily reproduce it.

Expected behavior

The correct default value should be used.

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3@latest

Environment

Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions