@@ -15,18 +15,18 @@ import (
15
15
func (c * Calcium ) CacheImage (ctx context.Context , opts * types.ImageOptions ) (chan * types.CacheImageMessage , error ) {
16
16
logger := log .WithField ("Calcium" , "CacheImage" ).WithField ("opts" , opts )
17
17
if err := opts .Validate (); err != nil {
18
- logger .Errorf (ctx , err , "" )
18
+ logger .Error (ctx , err )
19
19
return nil , err
20
20
}
21
21
22
22
nodes , err := c .filterNodes (ctx , & types.NodeFilter {Podname : opts .Podname , Includes : opts .Nodenames })
23
23
if err != nil {
24
- logger .Errorf (ctx , err , "" )
24
+ logger .Error (ctx , err )
25
25
return nil , err
26
26
}
27
27
28
28
if len (nodes ) == 0 {
29
- logger .Errorf (ctx , types .ErrPodNoNodes , "" )
29
+ logger .Error (ctx , types .ErrPodNoNodes )
30
30
return nil , types .ErrPodNoNodes
31
31
}
32
32
@@ -49,7 +49,7 @@ func (c *Calcium) CacheImage(ctx context.Context, opts *types.ImageOptions) (cha
49
49
Message : "" ,
50
50
}
51
51
if err := pullImage (ctx , node , image ); err != nil {
52
- logger .Errorf (ctx , err , "" )
52
+ logger .Error (ctx , err )
53
53
m .Success = false
54
54
m .Message = err .Error ()
55
55
}
@@ -66,18 +66,18 @@ func (c *Calcium) CacheImage(ctx context.Context, opts *types.ImageOptions) (cha
66
66
func (c * Calcium ) RemoveImage (ctx context.Context , opts * types.ImageOptions ) (chan * types.RemoveImageMessage , error ) {
67
67
logger := log .WithField ("Calcium" , "RemoveImage" ).WithField ("opts" , opts )
68
68
if err := opts .Validate (); err != nil {
69
- logger .Errorf (ctx , err , "" )
69
+ logger .Error (ctx , err )
70
70
return nil , err
71
71
}
72
72
73
73
nodes , err := c .filterNodes (ctx , & types.NodeFilter {Podname : opts .Podname , Includes : opts .Nodenames })
74
74
if err != nil {
75
- logger .Errorf (ctx , err , "" )
75
+ logger .Error (ctx , err )
76
76
return nil , err
77
77
}
78
78
79
79
if len (nodes ) == 0 {
80
- logger .Errorf (ctx , types .ErrPodNoNodes , "" )
80
+ logger .Error (ctx , types .ErrPodNoNodes )
81
81
return nil , types .ErrPodNoNodes
82
82
}
83
83
@@ -99,7 +99,7 @@ func (c *Calcium) RemoveImage(ctx context.Context, opts *types.ImageOptions) (ch
99
99
Messages : []string {},
100
100
}
101
101
if removeItems , err := node .Engine .ImageRemove (ctx , image , false , true ); err != nil {
102
- logger .Errorf (ctx , err , "" )
102
+ logger .Error (ctx , err )
103
103
m .Messages = append (m .Messages , err .Error ())
104
104
} else {
105
105
m .Success = true
@@ -129,12 +129,12 @@ func (c *Calcium) ListImage(ctx context.Context, opts *types.ImageOptions) (chan
129
129
130
130
nodes , err := c .filterNodes (ctx , & types.NodeFilter {Podname : opts .Podname , Includes : opts .Nodenames })
131
131
if err != nil {
132
- logger .Errorf (ctx , err , "" )
132
+ logger .Error (ctx , err )
133
133
return nil , err
134
134
}
135
135
136
136
if len (nodes ) == 0 {
137
- logger .Errorf (ctx , types .ErrPodNoNodes , "" )
137
+ logger .Error (ctx , types .ErrPodNoNodes )
138
138
return nil , types .ErrPodNoNodes
139
139
}
140
140
@@ -155,7 +155,7 @@ func (c *Calcium) ListImage(ctx context.Context, opts *types.ImageOptions) (chan
155
155
Error : nil ,
156
156
}
157
157
if images , err := node .Engine .ImageList (ctx , opts .Filter ); err != nil {
158
- logger .Errorf (ctx , err , "" )
158
+ logger .Error (ctx , err )
159
159
msg .Error = err
160
160
} else {
161
161
for _ , image := range images {
0 commit comments