1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

fix(docker/container): pass empty command and entrypoint [EE-6106] (#10285)

This commit is contained in:
Chaim Lev-Ari 2023-09-13 10:47:13 +01:00 committed by GitHub
parent 0a80f4dc51
commit fbdbd277f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,14 +20,18 @@ export function toRequest(
User: values.user,
WorkingDir: values.workingDir,
...getConsoleConfig(values.console),
};
} satisfies CreateContainerRequest;
if (values.cmd) {
config.Cmd = commandStringToArray(values.cmd);
} else if (values.cmd === null) {
delete config.Cmd;
}
if (values.entrypoint) {
config.Entrypoint = commandStringToArray(values.entrypoint);
} else if (values.entrypoint === null) {
delete config.Entrypoint;
}
return config;