|
|
|
@ -24,6 +24,7 @@ import java.util.function.Consumer; |
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode; |
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode; |
|
|
|
|
|
|
|
import org.jspecify.annotations.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.buildpack.platform.json.MappedObject; |
|
|
|
import org.springframework.boot.buildpack.platform.json.MappedObject; |
|
|
|
|
|
|
|
|
|
|
|
@ -38,7 +39,7 @@ public class ImageConfig extends MappedObject { |
|
|
|
|
|
|
|
|
|
|
|
private final Map<String, String> labels; |
|
|
|
private final Map<String, String> labels; |
|
|
|
|
|
|
|
|
|
|
|
private final Map<String, String> configEnv; |
|
|
|
private final Map<String, @Nullable String> configEnv; |
|
|
|
|
|
|
|
|
|
|
|
ImageConfig(JsonNode node) { |
|
|
|
ImageConfig(JsonNode node) { |
|
|
|
super(node, MethodHandles.lookup()); |
|
|
|
super(node, MethodHandles.lookup()); |
|
|
|
@ -55,12 +56,12 @@ public class ImageConfig extends MappedObject { |
|
|
|
return labels; |
|
|
|
return labels; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Map<String, String> parseConfigEnv() { |
|
|
|
private Map<String, @Nullable String> parseConfigEnv() { |
|
|
|
String[] entries = valueAt("/Env", String[].class); |
|
|
|
String[] entries = valueAt("/Env", String[].class); |
|
|
|
if (entries == null) { |
|
|
|
if (entries == null) { |
|
|
|
return Collections.emptyMap(); |
|
|
|
return Collections.emptyMap(); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, String> env = new LinkedHashMap<>(); |
|
|
|
Map<String, @Nullable String> env = new LinkedHashMap<>(); |
|
|
|
for (String entry : entries) { |
|
|
|
for (String entry : entries) { |
|
|
|
int i = entry.indexOf('='); |
|
|
|
int i = entry.indexOf('='); |
|
|
|
String name = (i != -1) ? entry.substring(0, i) : entry; |
|
|
|
String name = (i != -1) ? entry.substring(0, i) : entry; |
|
|
|
@ -88,7 +89,7 @@ public class ImageConfig extends MappedObject { |
|
|
|
* an empty {@code Map} is returned. |
|
|
|
* an empty {@code Map} is returned. |
|
|
|
* @return the env, never {@code null} |
|
|
|
* @return the env, never {@code null} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Map<String, String> getEnv() { |
|
|
|
public Map<String, @Nullable String> getEnv() { |
|
|
|
return this.configEnv; |
|
|
|
return this.configEnv; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|