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

Private configuration classes cause trouble with Java native (reflection) #4724

Closed
manusa opened this issue Jan 4, 2023 · 15 comments · Fixed by quarkusio/quarkus#31781
Closed
Assignees
Labels
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jan 4, 2023

From quarkusio/quarkus#30153

Some configuration classes (referenced issue is about ExecConfig but maybe there are more) have private access and need to be referenced by name in order to register them for reflection with GraalVM.

These classes should be exposed. In addition, it would be interesting to catalog these classes with an interface or something else, so that they can be automatically detected (Jandex) to be registered when used.

rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 15, 2023
…sses public (fabric8io#4724)

Expose these nested config classes so that they can be used in
reflection.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 15, 2023
…sses public (fabric8io#4724)

Expose these nested config classes so that they can be used in
reflection.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit to rohanKanojia/kubernetes-client that referenced this issue Feb 21, 2023
…sses public (fabric8io#4724)

Expose these nested config classes so that they can be used in
reflection.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Feb 21, 2023
…sses public (#4724)

Expose these nested config classes so that they can be used in
reflection.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@rohanKanojia
Copy link
Member

@manusa : What else needs to be done in order to close this issue? I didn't add any interface because there were only three classes.

@manusa
Copy link
Member Author

manusa commented Feb 22, 2023

@manusa : What else needs to be done in order to close this issue? I didn't add any interface because there were only three classes.

You did list a few other classes too in your comment. Are those classes accessible by users? are they susceptible to be serialized/deserialized?

@rohanKanojia
Copy link
Member

They are private static classes but they are not configuration classes. I don't think it makes sense to make them accessible to users.

@manusa
Copy link
Member Author

manusa commented Feb 22, 2023

are they susceptible to be serialized/deserialized? ----> Are they accessible from Config?

@rohanKanojia
Copy link
Member

No, these classes do not seem to be accessible from io.fabric8.kubernetes.client.Config

@manusa
Copy link
Member Author

manusa commented Feb 23, 2023

I'm leaving the issue open to update the Quarkus references once 6.5.0 is released

@manusa
Copy link
Member Author

manusa commented Mar 15, 2023

Addressed in Quarkus with quarkusio/quarkus#31781. Closing issue.

@manusa manusa closed this as completed Mar 15, 2023
@tomslot
Copy link

tomslot commented Jul 26, 2023

Still occurring with the latest lib version (6.8.0), only when run on Java 17, works well on Java 11

@rohanKanojia
Copy link
Member

@tomslot : What error are you getting? Is it with the same classes? Is it possible to share a reproducer?

@rohanKanojia
Copy link
Member

@tomslot : Shall we move this conversation to a new issue or reopen this one?

@tomslot
Copy link

tomslot commented Jul 26, 2023

The bug is located in io.fabric8.kubernetes.client.Config.getExecCredentialFromExecConfig():
The library is trying to parse a plain string error message output from ProcessBuilder as ExecCredential json.
The ProcessBuilder is executing the following command:
/usr/local/bin/aws --region XXX eks get-token --cluster-name YYY --output json

And the output is

"The SSO session associated with this profile has expired or is otherwise invalid. To refresh this SSO session run aws sso login with the corresponding profile."

Feel free to create a new ticket if it serves your process better.

@tomslot
Copy link

tomslot commented Jul 26, 2023

probably with Java 11 the string is parsed to null and with Java 17 it throws an exception

@rohanKanojia
Copy link
Member

@tomslot : Sorry but from your comment, I think it's a different issue from this one. Is it possible to create a new ticket?

@tomslot
Copy link

tomslot commented Jul 26, 2023

I've just created #5361.
I got here from another ticket, which described my problem and was a supposed duplicate of this issue.

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

Successfully merging a pull request may close this issue.

4 participants