-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ClassCastException: class io.fabric8.kubernetes.api.model.Secret cannot be cast to class io.fabric8.kubernetes.api.model.GenericKubernetesResource #3328
Comments
@manusa unfortunately I didn't spot this issue when you originally asked me to check the PR where |
There's handling for this in the ReflectorWatcher that needs moved up into
the AbstractWatchManager.
…On Sat, Jul 17, 2021 at 9:29 AM Luca Burgazzoli ***@***.***> wrote:
@manusa <https://github.com/manusa> unfortunately I didn't spot this
issue when you originally asked me to check the PR where
GenericKubernetesResource has been introduced.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3328 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAS4NFKPG6JR5UBGQ5LN5CDTYGASFANCNFSM5ARCNC5Q>
.
|
I wouldn't agree 100% on this being a bug. If you are dealing with a known type, why do you want to handle this as a Raw/Unstructured/CustomResource type? What's the main reason you are using a CRD definition and the extra hassle instead of using the known type? |
I can't because my operator does not know the type of the resources as they are retrieved from another service, then the operator set-up a watcher on them and reacts upon changes in a generic way. Of course I can eventually come up with something like a switch case to check if it is a know resource, but since the operator does not care about the type, I think that it would just make the code hard to maintain. |
Since it's just a small fix and makes the unstructured logic work with anything, I'll produce a pr for this. |
OK, this is what I imagined. In your snippet you provided a hard-coded "v1"+"Secret" group-version + kind combination, I understand that in your operator these values are dynamic. One of the next steps for the GenericKubernetesResource is to be able to use this with resource with DSL methods such as
🙌 cool, thx! |
I have an operator where I set up watcher using the
customResource
to be able to watch any kind of resource, something like:When an event happen on a secret, the following exception is thrown:
The text was updated successfully, but these errors were encountered: