@@ -46,7 +46,6 @@ import (
4646 "github.com/containerd/nerdctl/v2/pkg/imgutil"
4747 "github.com/containerd/nerdctl/v2/pkg/inspecttypes/native"
4848 "github.com/containerd/nerdctl/v2/pkg/labels"
49- "github.com/containerd/nerdctl/v2/pkg/logging"
5049 "github.com/containerd/nerdctl/v2/pkg/ocihook/state"
5150)
5251
@@ -97,7 +96,14 @@ type ImageMetadata struct {
9796
9897type LogConfig struct {
9998 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"`
101107}
102108
103109// Container mimics a `docker container inspect` object.
@@ -307,7 +313,7 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
307313 // c.HostConfig.LogConfig.Config = map[string]string{}
308314 }
309315 if logConfigJSON , ok := n .Labels [labels .LogConfig ]; ok {
310- var logConfig logging. LogConfig
316+ var logConfig loggerLogConfig
311317 err := json .Unmarshal ([]byte (logConfigJSON ), & logConfig )
312318 if err != nil {
313319 return nil , fmt .Errorf ("failed to unmarshal log config: %v" , err )
@@ -317,7 +323,7 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
317323 c .HostConfig .LogConfig .Config = logConfig
318324 } else {
319325 // If LogConfig label is not present, set default values
320- c .HostConfig .LogConfig .Config = logging. LogConfig {
326+ c .HostConfig .LogConfig .Config = loggerLogConfig {
321327 Driver : "json-file" ,
322328 Opts : make (map [string ]string ),
323329 }
0 commit comments