@@ -492,7 +492,12 @@ func getLatestConfig(getconfigCtx *getconfigContext, url string,
492
492
log .Errorf ("getLatestConfig failed: %s" , err )
493
493
}
494
494
switch senderStatus {
495
- case types .SenderStatusUpgrade , types .SenderStatusRefused , types .SenderStatusCertInvalid , types .SenderStatusNotFound :
495
+ case types .SenderStatusCertInvalid :
496
+ // trigger to acquire new controller certs from cloud
497
+ log .Noticef ("%s trigger" , senderStatus .String ())
498
+ triggerControllerCertEvent (ctx )
499
+ fallthrough
500
+ case types .SenderStatusUpgrade , types .SenderStatusRefused , types .SenderStatusNotFound :
496
501
newCount = types .LedBlinkConnectedToController // Almost connected to controller!
497
502
// Don't treat as upgrade failure
498
503
if getconfigCtx .updateInprogress {
@@ -501,7 +506,7 @@ func getLatestConfig(getconfigCtx *getconfigContext, url string,
501
506
}
502
507
case types .SenderStatusCertMiss :
503
508
// trigger to acquire new controller certs from cloud
504
- log .Noticef ("SenderStatusCertMiss trigger" )
509
+ log .Noticef ("%s trigger" , senderStatus . String () )
505
510
triggerControllerCertEvent (ctx )
506
511
}
507
512
if getconfigCtx .ledBlinkCount == types .LedBlinkOnboarded {
@@ -585,9 +590,10 @@ func getLatestConfig(getconfigCtx *getconfigContext, url string,
585
590
url , contents , false , senderStatus )
586
591
if err != nil {
587
592
log .Errorf ("RemoveAndVerifyAuthContainer failed: %s" , err )
588
- if rv .Status == types .SenderStatusCertMiss {
593
+ switch senderStatus {
594
+ case types .SenderStatusCertMiss , types .SenderStatusCertInvalid :
589
595
// trigger to acquire new controller certs from cloud
590
- log .Noticef ("SenderStatusCertMiss trigger" )
596
+ log .Noticef ("%s trigger" , senderStatus . String () )
591
597
triggerControllerCertEvent (ctx )
592
598
}
593
599
// Inform ledmanager about problem
0 commit comments