(containerID string)
| 33 | ) |
| 34 | |
| 35 | func (f *Funclet) InitContainerEvent(containerID string) (err error) { |
| 36 | ctx := &funcletCtx.Context{ |
| 37 | Logger: f.logger, |
| 38 | } |
| 39 | if _, err := f.ContainerManager.LockContainer(containerID, api.EventInit, ctx); err != nil { |
| 40 | f.logger.WithField("containerID", containerID).Errorf("get lock failed: %s", err) |
| 41 | return err |
| 42 | } |
| 43 | defer f.ContainerManager.UnLockContainerWithLog(containerID, ctx) |
| 44 | |
| 45 | info, _ := f.ContainerManager.ContainerMap.GetContainer(containerID) |
| 46 | ctx.SetContainer(info) |
| 47 | |
| 48 | return f.InitContainer(ctx) |
| 49 | } |
| 50 | |
| 51 | func (f *Funclet) InitContainer(ctx *funcletCtx.Context) (err error) { |
| 52 | ctx.Logger.Infof("start init container") |
no test coverage detected