Skip to content

Commit

Permalink
Merge pull request #30247 from ranjanashish/support-quoted-and-indexe…
Browse files Browse the repository at this point in the history
…d-properties

Support quoted and indexed properties during container launch
  • Loading branch information
radcortez authored Jan 10, 2023
2 parents 8ce4d3f + aaeb8b1 commit 126aa68
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import io.quarkus.runtime.util.ContainerRuntimeUtil;
import io.quarkus.test.common.http.TestHTTPResourceManager;
import io.smallrye.config.common.utils.StringUtil;

public class DefaultDockerContainerLauncher implements DockerContainerArtifactLauncher {

Expand Down Expand Up @@ -189,14 +190,14 @@ private List<String> toEnvVar(String property, String value) {
if ((property != null) && (!property.isEmpty())) {
List<String> result = new ArrayList<>(2);
result.add("--env");
result.add(String.format("%s=%s", convertPropertyToEnVar(property), value));
result.add(String.format("%s=%s", convertPropertyToEnvVar(property), value));
return result;
}
return Collections.emptyList();
}

private String convertPropertyToEnVar(String property) {
return property.toUpperCase().replace('-', '_').replace('.', '_').replace('/', '_');
private String convertPropertyToEnvVar(String property) {
return StringUtil.replaceNonAlphanumericByUnderscores(property).toUpperCase();
}

@Override
Expand Down

0 comments on commit 126aa68

Please sign in to comment.