@@ -58,6 +58,7 @@ type argoKubeClient struct {
58
58
cwfTmplStore types.ClusterWorkflowTemplateStore
59
59
wfLister store.WorkflowLister
60
60
wfStore store.WorkflowStore
61
+ namespace string
61
62
}
62
63
63
64
var _ Client = & argoKubeClient {}
@@ -108,18 +109,19 @@ func newArgoKubeClient(ctx context.Context, opts ArgoKubeOpts, clientConfig clie
108
109
opts : opts ,
109
110
instanceIDService : instanceIDService ,
110
111
wfClient : wfClient ,
112
+ namespace : namespace ,
111
113
}
112
- err = client .startStores (restConfig , namespace )
114
+ err = client .startStores (restConfig )
113
115
if err != nil {
114
116
return nil , nil , err
115
117
}
116
118
117
119
return ctx , client , nil
118
120
}
119
121
120
- func (a * argoKubeClient ) startStores (restConfig * restclient.Config , namespace string ) error {
122
+ func (a * argoKubeClient ) startStores (restConfig * restclient.Config ) error {
121
123
if a .opts .UseCaching {
122
- wftmplInformer , err := workflowtemplateserver .NewInformer (restConfig , namespace )
124
+ wftmplInformer , err := workflowtemplateserver .NewInformer (restConfig , a . namespace )
123
125
if err != nil {
124
126
return err
125
127
}
@@ -147,7 +149,9 @@ func (a *argoKubeClient) startStores(restConfig *restclient.Config, namespace st
147
149
148
150
func (a * argoKubeClient ) NewWorkflowServiceClient () workflowpkg.WorkflowServiceClient {
149
151
wfArchive := sqldb .NullWorkflowArchive
150
- return & errorTranslatingWorkflowServiceClient {& argoKubeWorkflowServiceClient {workflowserver .NewWorkflowServer (a .instanceIDService , argoKubeOffloadNodeStatusRepo , wfArchive , a .wfClient , a .wfLister , a .wfStore , a .wfTmplStore , a .cwfTmplStore , nil , nil )}}
152
+ wfServer := workflowserver .NewWorkflowServer (a .instanceIDService , argoKubeOffloadNodeStatusRepo , wfArchive , a .wfClient , a .wfLister , a .wfStore , a .wfTmplStore , a .cwfTmplStore , nil , & a .namespace )
153
+ go wfServer .Run (a .opts .CachingCloseCh )
154
+ return & errorTranslatingWorkflowServiceClient {& argoKubeWorkflowServiceClient {wfServer }}
151
155
}
152
156
153
157
func (a * argoKubeClient ) NewCronWorkflowServiceClient () (cronworkflow.CronWorkflowServiceClient , error ) {
0 commit comments