Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

'generate openapi' - CRD name and group are wrong #1608

Closed
jpkrohling opened this issue Jun 27, 2019 · 4 comments · Fixed by #1636
Closed

'generate openapi' - CRD name and group are wrong #1608

jpkrohling opened this issue Jun 27, 2019 · 4 comments · Fixed by #1636
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jpkrohling
Copy link

Bug Report

When running operator-sdk generate openapi against the Jaeger Operator, the CRD's name and group are overridden, from the original jaegers.jaegertracing.io / jaegertracing.io to jaegers.jaegertracing.jaegertracing / jaegertracing.jaegertracing.

What did you do?
Executed operator-sdk generate openapi against an existing operator (Jaeger's).

Environment

  • operator-sdk version: v0.8.1, commit: 33b3bfe10176f8647f5354516fff29dea42b6342

  • go version: go1.12.5 linux/amd64

  • Kubernetes version information:

Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:14:56Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
@AlexNPavel
Copy link
Contributor

/cc @estroz

@estroz
Copy link
Member

estroz commented Jun 28, 2019

@jpkrohling were these CRDs generated with the SDK? The behavior should have been the same when looking at the commits in the SDK, controller-tools, and jaeger-operator at the time jaegertracing_v1_jaeger_crd.yaml was generated; io_v1alpha1_jaeger_crd.yaml probably wasn’t generated with the SDK because we committed scaffolding code after its initial commit. The issue is in controller-tools’ API parsing, which we do not modify before scaffolding CRDs and in fact emulate when generating CRDs in non-Go projects.

@estroz estroz self-assigned this Jun 28, 2019
@jpkrohling
Copy link
Author

I had the impression that the newest was generated via the SDK's generator, but I might be wrong. How is the name composed? Is there something I could change in the Jaeger Operator in order to get the SDK regenerate the proper CRD?

@estroz
Copy link
Member

estroz commented Jul 2, 2019

@jpkrohling when I delved into the issue further I figured out that the controller-tools CRD generator was getting the incorrect domain for jaegertracing_v1_jaeger_crd.yaml from io_v1alpha1_jaeger_crd.yaml. The gist of the issue is we only run the CRD generator once and assume the domain is the same for all API's, which is not a correct assumption. This is not an issue in controller-tools v0.2.0, which we'll be upgrading to after #1512 is merged, but I'll make a PR beforehand since this should be fixed in a backwards-compatible way.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants