Skip to content

Commit 230b659

Browse files
committed
chore: fix logConfig inspect response
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent b0a9fb5 commit 230b659

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pkg/inspecttypes/dockercompat/dockercompat.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ type ImageMetadata struct {
9696
LastTagTime time.Time `json:",omitempty"`
9797
}
9898

99-
type LogConfig struct {
100-
Type string
101-
Config loggerLogConfig
102-
}
103-
10499
type loggerLogConfig struct {
105100
Driver string `json:"driver"`
106101
Opts map[string]string `json:"opts,omitempty"`
@@ -145,7 +140,7 @@ type Container struct {
145140
type HostConfig struct {
146141
ExtraHosts []string // List of extra hosts
147142
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
149144
BlkioWeight uint16 // Block IO weight (relative weight vs. other containers)
150145
CPUSetMems string `json:"CpusetMems"` // CpusetMems 0-2, 0,1
151146
CPUSetCPUs string `json:"CpusetCpus"` // CpusetCpus 0-2, 0,1
@@ -344,7 +339,7 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
344339
}
345340

346341
if nerdctlLoguri := n.Labels[labels.LogURI]; nerdctlLoguri != "" {
347-
c.HostConfig.LogConfig.Type = nerdctlLoguri
342+
c.HostConfig.LogConfig.LogURI = nerdctlLoguri
348343
}
349344
if logConfigJSON, ok := n.Labels[labels.LogConfig]; ok {
350345
var logConfig loggerLogConfig
@@ -354,10 +349,10 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
354349
}
355350

356351
// Assign the parsed LogConfig to c.HostConfig.LogConfig
357-
c.HostConfig.LogConfig.Config = logConfig
352+
c.HostConfig.LogConfig = logConfig
358353
} else {
359354
// If LogConfig label is not present, set default values
360-
c.HostConfig.LogConfig.Config = loggerLogConfig{
355+
c.HostConfig.LogConfig = loggerLogConfig{
361356
Driver: "json-file",
362357
Opts: make(map[string]string),
363358
}

0 commit comments

Comments
 (0)