@@ -189,30 +189,30 @@ func (s *ArgoRolloutsServer) Run(ctx context.Context, port int, dashboard bool)
189
189
errors .CheckError (conn .Close ())
190
190
}
191
191
192
- func (s * ArgoRolloutsServer ) initRolloutViewController (name string , ctx context.Context ) * viewcontroller.RolloutViewController {
193
- controller := viewcontroller .NewRolloutViewController (s . Options . Namespace , name , s .Options .KubeClientset , s .Options .RolloutsClientset )
192
+ func (s * ArgoRolloutsServer ) initRolloutViewController (namespace string , name string , ctx context.Context ) * viewcontroller.RolloutViewController {
193
+ controller := viewcontroller .NewRolloutViewController (namespace , name , s .Options .KubeClientset , s .Options .RolloutsClientset )
194
194
controller .Start (ctx )
195
195
return controller
196
196
}
197
197
198
- func (s * ArgoRolloutsServer ) getRolloutInfo (name string ) (* rollout.RolloutInfo , error ) {
199
- controller := s .initRolloutViewController (name , context .Background ())
198
+ func (s * ArgoRolloutsServer ) getRolloutInfo (namespace string , name string ) (* rollout.RolloutInfo , error ) {
199
+ controller := s .initRolloutViewController (namespace , name , context .Background ())
200
200
ri , err := controller .GetRolloutInfo ()
201
201
if err != nil {
202
202
return nil , err
203
203
}
204
204
return ri , nil
205
205
}
206
206
207
- // GetRollout returns a rollout
207
+ // GetRolloutInfo returns a rollout
208
208
func (s * ArgoRolloutsServer ) GetRolloutInfo (c context.Context , q * rollout.RolloutInfoQuery ) (* rollout.RolloutInfo , error ) {
209
- return s .getRolloutInfo (q .GetName ())
209
+ return s .getRolloutInfo (q .GetNamespace (), q . GetName ())
210
210
}
211
211
212
- // WatchRollout returns a rollout stream
212
+ // WatchRolloutInfo returns a rollout stream
213
213
func (s * ArgoRolloutsServer ) WatchRolloutInfo (q * rollout.RolloutInfoQuery , ws rollout.RolloutService_WatchRolloutInfoServer ) error {
214
- ctx := context . Background ()
215
- controller := s .initRolloutViewController (q .GetName (), ctx )
214
+ ctx := ws . Context ()
215
+ controller := s .initRolloutViewController (q .GetNamespace (), q . GetName (), ctx )
216
216
217
217
rolloutUpdates := make (chan * rollout.RolloutInfo )
218
218
controller .RegisterCallback (func (roInfo * rollout.RolloutInfo ) {
@@ -250,7 +250,7 @@ func (s *ArgoRolloutsServer) ListReplicaSetsAndPods(ctx context.Context, namespa
250
250
return allReplicaSetsP , allPodsP , nil
251
251
}
252
252
253
- // ListRollouts returns a list of all rollouts
253
+ // ListRolloutInfos returns a list of all rollouts
254
254
func (s * ArgoRolloutsServer ) ListRolloutInfos (ctx context.Context , q * rollout.RolloutInfoListQuery ) (* rollout.RolloutInfoList , error ) {
255
255
rolloutIf := s .Options .RolloutsClientset .ArgoprojV1alpha1 ().Rollouts (q .GetNamespace ())
256
256
rolloutList , err := rolloutIf .List (ctx , v1.ListOptions {})
@@ -281,7 +281,7 @@ func (s *ArgoRolloutsServer) RestartRollout(ctx context.Context, q *rollout.Rest
281
281
return restart .RestartRollout (rolloutIf , q .GetName (), & restartAt )
282
282
}
283
283
284
- // WatchRollouts returns a stream of all rollouts
284
+ // WatchRolloutInfos returns a stream of all rollouts
285
285
func (s * ArgoRolloutsServer ) WatchRolloutInfos (q * rollout.RolloutInfoListQuery , ws rollout.RolloutService_WatchRolloutInfosServer ) error {
286
286
send := func (r * rollout.RolloutInfo ) {
287
287
err := ws .Send (& rollout.RolloutWatchEvent {
0 commit comments