@@ -74,14 +74,6 @@ func TestUpgradeClusterManual(cluster *shared.Cluster, k8sClient *k8s.Client, ve
7474 return nil
7575}
7676
77- func rebootEc2Instance (awsClient * aws.Client , ip string ) {
78- serverInstanceID , getErr := awsClient .GetInstanceIDByIP (ip )
79- Expect (getErr ).NotTo (HaveOccurred ())
80- shared .LogLevel ("debug" , "Rebooting instance id: %s" , serverInstanceID )
81- rebootError := awsClient .RebootInstance (serverInstanceID )
82- Expect (rebootError ).NotTo (HaveOccurred ())
83- }
84-
8577// upgradeProduct upgrades a node server or agent type to the specified version.
8678func upgradeProduct (awsClient * aws.Client , product , nodeType , installType , ip , nodeOS string ) error {
8779 upgradeCommand := shared .GetInstallCmd (product , installType , nodeType )
@@ -92,12 +84,11 @@ func upgradeProduct(awsClient *aws.Client, product, nodeType, installType, ip, n
9284 }
9385
9486 if nodeOS == "slemicro" {
95- rebootEc2Instance (awsClient , ip )
87+ rebootNodeAndWait (awsClient , ip )
9688 }
9789
9890 actions := []shared.ServiceAction {
99- {Service : product , Action : stop , NodeType : nodeType , ExplicitDelay : 30 },
100- {Service : product , Action : start , NodeType : nodeType , ExplicitDelay : 180 },
91+ {Service : product , Action : restart , NodeType : nodeType , ExplicitDelay : 180 },
10192 {Service : product , Action : status , NodeType : nodeType , ExplicitDelay : 30 },
10293 }
10394
@@ -115,7 +106,18 @@ func upgradeProduct(awsClient *aws.Client, product, nodeType, installType, ip, n
115106
116107 if product == "k3s" {
117108 ms := shared .NewManageService (3 , 10 )
118- output , err := ms .ManageService (ip , []shared.ServiceAction {actions [1 ]})
109+ var output string
110+ var err error
111+ if nodeOS == "slemicro" {
112+ sleActions := []shared.ServiceAction {
113+ {Service : product , Action : stop , NodeType : nodeType , ExplicitDelay : 30 },
114+ {Service : product , Action : start , NodeType : nodeType , ExplicitDelay : 60 },
115+ {Service : product , Action : status , NodeType : nodeType , ExplicitDelay : 180 },
116+ }
117+ output , err = ms .ManageService (ip , sleActions )
118+ } else {
119+ output , err = ms .ManageService (ip , []shared.ServiceAction {actions [1 ]})
120+ }
119121 if output != "" {
120122 Expect (output ).To (ContainSubstring ("active " ),
121123 fmt .Sprintf ("error running %s service %s on %s node: %s" , product , status , nodeType , ip ))
0 commit comments