kubernetes-client / gen

Common generator scripts for all client libraries
Apache License 2.0
148 stars 148 forks source link

Missing IoK8sApimachineryPkgApisMetaV1ObjectMeta in generated classes #159

Closed franck102 closed 4 years ago

franck102 commented 4 years ago

After following the instructions in generate-model-from-third-party-resources.md the classes generated have references to a io.kubernetes.client.models.IoK8sApimachineryPkgApisMetaV1ObjectMeta which I cannot find anywhere?

The cluster version is 1.15 (minikube) and it contains a number of CRDs from the prometheus-operator (https://github.com/coreos/prometheus-operator).

Here is a typical snippet from the generated code:

ComCoreosMonitoringV1PodMonitor.java:
    public static final String SERIALIZED_NAME_METADATA = "metadata";
    @SerializedName(SERIALIZED_NAME_METADATA)
    private IoK8sApimachineryPkgApisMetaV1ObjectMeta metadata = null;

The commands I used:

    kc get --raw="/openapi/v2" > openapi.json
    docker run -i --rm yue9944882/java-model-gen < openapi.json | tar -xzf - -C ./tmp
franck102 commented 4 years ago

The correct class is io.kubernetes.client.openapi.models.V1ObjectMeta

and everything works fine after manually updating the generated code.

yue9944882 commented 4 years ago

this is fixed in yue9944882/java-model-gen:v0.0.3 plz retry w/ that image

brendandburns commented 4 years ago

I think this can be closed?

yue9944882 commented 4 years ago

/close

as this is addressed

k8s-ci-robot commented 4 years ago

@yue9944882: Closing this issue.

In response to [this](https://github.com/kubernetes-client/gen/issues/159#issuecomment-630198019): >/close > >as this is addressed Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.