Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support for shortNames in CRD generation #271

Closed
tillig opened this issue Sep 2, 2021 · 3 comments
Closed

Support for shortNames in CRD generation #271

tillig opened this issue Sep 2, 2021 · 3 comments
Labels

Comments

@tillig
Copy link
Contributor

tillig commented Sep 2, 2021

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

I'm trying to build an SMI adapter for Istio since the current one is defunct. As part of that, I'm replicating the custom entities in memory and trying to use the original CRD vs my generated one as a way to compare what I've got done.

I noticed the original CRD has shortNames specified, like:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: trafficsplits.split.smi-spec.io
spec:
  group: split.smi-spec.io
  scope: Namespaced
  names:
    kind: TrafficSplit
    listKind: TrafficSplitList
    shortNames:
    - ts
    plural: trafficsplits
    singular: trafficsplit

It doesn't seem this is part of the [KubernetesEntity] attribute and there's no other place to specify them, so there's no way to add them to the output CRD.

Describe the solution you'd like

Some way to specify shortNames for generation. I'd be OK if it was one attribute, like...

[KubernetesEntityShortNames("a", "b", "c")]
public class Entity : CustomKubernetesEntity {}

or maybe a single attribute you could apply multiple times...

[KubernetesEntityShortName("a")]
[KubernetesEntityShortName("a")]
[KubernetesEntityShortName("a")]
public class Entity : CustomKubernetesEntity {}

But some way to add that to the generated spec would be cool.

BTW, I was about to jump ship on trying to get a controller running in C# and switch to Go (which I am... not that great at) when I found this super amazing SDK you have here and I have to say, this is the booooomb 💣 . Thanks!

@tillig tillig added the enhancement New feature or request label Sep 2, 2021
@buehler
Copy link
Owner

buehler commented Sep 3, 2021

Hey @tillig

Thanks 😊

That's a nice addition to the CRD generator, going to look into it.

buehler added a commit that referenced this issue Sep 20, 2021
This closes #271. Adding a custom attribute
`KubernetesEntityShortNames` which can be used
to add `shortNames` to a CRD of an entity.
The attribute needs to be added to the class of
an entity and is inherited.
buehler added a commit that referenced this issue Sep 20, 2021
This closes #271. Adding a custom attribute
`KubernetesEntityShortNames` which can be used
to add `shortNames` to a CRD of an entity.
The attribute needs to be added to the class of
an entity and is inherited.
@github-actions
Copy link

🎉 This issue has been resolved in version 6.0.0-prerelease.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

buehler added a commit that referenced this issue Oct 11, 2021
This closes #271. Adding a custom attribute
`KubernetesEntityShortNames` which can be used
to add `shortNames` to a CRD of an entity.
The attribute needs to be added to the class of
an entity and is inherited.
@github-actions
Copy link

🎉 This issue has been resolved in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants