Improper return value prevents local mode operation
With LOCAL_MODE true, the Search Service (and possibly others) does not start due to NullPointerException in this library. In org.opengroup.osdu.core.aws.ssm.K8sLocalParameterProvider:93
// this is for credentials, credentials mounted by CSI is a json string
// if in local mode, it returns an empty HashMap, it is the responsibility of end user to getDefault
public Map<String, String> getCredentialsAsMap(String parameterKey) throws K8sParameterNotFoundException, JsonProcessingException {
if (localMode) {
return null;
}
return objectMapper.readValue(this.getParameterAsString(parameterKey), typeRef);
Despite the comment to the contrary, the return value causes problems for example in org.opengroup.osdu.core.aws.entitlements.ServiceAccountJwtAwsClientImpl:50
private void init() {
K8sLocalParameterProvider provider = new K8sLocalParameterProvider();
try {
client_credentials_clientid = provider.getParameterAsString("CLIENT_CREDENTIALS_ID");
client_credentials_secret = provider.getCredentialsAsMap("CLIENT_CREDENTIALS_SECRET").get("client_credentials_client_secret");
...
If we change "return null;" to "return new HashMap<>();" it works better.