Skip to content

Conversation

@vyommani
Copy link
Contributor

@vyommani vyommani commented Nov 12, 2025

What changes were proposed in this pull request?

RangerBasePlugin initialization fails with an IllegalArgumentException when the ranger.plugin..policy.rest.url property is not set.
The issue occurs because getConfiguredURLs() returns an empty list, causing Random.nextInt(0) to throw an exception.

How was this patch tested?

wrote a new test TestRangerRESTClient.testPluginInit_WithNoUrl_DoesNotCrash() this will fail without fix and pass with fix.


setLastKnownActiveUrlIndex((new Random()).nextInt(getConfiguredURLs().size()));

int size = getConfiguredURLs().size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check on configuredURLs instead as it fetch the configured URLs? Also what is the impact of setting setLastKnownActiveUrlIndex(0); as there is no Url to call the end point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants