-
Notifications
You must be signed in to change notification settings - Fork 431
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 parametrized types #756
Comments
Hi @wI2L, It seems happens because your custom type does not exist in the project. You would need to have its specification on the project.
However, regards conditional status see that it has an standard: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties Therefore, I would recommend you work with as it is done via the deploy image plugin provide by kubebuilder, see: https://book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html You can check in the testdata samples of its scaffold:
In this way, after check the info provide above could you please let us know if you still thinking that this issue is required? Also, note that your help is very welcome. Please, feel free to contribute with PR's for both projects or indeed to propose a solution for your request in this issue. |
Hello @camilamacedo86
Yes it does. The custom types I mentionned were defined in a I am aware of API conventions regarding
Again, I'm sorry, but I don't see how that's relevant or related to the issue. This example uses the
As I said, this isn't a bug report, the goal of the issue is to raise awarness about the lack of support for parametrized types, in the hope that it could be a feature improvement in the future. Without parametrized types, |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Also seeing this issue with a parameterised interface such as:
but producing a different error:
Edit: nevermind - seems that is a generic problem with any interface, not just parameterised generics. |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Could be the same issue as #844 |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hello.
I tried to experiment with the latest version of
controller-gen
(v0.10.0
), to use a parametrized type, like this:It appears that this generics syntax is not supported by
controller-gen
, because it does not handle theast.IndexListExpr
type.The error reported looks like the following:
The line reported by the error log correspond to the declaration of the
MyObjectCondition
type.To give some more context, I was trying to factorize a
Condition
type, to reuse it in several CRD'sstatus
field.The idea is to define a generic
Condition
type like the following:...and use it like so, with well-defined type parameters, to ensure type safety/checking:
The current alternative is to simply declare the
Type
andReason
fields of theCondition
struct asstring
, at the expanse of loosing type checking.I'm reporting it, hoping that it could be considered for future improvements towards a better support of the newer AST types introduced in go1.18.
The text was updated successfully, but these errors were encountered: