()
| 97 | } |
| 98 | |
| 99 | func (i *imlLogService) OnComplete() { |
| 100 | drivers := log_driver.Drivers() |
| 101 | if len(drivers) < 1 { |
| 102 | return |
| 103 | } |
| 104 | ctx := context.Background() |
| 105 | for _, driver := range drivers { |
| 106 | factory, has := log_driver.GetFactory(driver) |
| 107 | if !has { |
| 108 | log_print.Errorf("driver %s not found", driver) |
| 109 | continue |
| 110 | } |
| 111 | info, err := i.GetLogSource(ctx, driver) |
| 112 | if err != nil { |
| 113 | log_print.Errorf("get log source %s error: %s", driver, err) |
| 114 | continue |
| 115 | } |
| 116 | d, _, err := factory.Create(info.Config) |
| 117 | if err != nil { |
| 118 | log_print.Errorf("create driver %s error: %s,config: %s", driver, err, info.Config) |
| 119 | continue |
| 120 | } |
| 121 | log_driver.SetDriver(driver, d) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func (i *imlLogService) UpdateLogSource(ctx context.Context, driver string, input *Save) error { |
| 126 | s, err := i.store.First(ctx, map[string]interface{}{"driver": driver}) |
nothing calls this directly
no test coverage detected