@@ -96,11 +96,6 @@ type ImageMetadata struct {
96
96
LastTagTime time.Time `json:",omitempty"`
97
97
}
98
98
99
- type LogConfig struct {
100
- Type string
101
- Config loggerLogConfig
102
- }
103
-
104
99
type loggerLogConfig struct {
105
100
Driver string `json:"driver"`
106
101
Opts map [string ]string `json:"opts,omitempty"`
@@ -145,7 +140,7 @@ type Container struct {
145
140
type HostConfig struct {
146
141
ExtraHosts []string // List of extra hosts
147
142
PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host
148
- LogConfig LogConfig // Configuration of the logs for this container
143
+ LogConfig loggerLogConfig // Configuration of the logs for this container
149
144
BlkioWeight uint16 // Block IO weight (relative weight vs. other containers)
150
145
CPUSetMems string `json:"CpusetMems"` // CpusetMems 0-2, 0,1
151
146
CPUSetCPUs string `json:"CpusetCpus"` // CpusetCpus 0-2, 0,1
@@ -344,7 +339,7 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
344
339
}
345
340
346
341
if nerdctlLoguri := n .Labels [labels .LogURI ]; nerdctlLoguri != "" {
347
- c .HostConfig .LogConfig .Type = nerdctlLoguri
342
+ c .HostConfig .LogConfig .LogURI = nerdctlLoguri
348
343
}
349
344
if logConfigJSON , ok := n .Labels [labels .LogConfig ]; ok {
350
345
var logConfig loggerLogConfig
@@ -354,10 +349,10 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
354
349
}
355
350
356
351
// Assign the parsed LogConfig to c.HostConfig.LogConfig
357
- c .HostConfig .LogConfig . Config = logConfig
352
+ c .HostConfig .LogConfig = logConfig
358
353
} else {
359
354
// If LogConfig label is not present, set default values
360
- c .HostConfig .LogConfig . Config = loggerLogConfig {
355
+ c .HostConfig .LogConfig = loggerLogConfig {
361
356
Driver : "json-file" ,
362
357
Opts : make (map [string ]string ),
363
358
}
0 commit comments