Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Change plural for RemoteResourceS3 from remoteresourcess3 to remoteresources3s #80

Closed
dvasilen opened this issue Apr 13, 2020 · 5 comments
Assignees

Comments

@dvasilen
Copy link

dvasilen commented Apr 13, 2020

Is your feature request related to a problem? Please describe.

The plural name for the RemoteResourceS3 in YAML is somewhat unorthodox and makes it difficult to use k8s code-generator to create go-lang clientset bindings.

Describe the solution you'd like

Change plural: remoteresourcess3 to plural: remoteresources3s in RemoteResourceS3 YAML or provide go-lang clientset bindings for the Razee CRDs.

Describe alternatives you've considered

To workaround the problem we have to manually update the generated go-lang code and change the remoteresources3s to remoteresourcess3

Additional context

Here is the attempt to work around the problem. The generated code is on the right. The edited code is on the left.

image

@alewitt2
Copy link
Member

alewitt2 commented Apr 15, 2020

I can see how the plural may seem unorthodox, but the idea is that the S3 is a modifier on RemoteResource. therefor, RemoteResources is the plural, and S3 still being a modifier, results in RemoteResourcesS3.

At this point i think it creates unneeded confusion to change the plural, as it would create a new CRD name in Kubernetes, and would look like a duplicate on systems already using razee.

To me it seems like more of a bug with the code generator, and an issue should be opened with them. The code generator should respect that the english language uses more than just an s to denote a plural, and therefor use the plural defined in the CRD and not assume the plural is just the same name with an s on the end. Note: kubectl used to have the same problem many versions ago, but they have since fixed this and no longer assume plural == s.

provide go-lang clientset bindings for the Razee CRDs.

Until the issue you create for the code generator is resolved, I can investigate this, but i dont fully understand what it means. Can you elaborate on what work this would entail and where i can learn more on how to do what you are asking?

@alewitt2
Copy link
Member

for reference, here is the issue i was talking about for kubectl:
kubernetes/kubernetes#51639

and the corresponding fix:
kubernetes/kubernetes#50012

@dvasilen
Copy link
Author

Until the issue you create for the code generator is resolved, I can investigate this, but i dont fully understand what it means. Can you elaborate on what work this would entail and where i can learn more on how to do what you are asking?

We are creating and deploying the RemoteResourceS3 programmatically in the go-lang code. For that we'd need to generate the go-lang representation for the RemoteResourceS3 as well as so called clientset. Here is the repo with the generated code we are currently using https://github.com/dvasilen/razee-rrs3/tree/master/pkg. If that generated code could be provided by razee-io that would be great. Some info on programming kubernetes CRDs can be found at https://insujang.github.io/2020-02-13/programming-kubernetes-crd/. We are mostly interested in the clientset as you already provide the controller part.

@alewitt2
Copy link
Member

Unfortunately, we cant change the plural form without breaking existing users.

Luckily you have a work around, and we dont change the actual definition all that often, so it shouldnt be that much extra work for the time being.

I have gone ahead and opened an issue kubernetes/code-generator#101 to get the code generator on par with the expected kubernetes behavior.

If this isnt enough and you still feel blocked, please let me know.

@dvasilen
Copy link
Author

Closing as a workaround is available. We'll use https://github.com/dvasilen/razee-rrs3/tree/master/pkg for now and revisit if/when kubernetes/code-generator#101 is addressed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants