@@ -46,7 +46,6 @@ import (
46
46
"github.com/containerd/nerdctl/v2/pkg/imgutil"
47
47
"github.com/containerd/nerdctl/v2/pkg/inspecttypes/native"
48
48
"github.com/containerd/nerdctl/v2/pkg/labels"
49
- "github.com/containerd/nerdctl/v2/pkg/logging"
50
49
"github.com/containerd/nerdctl/v2/pkg/ocihook/state"
51
50
)
52
51
@@ -97,7 +96,14 @@ type ImageMetadata struct {
97
96
98
97
type LogConfig struct {
99
98
Type string
100
- Config logging.LogConfig
99
+ Config loggerLogConfig
100
+ }
101
+
102
+ type loggerLogConfig struct {
103
+ Driver string `json:"driver"`
104
+ Opts map [string ]string `json:"opts,omitempty"`
105
+ LogURI string `json:"-"`
106
+ Address string `json:"address"`
101
107
}
102
108
103
109
// Container mimics a `docker container inspect` object.
@@ -307,7 +313,7 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
307
313
// c.HostConfig.LogConfig.Config = map[string]string{}
308
314
}
309
315
if logConfigJSON , ok := n .Labels [labels .LogConfig ]; ok {
310
- var logConfig logging. LogConfig
316
+ var logConfig loggerLogConfig
311
317
err := json .Unmarshal ([]byte (logConfigJSON ), & logConfig )
312
318
if err != nil {
313
319
return nil , fmt .Errorf ("failed to unmarshal log config: %v" , err )
@@ -317,7 +323,7 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
317
323
c .HostConfig .LogConfig .Config = logConfig
318
324
} else {
319
325
// If LogConfig label is not present, set default values
320
- c .HostConfig .LogConfig .Config = logging. LogConfig {
326
+ c .HostConfig .LogConfig .Config = loggerLogConfig {
321
327
Driver : "json-file" ,
322
328
Opts : make (map [string ]string ),
323
329
}
0 commit comments