[skip ci] Merge pull request #56 from jwr1/master

Fix environment vars and labels containing multiple equals
This commit is contained in:
Yann Stepienik 2023-07-24 12:56:33 +01:00 committed by GitHub
commit 8e9649ec2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -225,7 +225,7 @@ const DockerComposeImport = ({ refresh, dockerComposeInit, installerInit, defaul
if (Array.isArray(doc.services[key].labels)) { if (Array.isArray(doc.services[key].labels)) {
let labels = {}; let labels = {};
doc.services[key].labels.forEach((label) => { doc.services[key].labels.forEach((label) => {
const [key, value] = label.split('='); const [key, value] = label.split(/=(.*)/s);
labels['' + key] = '' + value; labels['' + key] = '' + value;
}); });
doc.services[key].labels = labels; doc.services[key].labels = labels;

View file

@ -56,7 +56,7 @@ const DockerContainerSetup = ({noCard, containerInfo, installer, OnChange, refre
image: containerInfo.Config.Image, image: containerInfo.Config.Image,
restartPolicy: containerInfo.HostConfig.RestartPolicy.Name, restartPolicy: containerInfo.HostConfig.RestartPolicy.Name,
envVars: containerInfo.Config.Env.map((envVar) => { envVars: containerInfo.Config.Env.map((envVar) => {
const [key, value] = envVar.split('='); const [key, value] = envVar.split(/=(.*)/s);
return { key, value }; return { key, value };
}), }),
labels: Object.keys(containerInfo.Config.Labels).map((key) => { labels: Object.keys(containerInfo.Config.Labels).map((key) => {