@@ -930,13 +930,13 @@ func (mgr *ContainerManager) Update(ctx context.Context, name string, config *ty
930930 }
931931
932932 restore := false
933- configBack := * c .Config
934- hostconfigBack := * c .HostConfig
933+ oldConfig := * c .Config
934+ oldHostconfig := * c .HostConfig
935935 defer func () {
936936 if restore {
937937 c .Lock ()
938- c .Config = & configBack
939- c .HostConfig = & hostconfigBack
938+ c .Config = & oldConfig
939+ c .HostConfig = & oldHostconfig
940940 c .Unlock ()
941941 }
942942 }()
@@ -974,20 +974,6 @@ func (mgr *ContainerManager) Update(ctx context.Context, name string, config *ty
974974 }
975975 }
976976 }
977-
978- // TODO(ziren): we should use meta.Config.DiskQuota to record container diskquota
979- // compatibility with alidocker, when set DiskQuota for container
980- // add a DiskQuota label
981- if config .DiskQuota != nil {
982- if _ , ok := c .Config .Labels ["DiskQuota" ]; ok {
983- labels := []string {}
984- for dir , quota := range c .Config .DiskQuota {
985- labels = append (labels , fmt .Sprintf ("%s=%s" , dir , quota ))
986- }
987- c .Config .Labels ["DiskQuota" ] = strings .Join (labels , ";" )
988- }
989- }
990-
991977 c .Unlock ()
992978
993979 // update Resources of a container.
@@ -1020,6 +1006,12 @@ func (mgr *ContainerManager) Update(ctx context.Context, name string, config *ty
10201006 }
10211007 c .Config .Env = newEnvSlice
10221008
1009+ if mgr .containerPlugin != nil {
1010+ if err = mgr .containerPlugin .PostUpdate (c .BaseFS , c .Config .Env ); err != nil {
1011+ return err
1012+ }
1013+ }
1014+
10231015 // If container is not running, update container metadata struct is enough,
10241016 // resources will be updated when the container is started again,
10251017 // If container is running, we need to update configs to the real world.
0 commit comments