@@ -203,7 +203,7 @@ func (cs *commandService) Subscribe(in pb.CommandService_SubscribeServer) error
203203 // Only broadcast operations should signal ResponseCh for coordination.
204204 pendingBroadcastRequest = & msg
205205 case err = <- msgr .Errors ():
206- cs .logger .Error (err , "connection error" , "deployment" , conn .ParentName , "uuid" , gi .UUID )
206+ cs .logger .Error (err , "connection error" , conn . ParentType , conn .ParentName , "uuid" , gi .UUID )
207207 deployment .SetPodErrorStatus (gi .UUID , err )
208208 select {
209209 case channels .ResponseCh <- struct {}{}:
@@ -248,7 +248,7 @@ func (cs *commandService) Subscribe(in pb.CommandService_SubscribeServer) error
248248
249249func (cs * commandService ) waitForConnection (
250250 ctx context.Context ,
251- gi grpcContext.GrpcInfo ,
251+ grpcInfo grpcContext.GrpcInfo ,
252252) (* agentgrpc.Connection , * Deployment , error ) {
253253 ticker := time .NewTicker (time .Second )
254254 defer ticker .Stop ()
@@ -267,7 +267,7 @@ func (cs *commandService) waitForConnection(
267267 case <- timer .C :
268268 return nil , nil , err
269269 case <- ticker .C :
270- if conn := cs .connTracker .GetConnection (gi .UUID ); conn .Ready () {
270+ if conn := cs .connTracker .GetConnection (grpcInfo .UUID ); conn .Ready () {
271271 // connection has been established, now ensure that the deployment exists in the store
272272 if deployment := cs .nginxDeployments .Get (conn .ParentName ); deployment != nil {
273273 return & conn , deployment , nil
@@ -283,7 +283,7 @@ func (cs *commandService) waitForConnection(
283283// setInitialConfig gets the initial configuration for this connection and applies it.
284284func (cs * commandService ) setInitialConfig (
285285 ctx context.Context ,
286- gi * grpcContext.GrpcInfo ,
286+ grpcInfo * grpcContext.GrpcInfo ,
287287 deployment * Deployment ,
288288 conn * agentgrpc.Connection ,
289289 msgr messenger.Messenger ,
@@ -292,7 +292,7 @@ func (cs *commandService) setInitialConfig(
292292 defer deployment .FileLock .Unlock ()
293293
294294 if err := cs .validatePodImageVersion (conn .ParentName , conn .ParentType , deployment .imageVersion ); err != nil {
295- cs .logAndSendErrorStatus (gi , deployment , conn , err )
295+ cs .logAndSendErrorStatus (grpcInfo , deployment , conn , err )
296296 return grpcStatus .Errorf (codes .FailedPrecondition , "nginx image version validation failed: %s" , err .Error ())
297297 }
298298
@@ -301,12 +301,12 @@ func (cs *commandService) setInitialConfig(
301301 cs .logger .Info (
302302 "Sending initial configuration to agent" ,
303303 conn .ParentType , conn .ParentName ,
304- "uuid" , gi .UUID ,
304+ "uuid" , grpcInfo .UUID ,
305305 "configVersion" , configVersion ,
306306 )
307307
308308 if err := msgr .Send (ctx , buildRequest (fileOverviews , conn .InstanceID , configVersion )); err != nil {
309- cs .logAndSendErrorStatus (gi , deployment , conn , err )
309+ cs .logAndSendErrorStatus (grpcInfo , deployment , conn , err )
310310
311311 return grpcStatus .Error (codes .Internal , err .Error ())
312312 }
@@ -330,7 +330,7 @@ func (cs *commandService) setInitialConfig(
330330 true , // poll immediately
331331 func (ctx context.Context ) (bool , error ) {
332332 if err := msgr .Send (ctx , buildPlusAPIRequest (action , conn .InstanceID )); err != nil {
333- cs .logAndSendErrorStatus (gi , deployment , conn , err )
333+ cs .logAndSendErrorStatus (grpcInfo , deployment , conn , err )
334334
335335 return false , grpcStatus .Error (codes .Internal , err .Error ())
336336 }
@@ -359,7 +359,7 @@ func (cs *commandService) setInitialConfig(
359359 cancel ()
360360 }
361361 // send the status (error or nil) to the status queue
362- cs .logAndSendErrorStatus (gi , deployment , conn , errors .Join (errs ... ))
362+ cs .logAndSendErrorStatus (grpcInfo , deployment , conn , errors .Join (errs ... ))
363363
364364 return nil
365365}
@@ -403,7 +403,7 @@ func (cs *commandService) waitForInitialConfigApply(
403403// exist on the Deployment are not overwritten.
404404// If the error is nil, then we just enqueue the nil value and don't log it, which indicates success.
405405func (cs * commandService ) logAndSendErrorStatus (
406- gi * grpcContext.GrpcInfo ,
406+ grpcInfo * grpcContext.GrpcInfo ,
407407 deployment * Deployment ,
408408 conn * agentgrpc.Connection ,
409409 err error ,
@@ -414,10 +414,10 @@ func (cs *commandService) logAndSendErrorStatus(
414414 cs .logger .Info (
415415 "Successfully configured nginx for new subscription" ,
416416 conn .ParentType , conn .ParentName ,
417- "uuid" , gi .UUID ,
417+ "uuid" , grpcInfo .UUID ,
418418 )
419419 }
420- deployment .SetPodErrorStatus (gi .UUID , err )
420+ deployment .SetPodErrorStatus (grpcInfo .UUID , err )
421421
422422 queueObj := & status.QueueObject {
423423 Deployment : conn .ParentName ,
0 commit comments