kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

Replace Go model generation for openshift-model-config

Open manusa opened this issue 1 year ago • 1 comments

Description

Part of #6130

Replace model generation for openshift-model-config module with new OpenAPI approach.

[!Note] For OpenShift models there are going to be multiple conflicts with the previously generated code. The openapi-generator won't reuse some of the types since OpenShift's OpenAPI spec hasn't got shared references and model types are defined inline.

Tasks

  • Remove build-helper-maven-plugin
  • Remove maven-antrun-plugin from the generate profile
  • Add openapi-model-generator-maven-plugin to the generate profile
  • Configure the plugin to generate the specific classes
  • Remove the go-related files and directories (Makefile, cmd)
  • Remove invocation from the generateModel.sh script

manusa avatar Aug 14 '24 11:08 manusa

Problems with Sundrio generation (same as for kubernetes-model-kustomize #6189/#6312 and kubernetes-model-resource #6188/#6257).

Some fields have no type and get declared as private KubernetesResource fieldName;. When Sundrio generates the builder for these classes, some builder methods (withXxxx) get duplicate (besides the amount of time it takes to generate). In this case, it's specially disturbing since some of this fields include the generic spec and status field. (for example in APIServer, ClusterServer, and a few others)

We can try to fix this downstream just like we did for kutomize and model-resource. However, in this case it might not be that easy and will probably limit the functionality of the builder. A solution should be found upstream.

manusa avatar Aug 30 '24 12:08 manusa