@@ -22,7 +22,11 @@ func (pm *Manager) Disable(name string) error {
22
22
if err != nil {
23
23
return err
24
24
}
25
- return pm .disable (p )
25
+ if err := pm .disable (p ); err != nil {
26
+ return err
27
+ }
28
+ pm .pluginEventLogger (p .PluginObj .ID , name , "disable" )
29
+ return nil
26
30
}
27
31
28
32
// Enable activates a plugin, which implies that they are ready to be used by containers.
@@ -31,7 +35,11 @@ func (pm *Manager) Enable(name string) error {
31
35
if err != nil {
32
36
return err
33
37
}
34
- return pm .enable (p )
38
+ if err := pm .enable (p ); err != nil {
39
+ return err
40
+ }
41
+ pm .pluginEventLogger (p .PluginObj .ID , name , "enable" )
42
+ return nil
35
43
}
36
44
37
45
// Inspect examines a plugin manifest
@@ -40,10 +48,10 @@ func (pm *Manager) Inspect(name string) (tp types.Plugin, err error) {
40
48
if err != nil {
41
49
return tp , err
42
50
}
43
- return p .P , nil
51
+ return p .PluginObj , nil
44
52
}
45
53
46
- // Pull pulls a plugin and enables it.
54
+ // Pull pulls a plugin and computes the privileges required to install it.
47
55
func (pm * Manager ) Pull (name string , metaHeader http.Header , authConfig * types.AuthConfig ) (types.PluginPrivileges , error ) {
48
56
ref , err := reference .ParseNamed (name )
49
57
if err != nil {
@@ -86,14 +94,15 @@ func (pm *Manager) Pull(name string, metaHeader http.Header, authConfig *types.A
86
94
pm .save ()
87
95
pm .Unlock ()
88
96
89
- return computePrivileges (& p .P .Manifest ), nil
97
+ pm .pluginEventLogger (pluginID , name , "pull" )
98
+ return computePrivileges (& p .PluginObj .Manifest ), nil
90
99
}
91
100
92
101
// List displays the list of plugins and associated metadata.
93
102
func (pm * Manager ) List () ([]types.Plugin , error ) {
94
103
out := make ([]types.Plugin , 0 , len (pm .plugins ))
95
104
for _ , p := range pm .plugins {
96
- out = append (out , p .P )
105
+ out = append (out , p .PluginObj )
97
106
}
98
107
return out , nil
99
108
}
@@ -104,7 +113,7 @@ func (pm *Manager) Push(name string, metaHeader http.Header, authConfig *types.A
104
113
if err != nil {
105
114
return err
106
115
}
107
- dest := filepath .Join (pm .libRoot , p .P .ID )
116
+ dest := filepath .Join (pm .libRoot , p .PluginObj .ID )
108
117
config , err := os .Open (filepath .Join (dest , "manifest.json" ))
109
118
if err != nil {
110
119
return err
@@ -127,7 +136,11 @@ func (pm *Manager) Remove(name string) error {
127
136
if err != nil {
128
137
return err
129
138
}
130
- return pm .remove (p )
139
+ if err := pm .remove (p ); err != nil {
140
+ return err
141
+ }
142
+ pm .pluginEventLogger (p .PluginObj .ID , name , "remove" )
143
+ return nil
131
144
}
132
145
133
146
// Set sets plugin args
0 commit comments