Ported codegen changes from the apiserver-poc branch and updated the component add codegen to be compatible. Codegen changes are behind new flags introduced to the CLI:
--kindgrouping=kind|group - kind is the existing, default behavior, group puts all the kinds for the same group in the same package, and prefixes all the types and functions for a kind with the kind name (excepting the kind resource.Object implementation, which retains the same name).
--postprocess=true|false - defaults to false, and will be true if present (like --overwrite). This instructs the CLI to run code generation based on the generated files (right now, just the kubernetes openAPI generation). This is not on by default as it will cause the generate command to fail if go.mod doesn't list all the dependencies in the generated code.
Changes not behind flags:
A resource.ListObject implementation is now generated as part of the codegen. It is not currently used anywhere aside from OpenAPI generation in --postprocess, but a separate PR will introduce a default/zero-value ListObject to the Schema interface, and codegen will be updated to add this implementation to its generated schema.
// +k8s:openapi-gen=true comments have been added to generated types. These are used by --postprocess, but should not impact anything otherwise.
Ported codegen changes from the
apiserver-poc
branch and updated thecomponent add
codegen to be compatible. Codegen changes are behind new flags introduced to the CLI:--kindgrouping=kind|group
-kind
is the existing, default behavior,group
puts all the kinds for the same group in the same package, and prefixes all the types and functions for a kind with the kind name (excepting the kindresource.Object
implementation, which retains the same name).--postprocess=true|false
- defaults tofalse
, and will betrue
if present (like--overwrite
). This instructs the CLI to run code generation based on the generated files (right now, just the kubernetes openAPI generation). This is not on by default as it will cause thegenerate
command to fail ifgo.mod
doesn't list all the dependencies in the generated code.Changes not behind flags:
resource.ListObject
implementation is now generated as part of the codegen. It is not currently used anywhere aside from OpenAPI generation in--postprocess
, but a separate PR will introduce a default/zero-valueListObject
to theSchema
interface, and codegen will be updated to add this implementation to its generated schema.// +k8s:openapi-gen=true
comments have been added to generated types. These are used by--postprocess
, but should not impact anything otherwise.