func (m *Monitor) Init(nsp model.NSPInterface) error {
	m.eventStreamMaxRetries = 5
	m.Nsp = nsp
	m.wg = nsp.GetWaitGroup()
	m.config = nsp.GetConfig()
	m.collection = nsp.GetCollection()
	// Prepare Docker client
	var err error
	m.Client, err = godocker.NewEnvClient()
	if err != nil {
		return err
	}
	m.EventsContext, m.EventsCancel = context.WithCancel(context.Background())
	// Prepare kubernetes client
	m.k8sClientSet, err = kubernetes.NewForConfig(nsp.GetKubeConfig())
	if err != nil {
		return err
	}
	return nil
}
// Init - Initialize Docker event monitor
Initialize Docker event monitor
// Init - Initialize Docker event monitor
func (m *Monitor) Init(nsp model.NSPInterface) error {
	m.eventStreamMaxRetries = 5
	m.Nsp = nsp
	m.wg = nsp.GetWaitGroup()
	m.config = nsp.GetConfig()
	m.collection = nsp.GetCollection()
	var err error
	m.Client, err = godocker.NewEnvClient()
	if err != nil {
		return err
	}
	m.EventsContext, m.EventsCancel = context.WithCancel(context.Background())
	m.k8sClientSet, err = kubernetes.NewForConfig(nsp.GetKubeConfig())
	if err != nil {
		return err
	}
	return nil
}
func ( m * Monitor ) Init ( nsp model . NSPInterface ) error { m . eventStreamMaxRetries = 5 m . Nsp = nsp m . wg = nsp . GetWaitGroup ( ) m . config = nsp . GetConfig ( ) m . collection = nsp . GetCollection ( ) var err error m . Client , err = godocker . NewEnvClient ( ) if err != nil { return err } m . EventsContext , m . EventsCancel = context . WithCancel ( context . Background ( ) ) m . k8sClientSet , err = kubernetes . NewForConfig ( nsp . GetKubeConfig ( ) ) if err != nil { return err } return nil }
Initialize Docker event monitor
Initialize Docker event monitor
// Prepare Docker client // Prepare kubernetes client