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
Implement auto detection #221
Conversation
@Override | ||
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") | ||
public boolean isAutoDetectionApplicable() { | ||
return new File("/var/run/secrets/kubernetes.io/serviceaccount/token").exists(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Files.isRegularFile(path)
instead. Otherwise, you'd need to check if the file is not a directory as well.
Apparently, it's faster as well 🤷♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it actually slower? https://rules.sonarsource.com/java/tag/performance/RSPEC-3725
FYI: This will never be a directory, so not a big deal with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I see there used to be a bug on JDK 8 which got fixed later on. However, I don't see any signs that it was backported JDK 8, so I guess we can leave it as is 🤷♂️
verify |
Note that:
hazelcast-kubernetes
can be used with older hazelcast versions)After this change, IMO the newbie experience is great.
No configuration needed!