1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00

fix(docker/container): container logs viewer error when logging is disabled (#10384)

* fix(docker/container-logs): invalid string breadcrumb

* fix(docker/container): let docker select the logging driver by default on container create

* fix(docker/container-logs): information panel in container logs when logging is disabled

* fix(docker/container): dont include HostConfig.LogConfig if no driver is selected
This commit is contained in:
LP B 2023-09-28 15:53:52 +02:00 committed by GitHub
parent d678b155ba
commit ada6b31f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 74 additions and 6 deletions

View file

@ -58,7 +58,7 @@ export function LoggerConfig({
<TextTip color="blue">
Logging driver that will override the default docker daemon driver.
Select Default logging driver if you don&apos;t want to override it.
Supported logging drivers can be found
Supported logging drivers can be found{' '}
<a
href="https://docs.docker.com/engine/admin/logging/overview/#supported-logging-drivers"
target="_blank"
@ -133,6 +133,6 @@ export function validation(): SchemaOf<LogConfig> {
value: string().required('Value is required'),
})
),
type: string().default('none'),
type: string().default(''),
});
}

View file

@ -34,6 +34,11 @@ export function toRequest(
delete config.Entrypoint;
}
// don't include LogConfig object if "Default logging driver" (type === '') is selected
if (values.logConfig.type === '') {
delete config.HostConfig.LogConfig;
}
return config;
function getLogConfig(

View file

@ -39,7 +39,7 @@ export function toViewModel(config: ContainerJSON): Values {
function getLogConfig(value?: HostConfig['LogConfig']): LogConfig {
if (!value || !value.Type) {
return {
type: 'none',
type: '',
options: [],
};
}