Skip to content

Commit

Permalink
SecretEnricher getSecretsFromXmlConfig should return Collections.empt…
Browse files Browse the repository at this point in the history
…yList() instead of null
  • Loading branch information
sankritimishra committed Jan 13, 2024
1 parent 82999a0 commit f90f423
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import org.eclipse.jkube.kit.enricher.api.util.SecretConstants;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;

public abstract class SecretEnricher extends BaseEnricher {

Expand Down Expand Up @@ -129,10 +127,8 @@ private void addSecretsFromXmlConfiguration(KubernetesListBuilder builder) {

private List<SecretConfig> getSecretsFromXmlConfig() {
ResourceConfig resourceConfig = getConfiguration().getResource();
if(resourceConfig != null && resourceConfig.getSecrets() != null) {
return resourceConfig.getSecrets();
}
return null;
return Optional.ofNullable(resourceConfig.getSecrets()).orElse(Collections.emptyList());

}

private String getDockerIdFromAnnotation(Map<String, String> annotation) {
Expand Down

0 comments on commit f90f423

Please sign in to comment.